From 5b07a0a3d2fdaeae3523f5f5a1d95cc19357de5e Mon Sep 17 00:00:00 2001 From: Leon Luithlen Date: Mon, 4 Nov 2024 17:24:46 +0100 Subject: [PATCH] Add type hint in extract_text_from_file --- cognee/infrastructure/files/utils/extract_text_from_file.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cognee/infrastructure/files/utils/extract_text_from_file.py b/cognee/infrastructure/files/utils/extract_text_from_file.py index 564704bec..171128b2e 100644 --- a/cognee/infrastructure/files/utils/extract_text_from_file.py +++ b/cognee/infrastructure/files/utils/extract_text_from_file.py @@ -1,7 +1,8 @@ from typing import BinaryIO from pypdf import PdfReader +import filetype -def extract_text_from_file(file: BinaryIO, file_type) -> str: +def extract_text_from_file(file: BinaryIO, file_type: filetype.Type) -> str: """Extract text from a file""" if file_type.extension == "pdf": reader = PdfReader(stream = file)