@tjb-tech
File "/.../.../Auto-Deep-Research/autoagent/core.py", line 162, in get_chat_completion
converted_tool_calls = [ChatCompletionMessageToolCall(**tool_call) for tool_call in converted_message[0]["tool_calls"]]
KeyError: 'tool_calls'
You can add a layer of conditional judgment. Modify the get_chat_completion function in the core file (line 162) as follows:
converted_tool_calls = [ChatCompletionMessageToolCall(**tool_call) for tool_call in converted_message[0]["tool_calls"]]
change to:
if "tool_calls" in converted_message[0]:
converted_tool_calls = [
ChatCompletionMessageToolCall(**tool_call)
for tool_call in converted_message[0]["tool_calls"]
]
else:
converted_tool_calls = None
@tjb-tech
You can add a layer of conditional judgment. Modify the
get_chat_completionfunction in thecorefile (line 162) as follows:converted_tool_calls = [ChatCompletionMessageToolCall(**tool_call) for tool_call in converted_message[0]["tool_calls"]]change to: