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:
parent
5a8bc88147
commit
f3738b06f1
1 changed files with 2 additions and 2 deletions
|
|
@ -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,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue