mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-25 01:20:11 +08:00
Feat: File uploads for future conversations on SDK API (#13378)
### What problem does this PR solve? This PR aims to: 1. Enable file uploads for the public API, similarly to what /document/upload_info accomplishes for the frontend; 2. Enable files sent to the /chat/:chat_id/completions endpoint to be used within the conversation. We classify the first item as a new future, while classifying the second one as a bug fix. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality) *The work related to this PR was co-authored by* [Bruno Ferreira](https://github.com/brunopferreira): Custom Solutions Manager @ [Orbcom](https://orbcom.pt/) [Pedro Ferreira](https://github.com/sirj0k3r): Lead Software Developer @ [Orbcom](https://orbcom.pt/) [Pedro Cardoso](https://github.com/pedromiguel4560): Associate Software Developer @ [Orbcom](https://orbcom.pt/) *This PR replaces #13248* --------- Co-authored-by: Pedro Cardoso <pedrocardoso@orbcom.pt> Co-authored-by: Pedro Ferreira <pedroferreira@orbcom.pt>
This commit is contained in:
committed by
GitHub
parent
020068dd16
commit
61209ff3bf
@@ -158,6 +158,11 @@ async def async_completion(tenant_id, chat_id, question, name="New session", ses
|
||||
"role": "user",
|
||||
"id": str(uuid4())
|
||||
}
|
||||
|
||||
# Propagate runtime attachments so downstream chat flow can resolve file content.
|
||||
if isinstance(kwargs.get("files"), list) and kwargs["files"]:
|
||||
question["files"] = kwargs["files"]
|
||||
|
||||
conv.message.append(question)
|
||||
for m in conv.message:
|
||||
if m["role"] == "system":
|
||||
|
||||
Reference in New Issue
Block a user