mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 15:31:05 +08:00
fix(agent): handle different reference data formats (#16276)
This commit is contained in:
@@ -368,7 +368,14 @@ async def completion(tenant_id, agent_id, session_id=None, **kwargs):
|
||||
yield "data:" + json.dumps(ans, ensure_ascii=False) + "\n\n"
|
||||
|
||||
conv.message.append({"role": "assistant", "content": txt, "created_at": time.time(), "id": message_id})
|
||||
conv.reference = canvas.get_reference()
|
||||
current_reference = canvas.get_reference()
|
||||
if not isinstance(current_reference, dict):
|
||||
current_reference = {}
|
||||
if not conv.reference:
|
||||
conv.reference = []
|
||||
if isinstance(conv.reference, dict):
|
||||
conv.reference = [conv.reference]
|
||||
conv.reference.append(current_reference)
|
||||
conv.errors = canvas.error
|
||||
conv.dsl = str(canvas)
|
||||
conv = conv.to_dict()
|
||||
|
||||
Reference in New Issue
Block a user