Spaces:
Configuration error
Configuration error
| """ | |
| AI Agent Infrastructure for PyCatan | |
| This package contains the infrastructure for building LLM-based AI agents | |
| that can play Settlers of Catan autonomously. | |
| Main Components: | |
| - AIManager: Central coordinator for all AI agents | |
| - AIUser: User interface wrapper for AI agents | |
| - AILogger: Logging and session management | |
| - AgentState: Per-agent state tracking | |
| Supporting Components: | |
| - config: Configuration management for AI agents | |
| - prompt_manager: Prompt construction and game state filtering | |
| - state_filter: Game state filtering and perspective transformation | |
| - prompt_templates: Prompt structure and action templates | |
| - response_parser: LLM response parsing and validation | |
| - llm_client: LLM API abstraction and client | |
| - schemas: JSON schemas for LLM responses | |
| - agent_tools: Helper tools for LLM decision-making (NEW!) | |
| Architecture Overview: | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β AI System Architecture β | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ | |
| β β | |
| β GameManager AIManager β | |
| β β β β | |
| β β get_input() β Creates prompts β | |
| β βΌ β Sends to LLM β | |
| β βββββββββββ β Parses responses β | |
| β β AIUser ββββββββββ delegates to βββββββΊβ β | |
| β β(Wrapper)β β β | |
| β βββββββββββ βΌ β | |
| β βββββββββββββββ β | |
| β β AILogger β β | |
| β β (Logging) β β | |
| β βββββββββββββββ β | |
| β β | |
| β Components: β | |
| β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β | |
| β β Config β β Prompt β β Response β β | |
| β β Management β β Manager β β Parser β β | |
| β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β | |
| β β β β β | |
| β β | |
| β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β | |
| β β Agent State β β LLM Client β β Schemas β β | |
| β β Tracking β β (Gemini) β β (JSON) β β | |
| β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β | |
| β β β β β | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| Status: β Complete | π§ In Development | β Not Started | |
| """ | |
| __version__ = "2.0.0" | |
| # Main classes | |
| from pycatan.ai.ai_manager import AIManager | |
| from pycatan.ai.ai_user import AIUser | |
| from pycatan.ai.ai_logger import AILogger | |
| from pycatan.ai.agent_state import AgentState, compute_state_hash | |
| # Supporting classes | |
| from pycatan.ai.config import AIConfig | |
| from pycatan.ai.prompt_manager import PromptManager | |
| from pycatan.ai.response_parser import ResponseParser | |
| from pycatan.ai.llm_client import LLMResponse, LLMClient, GeminiClient, OpenRouterClient, create_llm_client | |
| from pycatan.ai.schemas import ResponseType, ACTIVE_TURN_RESPONSE_SCHEMA, OBSERVING_RESPONSE_SCHEMA | |
| from pycatan.ai.state_optimizer import optimize_state_for_ai, format_with_legend, game_state_to_dict | |
| # Agent tools | |
| from pycatan.ai.agent_tools import AgentTools | |
| __all__ = [ | |
| # Main classes | |
| "AIManager", | |
| "AIUser", | |
| "AILogger", | |
| "AgentState", | |
| "compute_state_hash", | |
| # Configuration | |
| "AIConfig", | |
| # Prompt handling | |
| "PromptManager", | |
| "ResponseParser", | |
| # LLM | |
| "LLMResponse", | |
| "LLMClient", | |
| "GeminiClient", | |
| "OpenRouterClient", | |
| "create_llm_client", | |
| # Schemas | |
| "ResponseType", | |
| "ACTIVE_TURN_RESPONSE_SCHEMA", | |
| "OBSERVING_RESPONSE_SCHEMA", | |
| # State optimization | |
| "optimize_state_for_ai", | |
| "format_with_legend", | |
| "game_state_to_dict", | |
| # Agent tools | |
| "AgentTools", | |
| ] | |