games.chess.configurable_config¶
Configurable chess agent configuration using player agents.
This module provides a chess configuration that supports configurable player agents instead of hardcoded engine configurations.
Classes¶
Configurable chess agent configuration. |
Functions¶
|
Create a chess configuration with simple model strings. |
|
Create a chess configuration from an example. |
|
Create a chess configuration from player agent configurations. |
Module Contents¶
- class games.chess.configurable_config.ConfigurableChessConfig¶
Bases:
haive.core.engine.agent.agent.AgentConfig
Configurable chess agent configuration.
This configuration supports using different LLM configurations for different players without hardcoding them in engines.
Examples
>>> # Simple string-based configuration >>> config = ConfigurableChessConfig( ... white_model="gpt-4", ... black_model="claude-3-opus" ... )
>>> # Using player agent configs >>> config = ConfigurableChessConfig( ... player_configs={ ... "white_player": PlayerAgentConfig(llm_config="gpt-4"), ... "black_player": PlayerAgentConfig(llm_config="claude-3-opus"), ... } ... )
>>> # Using example configuration >>> config = ConfigurableChessConfig( ... example_config="anthropic_vs_openai" ... )
- class Config¶
Pydantic configuration.
- configure_engines_and_names()¶
Configure engines from the provided player configurations.
- Return type:
Any
- games.chess.configurable_config.create_chess_config(white_model='gpt-4o', black_model='claude-3-5-sonnet-20240620', temperature=0.7, enable_analysis=True, **kwargs)¶
Create a chess configuration with simple model strings.
- Parameters:
- Returns:
Configured chess agent
- Return type:
Example
>>> config = create_chess_config("gpt-4", "claude-3-opus", temperature=0.8)
- games.chess.configurable_config.create_chess_config_from_example(example_name, enable_analysis=True, **kwargs)¶
Create a chess configuration from an example.
- Parameters:
- Returns:
Configured chess agent
- Return type:
- Available examples: anthropic_vs_openai, gpt4_only, claude_only,
mixed_providers, budget_friendly
Example
>>> config = create_chess_config_from_example("budget_friendly")
- games.chess.configurable_config.create_chess_config_from_player_configs(player_configs, enable_analysis=True, **kwargs)¶
Create a chess configuration from player agent configurations.
- Parameters:
player_configs (dict[str, haive.games.core.agent.player_agent.PlayerAgentConfig]) – Dictionary of role to player configuration
enable_analysis (bool) – Whether to enable position analysis
**kwargs – Additional configuration parameters
- Returns:
Configured chess agent
- Return type:
Example
>>> configs = { ... "white_player": create_player_config("gpt-4", player_name="Deep Blue"), ... "black_player": create_player_config("claude-3-opus", player_name="AlphaZero"), ... } >>> config = create_chess_config_from_player_configs(configs)