Day 5 — Tool Use 上线,Agent 有了"手"
2026-02-19 · M5.1
Agent 能自己做决策了,但还缺少执行能力。今天上线 Tool Use 框架 — 让 LLM 可以调用工具。
Tool Use 框架
核心流程:
LLM 思考 → 决定调用某个工具
→ 后端执行工具逻辑
→ 返回结果给 LLM
→ LLM 生成自然语言回复资源转赠
Tool Use 的第一个应用场景:Agent 之间互送资源。
transfer_resource工具 — 指定接收者、资源类型、数量- 前端 TradePage 交易面板
- React Router 引入(页面开始多了,需要路由)
测试验证
ST 8/8 全绿:
- ST-1~4:转赠成功 / 资源不足 / WS 广播 / 数量校验
- ST-5:Tool Use 端到端 — 真实 LLM 调用工具,Agent 回复确认
踩坑:e2e 脚本里 Agent 模型配的是 gpt-4o-mini,但 MODEL_REGISTRY 里没注册,换成 stepfun/step-3.5-flash 解决。
小结
有了 Tool Use,Agent 从"只会说话"变成了"能动手做事"。这是后续所有复杂功能(交易、建造、上网)的基础。