haive.games.tic_tac_toe.configurable_engines¶
Configurable Tic Tac Toe engines using the new player agent system.
This module provides Tic Tac Toe engine configurations that use configurable player agents instead of hardcoded LLM configurations.
Functions¶
|
Create Tic Tac Toe engines from configurable player agents. |
|
Create simple player configurations for Tic Tac Toe. |
|
Create a Tic Tac Toe analysis prompt for the specified player. |
|
Create Tic Tac Toe engines using simple model strings. |
|
Create a Tic Tac Toe move prompt for the specified player. |
|
Get example Tic Tac Toe engine configuration by name. |
Get role definitions for Tic Tac Toe players and analyzers. |
Module Contents¶
- haive.games.tic_tac_toe.configurable_engines.create_configurable_tic_tac_toe_engines(player_configs)[source]¶
Create Tic Tac Toe engines from configurable player agents.
- Parameters:
player_configs (dict[str, haive.games.core.agent.player_agent.PlayerAgentConfig]) – Dictionary of role name to player configuration
- Returns:
Dictionary of configured engines
- Return type:
Dict[str, AugLLMConfig]
Example
>>> configs = { ... "X_player": PlayerAgentConfig(llm_config="gpt-4"), ... "O_player": PlayerAgentConfig(llm_config="claude-3-opus"), ... "X_analyzer": PlayerAgentConfig(llm_config="gpt-4"), ... "O_analyzer": PlayerAgentConfig(llm_config="claude-3-opus"), ... } >>> engines = create_configurable_tic_tac_toe_engines(configs)
- haive.games.tic_tac_toe.configurable_engines.create_simple_tic_tac_toe_player_configs(x_model='gpt-4o', o_model='claude-3-5-sonnet-20240620', temperature=0.3)[source]¶
Create simple player configurations for Tic Tac Toe.
- Parameters:
- Returns:
Player configurations
- Return type:
Dict[str, PlayerAgentConfig]
- haive.games.tic_tac_toe.configurable_engines.create_tic_tac_toe_analysis_prompt(player_symbol)[source]¶
Create a Tic Tac Toe analysis prompt for the specified player.
- Parameters:
player_symbol (str) – Player symbol (“X” or “O”)
- Returns:
Prompt template for position analysis
- Return type:
ChatPromptTemplate
- haive.games.tic_tac_toe.configurable_engines.create_tic_tac_toe_engines_from_models(x_model='gpt-4o', o_model='claude-3-5-sonnet-20240620', temperature=0.3)[source]¶
Create Tic Tac Toe engines using simple model strings.
- Parameters:
- Returns:
Dictionary of engines
- Return type:
Dict[str, AugLLMConfig]
- haive.games.tic_tac_toe.configurable_engines.create_tic_tac_toe_move_prompt(player_symbol)[source]¶
Create a Tic Tac Toe move prompt for the specified player.
- Parameters:
player_symbol (str) – Player symbol (“X” or “O”)
- Returns:
Prompt template for move generation
- Return type:
ChatPromptTemplate
- haive.games.tic_tac_toe.configurable_engines.get_example_tic_tac_toe_engines(config_name)[source]¶
Get example Tic Tac Toe engine configuration by name.
- Parameters:
config_name (str) – Name of the configuration from EXAMPLE_TTT_CONFIGS
- Returns:
Dictionary of engines
- Return type:
Dict[str, AugLLMConfig]
Available configs: gpt_vs_claude, gpt_only, claude_only, budget, mixed
- haive.games.tic_tac_toe.configurable_engines.get_tic_tac_toe_role_definitions()[source]¶
Get role definitions for Tic Tac Toe players and analyzers.
- Returns:
Dictionary of role definitions
- Return type:
Dict[str, GamePlayerRole]