Demonstrates advanced orchestration patterns where specialized agents are used as function tools by orchestrator agents.
Sign in to save downloads to your library and vote.
Preview
Agents as Tools
Demonstrates advanced orchestration patterns where specialized agents are used as function tools by orchestrator agents.
๐ฏ What This Demonstrates
- @function_tool with Agents: Converting agents to reusable tools
- Content Creation Pipeline: Research โ Writing โ Editing workflow
- Custom Configuration: Per-agent settings and parameters
- Intelligent Orchestration: LLM-driven workflow coordination
๐ Quick Start
-
Install OpenAI Agents SDK:
pip install openai-agents -
Set up environment:
cp ../env.example .env # Edit .env and add your OpenAI API key -
Run the agent:
import asyncio from agent import main # Test agent orchestration patterns asyncio.run(main())
๐ก Key Concepts
- Agent Tool Creation: Using
@function_toolwithRunner.run() - Workflow Orchestration: Coordinating multiple specialized agents
- Custom Configuration: Per-tool settings (max_turns, temperature)
- Intelligent Coordination: LLM decides when and how to use tools
๐งช Available Tools
Research Tool
@function_tool
async def research_tool(topic: str) -> str:
result = await Runner.run(
research_agent,
input=f"Research this topic thoroughly: {topic}",
max_turns=3
)
return str(result.final_output)
Writing Tool
@function_tool
async def writing_tool(content: str, style: str = "professional") -> str:
prompt = f"Write engaging {style} content based on this research: {content}"
result = await Runner.run(writing_agent, input=prompt, max_turns=2)
return str(result.final_output)
Editing Tool
@function_tool
async def editing_tool(content: str) -> str:
result = await Runner.run(
editing_agent,
input=f"Edit and improve this content: {content}"
)
return str(result.final_output)
๐ป Orchestration Patterns
Basic Content Workflow
- Research: Gather comprehensive information
- Write: Create well-structured content
- Edit: Polish and improve final output
Advanced Orchestration
- Conditional Logic: Adapt workflow based on requirements
- Style Selection: Choose appropriate writing approach
- Quality Control: Multi-stage review and improvement
Manual vs Automatic Comparison
- Direct Agent Calls: Manual orchestration
- Tool-Based: Automatic LLM coordination
- Performance: Compare execution patterns
๐ Next Steps
- Parallel Execution - Concurrent agent patterns
- Tutorial 10: Tracing & Observability - Monitoring workflows
Ingestion metadata
- Source catalog
- awesome-llm-apps
- Repository
- Shubhamsaboo/awesome-llm-apps ยท main
- File path
- ai_agent_framework_crash_course/openai_sdk_crash_course/9_multi_agent_orchestration/9_2_agents_as_tools/README.md
- Last refreshed
- 7/23/2026, 10:39:09 PM (4h ago)
- Refresh schedule
- Daily ยท 03:00 UTC
- Dedupe status
- Unique ยท deduped by (source, url)