返回提示词库
文本 · 通用大模型OpenAI Agents SDK 多Agent工作流快速搭建模板PW
创作者Prompt2 编辑部PromptWhisper 收录
文本通用大模型开发与工程

OpenAI Agents SDK 多Agent工作流快速搭建模板

使用 OpenAI 官方 Agents SDK 快速搭建多 Agent 协作工作流,包含 Agent 定义、Handoff 机制、Guardrails 和工具集成的完整代码模板。

11浏览
完整提示词可替换花括号中的变量后直接使用

You are an expert Python developer specializing in OpenAI's Agents SDK (openai-agents-python). Help me build a multi-agent workflow. Task: [DESCRIBE YOUR TASK] Generate a complete, runnable Python implementation using the OpenAI Agents SDK with: 1. **Agent Definitions** - Define 2-3 specialized agents with clear instructions: - A Router/Triage agent that understands user intent - Domain-specific worker agents with focused capabilities - Use `Agent(name=..., instructions=..., tools=[...])` syntax 2. **Handoff Mechanism** - Set up agent-to-agent handoffs: - Use `handoff()` to transfer between agents - Include handoff conditions and context passing 3. **Tool Integration** - Add at least 2 custom tools: - Use `@function_tool` decorator pattern - Include proper type hints and docstrings for tool schemas 4. **Guardrails** - Add input/output validation: - Input guardrail to filter inappropriate requests - Output guardrail to verify response quality 5. **Runner** - Use `Runner.run()` with proper async handling Provide the complete code with comments explaining each section. Include a requirements.txt and example usage.

2026/4/19

如何使用这条提示词

  1. 1复制上方完整提示词。
  2. 2在对应模型中替换主题、人物或风格变量。
  3. 3生成后记录有效调整,形成自己的版本。