from __future__ import annotations

from typing import Dict, Any

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


def build_user_proxy(name: str = "UserProxyAgent") -> UserProxyAgent:
    return UserProxyAgent(
        name=name,
        human_input_mode="NEVER",
        code_execution_config=False,
        max_consecutive_auto_reply=None,  # Allow unlimited auto-replies (no human input ever)
        is_termination_msg=lambda x: False,  # Never terminate from user proxy
    )
