javascript
Agent 工具调用模拟器
实现一个简单的 Agent 工具调用模拟。定义一个 callTool(toolName, args) 函数,根据工具名调用对应函数并返回结果。支持的工具:weather(返回天气)、calculate(数学计算)、search(返回搜索结果)。
Loading...
输出
点击「运行代码」或「运行测试」查看输出
实现一个简单的 Agent 工具调用模拟。定义一个 callTool(toolName, args) 函数,根据工具名调用对应函数并返回结果。支持的工具:weather(返回天气)、calculate(数学计算)、search(返回搜索结果)。
点击「运行代码」或「运行测试」查看输出