跳到主要内容Skip to main content

工具调用Tool Calling / Function Calling

Tool Calling / Function Calling

  • 智能体Agents
  • 第三站 · 用深Station 3 · Going Deeper
解决什么问题What problem it solves

模型自己决定「我要查一下数据库」,然后真的去调那个程序。Let the model actually do things — search, run code, edit files — rather than only describe them.

这是什么What it is

模型输出一个结构化的调用意图,由你的程序执行后把结果喂回去。

模型本身不执行任何东西,它只是输出「要调哪个函数、传什么参数」。

A mechanism where the model emits a structured request for a function, the system runs it, and the result goes back into the conversation.

为什么需要知道Why it matters

这是 Agent 能「真的做事」而不是「只是说要做」的分界线。没有它,模型只能空谈。It is what turns a language model into a usable assistant. It also introduces real risk: the model can act wrongly, not just speak wrongly.

出处Sources
  • OpenAI 函数调用指南OpenAI Function Calling Guide ↗
  • Anthropic 工具调用文档Anthropic Tool Use with Claude ↗