From 59bf5ba84830ea6c9800c7515fe71a15031d35ce Mon Sep 17 00:00:00 2001 From: Yuhong Sun Date: Fri, 19 Jul 2024 20:45:18 -0700 Subject: [PATCH] File Connector Metadata (#1876) --- backend/danswer/connectors/file/connector.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/danswer/connectors/file/connector.py b/backend/danswer/connectors/file/connector.py index 998a82f23..cc5996b7e 100644 --- a/backend/danswer/connectors/file/connector.py +++ b/backend/danswer/connectors/file/connector.py @@ -88,7 +88,7 @@ def _process_file( # add a prefix to avoid conflicts with other connectors doc_id = f"FILE_CONNECTOR__{file_name}" if metadata: - doc_id = metadata.get("id") or doc_id + doc_id = metadata.get("document_id") or doc_id # If this is set, we will show this in the UI as the "name" of the file file_display_name = all_metadata.get("file_display_name") or os.path.basename( @@ -111,6 +111,7 @@ def _process_file( for k, v in all_metadata.items() if k not in [ + "document_id" "time_updated", "doc_updated_at", "link",