Skip to content

Commit 2bb7b67

Browse files
committed
fix filename
1 parent c933ef4 commit 2bb7b67

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

templates/types/streaming/fastapi/app/api/routers/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ class SourceNodes(BaseModel):
172172
def from_source_node(cls, source_node: NodeWithScore):
173173
metadata = source_node.node.metadata
174174

175+
url = metadata.get("URL")
175176
pipeline_id = metadata.get("pipeline_id")
176177
file_name = metadata.get("file_name")
177178
is_private = metadata.get("private", "false") == "true"

templates/types/streaming/fastapi/app/api/services/file.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def store_and_parse_file(file_data, extension) -> List[Document]:
5252
documents = reader_cls().load_data(file_path)
5353
# Add custom metadata
5454
for doc in documents:
55+
doc.metadata["file_name"] = file_name
5556
doc.metadata["private"] = "true"
5657
doc.metadata["is_local_file"] = "true"
5758
return documents

0 commit comments

Comments
 (0)