跳转到主要内容
不同的模型擅长不同的任务。GPT 在推理和工具使用方面表现出色,Claude 更擅长撰写优质文本。还有专门用于代码、数学和特定领域工作的模型。交接机制让智能体可以将子任务路由到合适的模型上。 如果你已经构建了一个模型上下文协议 (MCP) + 工具的工作流,交接可以让你在大部分时间使用一个快速的“协调器”模型,只在需要时才路由到更强的模型。
import asyncio
from dedalus_labs import AsyncDedalus, DedalusRunner
from dotenv import load_dotenv

load_dotenv()

async def main():
    client = AsyncDedalus()
    runner = DedalusRunner(client)

    result = await runner.run(
        input=(
            "Find me the nearest basketball games in January in San Francisco, then write a concise plan for attending."
        ),
        model=["openai/gpt-5.2", "anthropic/claude-opus-4-5"],
        mcp_servers=["windsor/ticketmaster-mcp"],  # 通过 Ticketmaster 发现活动
    )

    print(result.final_output)

if __name__ == "__main__":
    asyncio.run(main())

何时使用交接(Handoffs)

当任务可以被清晰划分为多个阶段且每个阶段需要不同能力时,交接会特别有效:
  • 调研 → 写作:GPT 负责收集信息,Claude 撰写最终内容
  • 分析 → 编码:推理模型规划方案,代码模型负责实现
  • 分诊 → 专家:通用模型将请求路由到特定领域模型
对于可以由单个模型完成的简单任务,只用一个模型就够了。

模型优势

模型选择的大致指南:
任务推荐模型
工具调用、推理openai/gpt-5.2, xai/grok-4-1-fast-reasoning
写作与创意工作anthropic/claude-opus-4-5
代码生成anthropic/claude-opus-4-5, openai/gpt-5-codex
快速且低成本的响应gpt-5-mini

后续步骤

  • 添加多模态支持Images & Vision — 将图像生成/视觉能力加入你的工作流
  • 查看工作流Use Cases — 多能力组合模式
以编程方式将这些文档连接 到 Claude、VSCode 等工具,通过模型上下文协议(MCP)获取实时解答。