enh/refac: temp chat file upload behaviour

client-side content extraction
This commit is contained in:
Timothy Jaeryang Baek
2025-07-09 22:59:37 +04:00
parent 8fb54b133e
commit 8d84b4c2a4
6 changed files with 350 additions and 38 deletions

View File

@@ -471,6 +471,12 @@ def get_sources_from_files(
"documents": [[doc.get("content") for doc in file.get("docs")]],
"metadatas": [[doc.get("metadata") for doc in file.get("docs")]],
}
elif file.get("type") == "text":
# Text File
query_result = {
"documents": [[file.get("content")]],
"metadatas": [[{"file_id": file.get("id"), "name": file.get("name")}]],
}
elif file.get("type") == "note":
# Note Attached
note = Notes.get_note_by_id(file.get("id"))