Files

43 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
id: ai.function-calling.index
title: Function Calling 工具调用
type: index
domain: ai
stack: [function-calling]
tags: [Function Calling, Tool Calling, Agent]
week: [10]
---
# Function Calling 工具调用
所有 Agent 的基础:模型决定调用什么,代码负责校验、权限和执行。先手写一遍调用循环,再学 MCP、LangChain、LangGraph 就很容易理解。
## 学习路线
| 顺序 | 课程 | 级别 | 预计 |
| --- | --- | --- | --- |
| 1 | [工具调用原理:工具定义、调用循环、参数校验、并行调用和错误回传](01-tool-loop.md) | 进阶 | 3 小时 |
## 企业场景
- [让 Agent 安全地调用内部业务接口:权限、确认、幂等和审计](scenarios/safe-business-tools.md)
## 面试题
- [Function Calling 面试题](interview.md)
## 示例代码
- [examples/tool-loop](examples/tool-loop/):手写工具调用循环(OpenAI 消息格式、pydantic 参数校验、错误回传自我修正、写操作确认、幂等、最大步数),用脚本模型离线运行,带 pytest 测试
## 在 16 周计划中
- [第 10 周:工具调用循环和 MCP](../../../plan/week10-agent-m1-tools-mcp.md)
## 官方资料
以各家官方文档为准:
- OpenAI:https://platform.openai.com/docs/guides/function-calling
- Anthropic:https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview