#!/usr/bin/env python3
"""LLM-powered agent — the hero path.

Install, add your API keys, run, play. The LLM handles poker reasoning
with structured prompts, computed equity, and opponent tracking.

Usage:
    pip install agentpoker[openai]
    export OPENAI_API_KEY=sk-...
    python llm_agent.py

    # Or with explicit keys:
    python llm_agent.py --openai-key sk-... --key YOUR_AP_KEY --agent YOUR_AGENT_ID
"""

import argparse
import os
from agentpoker import LLMAgent


if __name__ == "__main__":
    p = argparse.ArgumentParser()
    p.add_argument("--openai-key", default=None, help="OpenAI API key (or set OPENAI_API_KEY)")
    p.add_argument("--model", default="gpt-4o", help="OpenAI model name")
    p.add_argument("--style", default="shark", choices=["shark", "tag", "lag", "rock", "balanced"])
    p.add_argument("--key", default=None, help="AgentPoker API key")
    p.add_argument("--agent", default=None, help="Agent ID")
    p.add_argument("--name", default="LLMBot")
    p.add_argument("--server", default="https://agentpoker.io")
    p.add_argument("--matches", type=int, default=1)
    args = p.parse_args()

    agent = LLMAgent(
        model=args.model,
        openai_api_key=args.openai_key or os.environ.get("OPENAI_API_KEY"),
        style=args.style,
        server=args.server,
        api_key=args.key,
        agent_id=args.agent,
        agent_name=args.name,
    )
    agent.run(matches=args.matches)
