from __future__ import annotations

from typing import Dict, Any

try:
    from autogen import ConversableAgent
except Exception as e:  # pragma: no cover
    raise SystemExit("Autogen not installed. Install with: pip install pyautogen")


def build_orchestrator(llm_config: Dict[str, Any], name: str = "OrchestratorAgent") -> ConversableAgent:
    """Build orchestrator agent without tools.
    
    The orchestrator coordinates other agents but has no tools of its own.
    Since no tools are registered to this agent, it won't attempt tool calls.
    
    IMPORTANT: Do NOT set tool_choice="none" as it causes Gemini to return empty responses.
    """
    return ConversableAgent(
        name=name,
        llm_config=llm_config,
        # Explicitly set max_consecutive_auto_reply to prevent infinite loops
        max_consecutive_auto_reply=10,
    )
