mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fixes session_id passing in agent_openai completion. (#10124)
### What problem does this PR solve? An exception happens if you give session_id to agent_open_ai completion. Because session_id is being given as well as **req so it tries to send session_id twice. But also the logic seemed odd on picking one of session_id, id, metadata.id. So cleaned it up a little. See #10111 ### Type of change - [X] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
committed by
GitHub
parent
5a8bc88147
commit
f3738b06f1
@ -414,7 +414,7 @@ def agents_completion_openai_compatibility(tenant_id, agent_id):
|
||||
tenant_id,
|
||||
agent_id,
|
||||
question,
|
||||
session_id=req.get("session_id", req.get("id", "") or req.get("metadata", {}).get("id", "")),
|
||||
session_id=req.pop("session_id", req.get("id", "")) or req.get("metadata", {}).get("id", ""),
|
||||
stream=True,
|
||||
**req,
|
||||
),
|
||||
@ -432,7 +432,7 @@ def agents_completion_openai_compatibility(tenant_id, agent_id):
|
||||
tenant_id,
|
||||
agent_id,
|
||||
question,
|
||||
session_id=req.get("session_id", req.get("id", "") or req.get("metadata", {}).get("id", "")),
|
||||
session_id=req.pop("session_id", req.get("id", "")) or req.get("metadata", {}).get("id", ""),
|
||||
stream=False,
|
||||
**req,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user