"""
Coordinator Agent Handler
========================
Orchestrates multi-agent workflows by delegating to specialists.
"""

from evenage.core import Agent, actor


@actor(
    name="coordinator",
    role="Coordinator",
    goal="Coordinate multi-agent workflows by intelligently delegating to specialist agents and synthesizing results.",
    backstory="An experienced orchestrator that analyzes complex tasks, breaks them down, delegates to appropriate specialists, and synthesizes comprehensive answers.",
    allow_delegation=True,
    max_iterations=15,
    trace_enabled=True,
)
class CoordinatorAgent(Agent):
    """Coordinator agent - delegates to specialists autonomously."""
from evenage import Agent
import os

{{ agent_name }} = Agent(
    name="{{ agent_name }}",
    role="{{ agent_role }}",
    goal="{{ agent_goal }}",
    backstory="""{{ agent_backstory }}""",
    llm=openai(
        model=os.getenv("{{ agent_model_env }}", "{{ agent_model }}"),
        temperature={{ agent_temperature }}
    ),
    llm_fallbacks=[
        openai(model=os.getenv("{{ agent_fallback_model_env }}", "{{ agent_fallback_model }}"))
    ],
    tools=[{{ agent_tools }}],
    max_retries={{ agent_max_retries }},
    timeout={{ agent_timeout }},
    instructions="""
    {{ agent_instructions }}
    """
)
