"""Configuration for the Mastermind game agent.This module defines the configuration for the Mastermind game agent, including gamestate schema, engines, analysis settings, visualization, and game parameters."""fromhaive.core.engine.aug_llmimportAugLLMConfigfrompydanticimportFieldfromhaive.games.framework.base.configimportGameConfigfromhaive.games.mastermind.enginesimportmastermind_enginesfromhaive.games.mastermind.stateimportMastermindState# Version information for tracking changesVERSION="1.1.0"
[docs]classMastermindConfig(GameConfig):"""Configuration for the Mastermind game agent. This class defines the configuration for the Mastermind game agent, including game state schema, engines, analysis settings, visualization, and game parameters. """name:str=Field(default="mastermind",description="Name of the game")version:str=Field(default=VERSION,description="Version of the game implementation")state_schema:type[MastermindState]=Field(default=MastermindState)engines:dict[str,AugLLMConfig]=Field(default=mastermind_engines,description="Configs for the Mastermind engines")enable_analysis:bool=Field(default=True,description="Whether to enable position analysis")visualize:bool=Field(default=True,description="Whether to visualize the game")max_turns:int=Field(default=10,description="Maximum number of turns")codemaker:str=Field(default="player1",description="Player who creates the code (player1 or player2)",)colors:list[str]=Field(default=["red","blue","green","yellow","purple","orange"],description="List of available colors",)code_length:int=Field(default=4,description="Length of the secret code")secret_code:list[str]|None=Field(default=None,description="Predetermined secret code (if None, will be generated)",)
[docs]@classmethoddefdefault_config(cls)->"MastermindConfig":"""Create a default configuration. Returns: MastermindConfig: Default configuration for Mastermind game. """returncls(name="mastermind",state_schema=MastermindState,engines=mastermind_engines,enable_analysis=True,visualize=True,max_turns=10,codemaker="player1",colors=["red","blue","green","yellow","purple","orange"],code_length=4,secret_code=None,)