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¶

ConfigurableChessConfig

Configurable chess agent configuration.

Functions¶

create_chess_config([white_model, black_model, ...])

Create a chess configuration with simple model strings.

create_chess_config_from_example(example_name[, ...])

Create a chess configuration from an example.

create_chess_config_from_player_configs(player_configs)

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:
  • white_model (str) – Model for white player

  • black_model (str) – Model for black player

  • temperature (float) – Temperature for all engines

  • enable_analysis (bool) – Whether to enable position analysis

  • **kwargs – Additional configuration parameters

Returns:

Configured chess agent

Return type:

ConfigurableChessConfig

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:
  • example_name (str) – Name of the example configuration

  • enable_analysis (bool) – Whether to enable position analysis

  • **kwargs – Additional configuration parameters

Returns:

Configured chess agent

Return type:

ConfigurableChessConfig

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:
Returns:

Configured chess agent

Return type:

ConfigurableChessConfig

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)