mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Feature (canvas): Add mind tagging support (#11359)
### What problem does this PR solve? Resolve the issue of missing thinking labels when viewing pre-existing conversations ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -223,6 +223,10 @@ def completion(tenant_id, agent_id, session_id=None, **kwargs):
|
||||
ans["session_id"] = session_id
|
||||
if ans["event"] == "message":
|
||||
txt += ans["data"]["content"]
|
||||
if ans["data"].get("start_to_think", False):
|
||||
txt += "<think>"
|
||||
elif ans["data"].get("end_to_think", False):
|
||||
txt += "</think>"
|
||||
yield "data:" + json.dumps(ans, ensure_ascii=False) + "\n\n"
|
||||
|
||||
conv.message.append({"role": "assistant", "content": txt, "created_at": time.time(), "id": message_id})
|
||||
|
||||
Reference in New Issue
Block a user