|
@@ -54,6 +54,21 @@ class SimpleOpenAICompatibleChatAgent:
|
|
|
logger.debug(f"run_id[{run_id}] current step content: {message.content}")
|
|
|
|
|
|
if message.tool_calls:
|
|
|
+ call_list = [] # 存储函数调用信息的列表
|
|
|
+ for tool_call in message.tool_calls:
|
|
|
+ function_name = tool_call.function.name
|
|
|
+ arguments = json.loads(tool_call.function.arguments)
|
|
|
+ call_list.append({
|
|
|
+ "name": function_name,
|
|
|
+ "parameters": arguments
|
|
|
+ })
|
|
|
+ tool_message = json.dumps(call_list, ensure_ascii=False, indent=2)
|
|
|
+ agent_task_detail = AgentTaskDetail()
|
|
|
+ agent_task_detail.executor_type = 'llm'
|
|
|
+ agent_task_detail.executor_name = self.model
|
|
|
+ agent_task_detail.output_data = tool_message
|
|
|
+ agent_task_detail.status = AgentTaskDetailStatus.SUCCESS.value
|
|
|
+ self.agent_task_details.append(agent_task_detail)
|
|
|
for tool_call in message.tool_calls:
|
|
|
function_name = tool_call.function.name
|
|
|
arguments = json.loads(tool_call.function.arguments)
|