haive.games.chess.configurable_config ===================================== .. py:module:: haive.games.chess.configurable_config .. autoapi-nested-parse:: Configurable chess agent configuration using player agents. This module provides a chess configuration that supports configurable player agents instead of hardcoded engine configurations. Classes ------- .. autoapisummary:: haive.games.chess.configurable_config.ConfigurableChessConfig Functions --------- .. autoapisummary:: haive.games.chess.configurable_config.create_chess_config haive.games.chess.configurable_config.create_chess_config_from_example haive.games.chess.configurable_config.create_chess_config_from_player_configs Module Contents --------------- .. py:class:: ConfigurableChessConfig Bases: :py:obj:`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. .. rubric:: 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" ... ) .. py:class:: Config Pydantic configuration. .. py:method:: configure_engines_and_names() Configure engines from the provided player configurations. .. py:function:: 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. :param white_model: Model for white player :param black_model: Model for black player :param temperature: Temperature for all engines :param enable_analysis: Whether to enable position analysis :param \*\*kwargs: Additional configuration parameters :returns: Configured chess agent :rtype: ConfigurableChessConfig .. rubric:: Example >>> config = create_chess_config("gpt-4", "claude-3-opus", temperature=0.8) .. py:function:: create_chess_config_from_example(example_name, enable_analysis = True, **kwargs) Create a chess configuration from an example. :param example_name: Name of the example configuration :param enable_analysis: Whether to enable position analysis :param \*\*kwargs: Additional configuration parameters :returns: Configured chess agent :rtype: ConfigurableChessConfig Available examples: anthropic_vs_openai, gpt4_only, claude_only, mixed_providers, budget_friendly .. rubric:: Example >>> config = create_chess_config_from_example("budget_friendly") .. py:function:: create_chess_config_from_player_configs(player_configs, enable_analysis = True, **kwargs) Create a chess configuration from player agent configurations. :param player_configs: Dictionary of role to player configuration :param enable_analysis: Whether to enable position analysis :param \*\*kwargs: Additional configuration parameters :returns: Configured chess agent :rtype: ConfigurableChessConfig .. rubric:: 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)