add function: upload and parse (#1889)

### What problem does this PR solve?

#1880
### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Kevin Hu
2024-08-09 16:20:02 +08:00
committed by GitHub
parent 6529c764c9
commit e3cf14a3c9
8 changed files with 255 additions and 89 deletions

View File

@ -118,6 +118,8 @@ def completion():
if m["role"] == "assistant" and not msg:
continue
msg.append({"role": m["role"], "content": m["content"]})
if "doc_ids" in m:
msg[-1]["doc_ids"] = m["doc_ids"]
try:
e, conv = ConversationService.get_by_id(req["conversation_id"])
if not e: