haive.games.connect4.configurable_config¶
Configurable Connect4 agent configuration using player agents.
from typing import Any This module provides a Connect4 configuration that supports configurable player agents instead of hardcoded engine configurations.
Classes¶
Configurable Connect4 agent configuration. |
Functions¶
|
Create a Connect4 configuration with simple model strings. |
|
Create a Connect4 configuration from an example. |
|
Create a Connect4 configuration from player agent configurations. |
Module Contents¶
- class haive.games.connect4.configurable_config.ConfigurableConnect4Config¶
Bases:
haive.core.engine.agent.agent.AgentConfig
Configurable Connect4 agent configuration.
This configuration supports using different LLM configurations for different players without hardcoding them in engines.
Examples
>>> # Simple string-based configuration >>> config = ConfigurableConnect4Config( ... red_model="gpt-4", ... yellow_model="claude-3-opus" ... )
>>> # Using player agent configs >>> config = ConfigurableConnect4Config( ... player_configs={ ... "red_player": PlayerAgentConfig(llm_config="gpt-4"), ... "yellow_player": PlayerAgentConfig(llm_config="claude-3-opus"), ... } ... )
>>> # Using example configuration >>> config = ConfigurableConnect4Config( ... example_config="gpt_vs_claude" ... )
- class Config¶
Pydantic configuration.
- configure_engines_and_names()¶
Configure engines from the provided player configurations.
- Return type:
Any
- haive.games.connect4.configurable_config.create_connect4_config(red_model='gpt-4o', yellow_model='claude-3-5-sonnet-20240620', temperature=0.7, enable_analysis=False, **kwargs)¶
Create a Connect4 configuration with simple model strings.
- Parameters:
- Returns:
Configured Connect4 agent
- Return type:
Example
>>> config = create_connect4_config("gpt-4", "claude-3-opus", temperature=0.8)
- haive.games.connect4.configurable_config.create_connect4_config_from_example(example_name, enable_analysis=False, **kwargs)¶
Create a Connect4 configuration from an example.
- Parameters:
- Returns:
Configured Connect4 agent
- Return type:
Available examples: gpt_vs_claude, gpt_only, claude_only, budget, mixed
Example
>>> config = create_connect4_config_from_example("budget")
- haive.games.connect4.configurable_config.create_connect4_config_from_player_configs(player_configs, enable_analysis=False, **kwargs)¶
Create a Connect4 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 Connect4 agent
- Return type:
Example
>>> configs = { ... "red_player": create_player_config("gpt-4", player_name="Red Master"), ... "yellow_player": create_player_config("claude-3-opus", player_name="Yellow Pro"), ... } >>> config = create_connect4_config_from_player_configs(configs)