"""Connect4 agent configuration module.This module provides configuration classes for the Connect4 game agent, including: - Base configuration for Connect4 agents - LLM configuration for players and analyzers - Game settings and visualization optionsExample: >>> from haive.games.connect4 import Connect4AgentConfig >>> >>> # Create a config with analysis enabled >>> config = Connect4AgentConfig( ... enable_analysis=True, ... should_visualize_graph=True, ... max_moves=42 # Maximum possible moves in Connect4 ... )"""fromhaive.core.engine.agent.agentimportAgentConfigfromhaive.core.engine.aug_llmimportAugLLMConfigfrompydanticimportBaseModel,Fieldfromhaive.games.connect4.enginesimportaug_llm_configsfromhaive.games.connect4.stateimportConnect4State
[docs]classConnect4AgentConfig(AgentConfig):"""Configuration class for Connect4 game agents. This class defines the configuration parameters for Connect4 agents, including: - Game settings (max moves, analysis options) - LLM configurations for players and analyzers - Visualization settings Attributes: enable_analysis (bool): Whether to enable position analysis. should_visualize_graph (bool): Whether to visualize the game workflow graph. max_moves (int): Maximum number of moves before forcing a draw. aug_llm_configs (Dict[str, AugLLMConfig]): LLM configurations for players and analyzers. Example: >>> config = Connect4AgentConfig( ... enable_analysis=True, ... should_visualize_graph=True, ... max_moves=42, ... aug_llm_configs={ ... "red_player": red_player_config, ... "yellow_player": yellow_player_config, ... "red_analyzer": red_analyzer_config, ... "yellow_analyzer": yellow_analyzer_config, ... } ... ) """state_schema:type[BaseModel]=Field(default=Connect4State)enable_analysis:bool=Field(default=False,description="Whether to enable position analysis during gameplay.",)should_visualize_graph:bool=Field(default=False,description="Whether to visualize the game workflow graph.")max_moves:int=Field(default=42,# 7 columns * 6 rowsdescription="Maximum number of moves before forcing a draw.",)engines:dict[str,AugLLMConfig]=Field(default=aug_llm_configs,description="LLM configurations for players and analyzers.",)
[docs]classConfig:"""Pydantic configuration class. This inner class configures Pydantic behavior for the Connect4AgentConfig. """arbitrary_types_allowed=True