haive.games.checkers.configurable_config¶

Configurable Checkers configuration using the generic player agent system.

This module provides configurable Checkers game configurations that replace hardcoded LLM settings with dynamic, configurable player agents.

Classes¶

ConfigurableCheckersConfig

Configurable Checkers configuration with dynamic LLM selection.

Functions¶

create_budget_checkers_config(**kwargs)

Create a budget-friendly Checkers configuration.

create_checkers_config([red_model, black_model])

Create a configurable Checkers configuration with simple model specifications.

create_checkers_config_from_example(example_name, **kwargs)

Create a configurable Checkers configuration from a predefined example.

create_checkers_config_from_player_configs(...)

Create a configurable Checkers configuration from detailed player configurations.

create_competitive_checkers_config(**kwargs)

Create a competitive Checkers configuration with powerful models.

create_experimental_checkers_config(**kwargs)

Create an experimental Checkers configuration with mixed providers.

get_example_config(name)

Get a predefined example configuration by name.

list_example_configurations()

List all available example configurations.

Module Contents¶

class haive.games.checkers.configurable_config.ConfigurableCheckersConfig¶

Bases: haive.games.checkers.config.CheckersAgentConfig

Configurable Checkers configuration with dynamic LLM selection.

This configuration allows users to specify different LLMs for different roles in the Checkers game, providing flexibility and avoiding hardcoded models.

red_model¶

Model for red player (can be string or LLMConfig)

black_model¶

Model for black player (can be string or LLMConfig)

red_player_name¶

Name for the red player

black_player_name¶

Name for the black player

example_config¶

Optional example configuration name

player_configs¶

Optional detailed player configurations

temperature¶

Temperature for LLM generation

max_moves¶

Maximum number of moves before draw

enable_analysis¶

Whether to enable position analysis

recursion_limit¶

Python recursion limit for game execution

model_post_init(__context)¶

Initialize engines after model creation.

Parameters:

__context (Any)

Return type:

None

haive.games.checkers.configurable_config.create_budget_checkers_config(**kwargs)¶

Create a budget-friendly Checkers configuration.

Return type:

ConfigurableCheckersConfig

haive.games.checkers.configurable_config.create_checkers_config(red_model='gpt-4o', black_model='claude-3-5-sonnet-20240620', **kwargs)¶

Create a configurable Checkers configuration with simple model specifications.

Parameters:
  • red_model (str) – Model for red player and analyzer

  • black_model (str) – Model for black player and analyzer

  • **kwargs – Additional configuration parameters

Returns:

Configured Checkers game

Return type:

ConfigurableCheckersConfig

Examples

>>> config = create_checkers_config("gpt-4o", "claude-3-opus", temperature=0.5)
>>> config = create_checkers_config(
...     "openai:gpt-4o",
...     "anthropic:claude-3-5-sonnet-20240620",
...     max_moves=150
... )
haive.games.checkers.configurable_config.create_checkers_config_from_example(example_name, **kwargs)¶

Create a configurable Checkers configuration from a predefined example.

Parameters:
  • example_name (str) – Name of the example configuration

  • **kwargs – Additional configuration parameters to override

Returns:

Configured Checkers game

Return type:

ConfigurableCheckersConfig

Available examples:
  • “gpt_vs_claude”: GPT-4 vs Claude

  • “gpt_only”: GPT-4 for both players

  • “claude_only”: Claude for both players

  • “budget”: Cost-effective models

  • “mixed”: Different provider per role

  • “checkers_masters”: High-powered models for competitive play

Examples

>>> config = create_checkers_config_from_example("budget", max_moves=80)
>>> config = create_checkers_config_from_example("gpt_vs_claude", enable_analysis=False)
haive.games.checkers.configurable_config.create_checkers_config_from_player_configs(player_configs, **kwargs)¶

Create a configurable Checkers configuration from detailed player configurations.

Parameters:
Returns:

Configured Checkers game

Return type:

ConfigurableCheckersConfig

Expected roles:
  • “red_player”: Red player configuration

  • “black_player”: Black player configuration

  • “red_analyzer”: Red analyzer configuration

  • “black_analyzer”: Black analyzer configuration

Examples

>>> player_configs = {
...     "red_player": PlayerAgentConfig(
...         llm_config="gpt-4o",
...         temperature=0.7,
...         player_name="Aggressive Red"
...     ),
...     "black_player": PlayerAgentConfig(
...         llm_config="claude-3-opus",
...         temperature=0.3,
...         player_name="Strategic Black"
...     ),
...     "red_analyzer": PlayerAgentConfig(
...         llm_config="gpt-4o",
...         temperature=0.2,
...         player_name="Red Analyst"
...     ),
...     "black_analyzer": PlayerAgentConfig(
...         llm_config="claude-3-opus",
...         temperature=0.2,
...         player_name="Black Analyst"
...     ),
... }
>>> config = create_checkers_config_from_player_configs(player_configs)
haive.games.checkers.configurable_config.create_competitive_checkers_config(**kwargs)¶

Create a competitive Checkers configuration with powerful models.

Return type:

ConfigurableCheckersConfig

haive.games.checkers.configurable_config.create_experimental_checkers_config(**kwargs)¶

Create an experimental Checkers configuration with mixed providers.

Return type:

ConfigurableCheckersConfig

haive.games.checkers.configurable_config.get_example_config(name)¶

Get a predefined example configuration by name.

Parameters:

name (str) – Name of the example configuration

Returns:

The example configuration

Return type:

ConfigurableCheckersConfig

Raises:

ValueError – If the example name is not found

haive.games.checkers.configurable_config.list_example_configurations()¶

List all available example configurations.

Returns:

Mapping of configuration names to descriptions

Return type:

Dict[str, str]