Skip to content

Commit 7d655d1

Browse files
authored
Merge pull request #72 from TukaTek/feature/implement-GPT-5
Add the odt fix
2 parents 7539405 + dfb4d14 commit 7d655d1

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

backend/onyx/server/documents/connector.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,18 +1988,13 @@ def should_process_file(file_path: str) -> bool:
19881988
if file.content_type == "application/vnd.oasis.opendocument.text" or (
19891989
file.filename and file.filename.lower().endswith('.odt')
19901990
):
1991-
extracted_text = convert_odt_to_txt(file.file) # Define this helper; see below
1992-
text_file_id = file_store.save_file(
1993-
content=io.BytesIO(extracted_text.encode()),
1994-
display_name=file.filename,
1995-
file_origin=file_origin,
1996-
file_type="text/plain",
1997-
)
1991+
text_file_id = convert_odt_to_txt(file, file_store)
19981992
deduped_file_paths.append(text_file_id)
19991993
deduped_file_names.append(file.filename)
20001994
continue
20011995

20021996

1997+
20031998
# Special handling for doc files - only store the plaintext version
20041999
file_type = mime_type_to_chat_file_type(file.content_type)
20052000
if file_type == ChatFileType.DOC:

0 commit comments

Comments
 (0)