Fix session API issues. (#3939)

### What problem does this PR solve?


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2024-12-09 17:37:36 +08:00
committed by GitHub
parent afe82feb57
commit 255f4ccffc
3 changed files with 6 additions and 2 deletions

View File

@ -374,14 +374,14 @@ def chatbot_completions(dialog_id):
req["quote"] = False
if req.get("stream", True):
resp = Response(iframe_completion(objs[0].tenant_id, dialog_id, **req), mimetype="text/event-stream")
resp = Response(iframe_completion(dialog_id, **req), mimetype="text/event-stream")
resp.headers.add_header("Cache-control", "no-cache")
resp.headers.add_header("Connection", "keep-alive")
resp.headers.add_header("X-Accel-Buffering", "no")
resp.headers.add_header("Content-Type", "text/event-stream; charset=utf-8")
return resp
for answer in agent_completion(objs[0].tenant_id, dialog_id, **req):
for answer in iframe_completion(dialog_id, **req):
return get_result(data=answer)