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)