0

Agents as Tools

awesome-llm-apps3_3_agents_as_tools

Demonstrates advanced orchestration patterns where agents are used as tools by other agents.

Sign in to save downloads to your library and vote.

Preview

Agents as Tools

Demonstrates advanced orchestration patterns where agents are used as tools by other agents.

๐ŸŽฏ What This Demonstrates

  • Agent.as_tool(): Converting agents to tools for orchestration
  • Custom Agent Tools: Using @function_tool with Runner.run()
  • Multi-Agent Workflows: Coordinating multiple specialized agents
  • Custom Configuration: Per-agent settings like max_turns and run_config

๐Ÿš€ Quick Start

  1. Install OpenAI Agents SDK:

    pip install openai-agents
    
  2. Set up environment:

    cp ../env.example .env
    # Edit .env and add your OpenAI API key
    
  3. Run basic orchestration:

    from agents import Runner
    from agent import root_agent
    
    result = Runner.run_sync(root_agent, "Say 'Hello, how are you?' in Spanish.")
    print(result.final_output)
    
  4. Try advanced orchestration:

    from advanced_agent import advanced_orchestrator
    
    result = Runner.run_sync(advanced_orchestrator, "Research the benefits of AI in healthcare.")
    print(result.final_output)
    

๐Ÿ’ก Key Concepts

Basic Agent Tools (agent.py)

  • Agent.as_tool(): Simple agent-to-tool conversion
  • Translation Orchestration: Multiple language agents coordinated
  • Tool Naming: Custom tool names and descriptions

Advanced Agent Tools (advanced_agent.py)

  • @function_tool with Runner.run(): Custom agent tool implementations
  • Custom Configuration: Per-run settings (max_turns, temperature)
  • Research-Writing Pipeline: Complex multi-stage workflows

๐Ÿงช Available Patterns

Basic Orchestration

  • Spanish translation agent
  • French translation agent
  • Orchestrator coordinates language tasks

Advanced Orchestration

  • Research agent for information gathering
  • Writing agent for content creation
  • Custom tool functions with Runner configuration

๐Ÿ”— Next Steps

Ingestion metadata

Source catalog
awesome-llm-apps
Repository
Shubhamsaboo/awesome-llm-apps ยท main
File path
ai_agent_framework_crash_course/openai_sdk_crash_course/3_tool_using_agent/3_3_agents_as_tools/README.md
Last refreshed
7/23/2026, 8:42:18 PM (6h ago)
Refresh schedule
Daily ยท 03:00 UTC
Dedupe status
Unique ยท deduped by (source, url)