fix: missing name in tool return (#6381)
* fix: missing name in tool return * add empty check
This commit is contained in:
@@ -523,9 +523,10 @@ def create_parallel_tool_messages_from_llm_response(
|
||||
agent_id=agent_id,
|
||||
model=model,
|
||||
tool_calls=[],
|
||||
tool_call_id=tool_returns[0].tool_call_id, # For legacy reasons, set to first one
|
||||
tool_call_id=tool_returns[0].tool_call_id if tool_returns else None, # For legacy reasons, set to first one
|
||||
created_at=get_utc_time(),
|
||||
batch_item_id=llm_batch_item_id,
|
||||
name=tool_call_specs[0].get("name") if tool_call_specs else None, # For legacy reasons, set to first one
|
||||
tool_returns=tool_returns,
|
||||
run_id=run_id,
|
||||
)
|
||||
|
||||
@@ -1371,6 +1371,7 @@ class SyncServer(object):
|
||||
id="null",
|
||||
tool_call_id="null",
|
||||
date=get_utc_time(),
|
||||
name=tool_name,
|
||||
status=tool_execution_result.status,
|
||||
tool_return=str(tool_execution_result.func_return),
|
||||
stdout=tool_execution_result.stdout,
|
||||
@@ -1394,6 +1395,7 @@ class SyncServer(object):
|
||||
id="null",
|
||||
tool_call_id="null",
|
||||
date=get_utc_time(),
|
||||
name=tool.name,
|
||||
status="error",
|
||||
tool_return=func_return,
|
||||
stdout=[],
|
||||
|
||||
Reference in New Issue
Block a user