mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-05-15 06:10:15 +02:00
Fix import location and mypy issue (#249)
This commit is contained in:
parent
2a339ec34b
commit
55adde5e27
@ -6,6 +6,7 @@ from collections.abc import Sequence
|
|||||||
from itertools import chain
|
from itertools import chain
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
import docx2txt # type:ignore
|
||||||
from danswer.configs.app_configs import GOOGLE_DRIVE_INCLUDE_SHARED
|
from danswer.configs.app_configs import GOOGLE_DRIVE_INCLUDE_SHARED
|
||||||
from danswer.configs.app_configs import INDEX_BATCH_SIZE
|
from danswer.configs.app_configs import INDEX_BATCH_SIZE
|
||||||
from danswer.configs.constants import DocumentSource
|
from danswer.configs.constants import DocumentSource
|
||||||
@ -151,8 +152,6 @@ def extract_text(file: dict[str, str], service: discovery.Resource) -> str:
|
|||||||
mime_type
|
mime_type
|
||||||
== "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
== "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
||||||
):
|
):
|
||||||
import docx2txt
|
|
||||||
|
|
||||||
response = service.files().get_media(fileId=file["id"]).execute()
|
response = service.files().get_media(fileId=file["id"]).execute()
|
||||||
word_stream = io.BytesIO(response)
|
word_stream = io.BytesIO(response)
|
||||||
with tempfile.NamedTemporaryFile(delete=False) as temp:
|
with tempfile.NamedTemporaryFile(delete=False) as temp:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user