Skip to content

03-Agent 与多智能体

本讲为一期第三阶段,聚焦 Agent 工具调用与多智能体协作体系。

核心内容

  • Function Calling 与 Tool Use
  • MCP 协议与工具编排
  • 多智能体协作:AutoGen、CrewAI、LangGraph
  • Agent 记忆与长程规划
python
# Function Calling 示例
tools = [
    {
        "type": "function",
        "function": {
            "name": "query_order",
            "description": "根据订单号查询订单状态",
            "parameters": {
                "type": "object",
                "properties": {
                    "order_id": {"type": "string", "description": "订单编号"}
                },
                "required": ["order_id"]
            }
        }
    }
]
response = client.chat.completions.create(
    model="qwen-max",
    messages=messages,
    tools=tools,
)