games.chess.configurable_engines¶
Configurable chess engines using the new player agent system.
This module provides chess engine configurations that use configurable player agents instead of hardcoded LLM configurations, making it easy to switch LLMs for different players.
Functions¶
|
Create chess engines with Anthropic vs OpenAI models. |
|
Create a chess analysis prompt for the specified color. |
|
Create a chess move prompt for the specified color. |
|
Create chess engines from configurable player agents. |
|
Create chess engines with different providers for each role. |
|
Create chess engines using the same model for all roles. |
Get role definitions for chess players and analyzers. |
|
|
Get example engine configuration by name. |
Module Contents¶
- games.chess.configurable_engines.create_anthropic_vs_openai_engines(white_model='claude-3-5-sonnet-20240620', black_model='gpt-4o', temperature=0.7)¶
Create chess engines with Anthropic vs OpenAI models.
- Parameters:
- Returns:
Dictionary of engines
- Return type:
Dict[str, AugLLMConfig]
- games.chess.configurable_engines.create_chess_analysis_prompt(color)¶
Create a chess analysis prompt for the specified color.
- Parameters:
color (str) – Player color (“white” or “black”)
- Returns:
Prompt template for position analysis
- Return type:
ChatPromptTemplate
- games.chess.configurable_engines.create_chess_move_prompt(color)¶
Create a chess move prompt for the specified color.
- Parameters:
color (str) – Player color (“white” or “black”)
- Returns:
Prompt template for move generation
- Return type:
ChatPromptTemplate
- games.chess.configurable_engines.create_configurable_chess_engines(player_configs)¶
Create chess 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 = { ... "white_player": PlayerAgentConfig(llm_config="gpt-4"), ... "black_player": PlayerAgentConfig(llm_config="claude-3-opus"), ... "white_analyzer": PlayerAgentConfig(llm_config="gpt-4"), ... "black_analyzer": PlayerAgentConfig(llm_config="claude-3-opus"), ... } >>> engines = create_configurable_chess_engines(configs)
- games.chess.configurable_engines.create_mixed_provider_engines(providers=None, temperature=0.7)¶
Create chess engines with different providers for each role.
- games.chess.configurable_engines.create_same_model_engines(model='gpt-4o', temperature=0.7)¶
Create chess engines using the same model for all roles.
- Parameters:
- Returns:
Dictionary of engines
- Return type:
Dict[str, AugLLMConfig]
- games.chess.configurable_engines.get_chess_role_definitions()¶
Get role definitions for chess players and analyzers.
- Returns:
Dictionary of role definitions
- Return type:
Dict[str, GamePlayerRole]
- games.chess.configurable_engines.get_example_engines(config_name)¶
Get example engine configuration by name.
- Parameters:
config_name (str) – Name of the configuration from EXAMPLE_CONFIGS
- Returns:
Dictionary of engines
- Return type:
Dict[str, AugLLMConfig]
- Available configs: anthropic_vs_openai, gpt4_only, claude_only,
mixed_providers, budget_friendly