跳到主要内容Skip to main content

工具调用Tool Calling / Function Calling

Tool Calling / Function Calling

  • 智能体Agents
  • 第三段 · 用深Stage 3 · Going Deeper
  • 引用核验 2026-11-09refs checked 2026-11-09
解决什么问题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.

The model emits a structured call, the runtime executes the tool and writes the result back; the model never touches the database or browser itself.
模型输出一个结构化调用请求,运行时执行工具并把结果写回上下文;模型自己不碰数据库或浏览器。The model emits a structured call, the runtime executes the tool and writes the result back; the model never touches the database or browser itself.
为什么需要知道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 ↗
用这个术语做任务Use this term in a task

别停在定义:去任务手册看按什么顺序做、验收什么;或者按你手头的任务,筛 3 个工具候选。Don’t stop at the definition: use the task handbook for the order and checks, or filter three tool candidates for the job at hand.

任务手册 →Task handbooks → · 按任务筛 3 个候选 →Filter three candidates →