Optimize conversation when uploading attachments (#4964)

### What problem does this PR solve?

#4929

### Type of change

- [x] Performance Improvement
This commit is contained in:
kuschzzp 2025-02-17 12:03:04 +08:00 committed by GitHub
parent f29da49893
commit 88daa349f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -204,9 +204,6 @@ def chat(dialog, messages, stream=True, **kwargs):
attachments = kwargs["doc_ids"].split(",") if "doc_ids" in kwargs else None
if "doc_ids" in messages[-1]:
attachments = messages[-1]["doc_ids"]
for m in messages[:-1]:
if "doc_ids" in m:
attachments.extend(m["doc_ids"])
create_retriever_ts = timer()