From 99fbfba32f5b5e851743866a72c9d32a7f09d195 Mon Sep 17 00:00:00 2001 From: Yuhong Sun Date: Fri, 8 Nov 2024 10:49:59 -0800 Subject: [PATCH] File Connector Metadata (#3089) --- backend/danswer/connectors/file/connector.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/danswer/connectors/file/connector.py b/backend/danswer/connectors/file/connector.py index 13744f02b2f..b263354822f 100644 --- a/backend/danswer/connectors/file/connector.py +++ b/backend/danswer/connectors/file/connector.py @@ -123,9 +123,13 @@ def _process_file( "filename", "file_display_name", "title", + "connector_type", ] } + source_type_str = all_metadata.get("connector_type") + source_type = DocumentSource(source_type_str) if source_type_str else None + p_owner_names = all_metadata.get("primary_owners") s_owner_names = all_metadata.get("secondary_owners") p_owners = ( @@ -145,7 +149,7 @@ def _process_file( sections=[ Section(link=all_metadata.get("link"), text=file_content_raw.strip()) ], - source=DocumentSource.FILE, + source=source_type or DocumentSource.FILE, semantic_identifier=file_display_name, title=title, doc_updated_at=final_time_updated,