|
|
@@ -415,10 +415,13 @@ class AgentRunner:
|
|
|
for tc in tool_calls:
|
|
|
tool_name = tc["function"]["name"]
|
|
|
tool_args = tc["function"]["arguments"]
|
|
|
- if isinstance(tool_args, str):
|
|
|
+ if tool_args and isinstance(tool_args, str):
|
|
|
import json
|
|
|
tool_args = json.loads(tool_args)
|
|
|
|
|
|
+ if not tool_args:
|
|
|
+ tool_args = {}
|
|
|
+
|
|
|
# 执行工具
|
|
|
tool_result = await self.tools.execute(
|
|
|
tool_name,
|