Omit optional function_call id in Responses replay input
This commit is contained in:
parent
e63986b534
commit
47f16505d2
2 changed files with 5 additions and 16 deletions
11
run_agent.py
11
run_agent.py
|
|
@ -1323,16 +1323,6 @@ class AIAgent:
|
|||
call_id = f"call_{uuid.uuid4().hex[:12]}"
|
||||
call_id = call_id.strip()
|
||||
|
||||
response_item_id = tc.get("response_item_id")
|
||||
if not isinstance(response_item_id, str) or not response_item_id.strip():
|
||||
response_item_id = tc.get("responses_item_id")
|
||||
if not isinstance(response_item_id, str) or not response_item_id.strip():
|
||||
response_item_id = embedded_response_item_id
|
||||
response_item_id = self._derive_responses_function_call_id(
|
||||
call_id,
|
||||
response_item_id if isinstance(response_item_id, str) else None,
|
||||
)
|
||||
|
||||
arguments = fn.get("arguments", "{}")
|
||||
if isinstance(arguments, dict):
|
||||
arguments = json.dumps(arguments, ensure_ascii=False)
|
||||
|
|
@ -1342,7 +1332,6 @@ class AIAgent:
|
|||
|
||||
items.append({
|
||||
"type": "function_call",
|
||||
"id": response_item_id,
|
||||
"call_id": call_id,
|
||||
"name": fn_name,
|
||||
"arguments": arguments,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue