haive.games.hold_em.configurable_config ======================================= .. py:module:: haive.games.hold_em.configurable_config .. autoapi-nested-parse:: Configurable Hold'em configuration using the generic player agent system. This module provides configurable Texas Hold'em game configurations that replace hardcoded LLM settings with dynamic, configurable player agents. Classes ------- .. autoapisummary:: haive.games.hold_em.configurable_config.ConfigurableHoldemConfig Functions --------- .. autoapisummary:: haive.games.hold_em.configurable_config.create_budget_holdem_config haive.games.hold_em.configurable_config.create_experimental_holdem_config haive.games.hold_em.configurable_config.create_heads_up_holdem_config haive.games.hold_em.configurable_config.create_holdem_config haive.games.hold_em.configurable_config.create_holdem_config_from_example haive.games.hold_em.configurable_config.create_holdem_config_from_player_configs haive.games.hold_em.configurable_config.create_poker_pro_holdem_config haive.games.hold_em.configurable_config.get_example_config haive.games.hold_em.configurable_config.list_example_configurations Module Contents --------------- .. py:class:: ConfigurableHoldemConfig Bases: :py:obj:`haive.games.hold_em.config.HoldemGameAgentConfig` Configurable Hold'em configuration with dynamic LLM selection. This configuration allows users to specify different LLMs for different roles in the Texas Hold'em game, providing flexibility and avoiding hardcoded models. .. attribute:: player1_model Model for player 1 (can be string or LLMConfig) .. attribute:: player2_model Model for player 2 (can be string or LLMConfig) .. attribute:: player1_name Name for player 1 .. attribute:: player2_name Name for player 2 .. attribute:: example_config Optional example configuration name .. attribute:: player_configs Optional detailed player configurations .. attribute:: temperature Temperature for LLM generation .. attribute:: enable_analysis Whether to enable strategic analysis .. attribute:: heads_up_mode Whether this is heads-up play .. attribute:: recursion_limit Python recursion limit for game execution .. py:method:: model_post_init(__context) Initialize engines after model creation. .. py:function:: create_budget_holdem_config(**kwargs) Create a budget-friendly Hold'em configuration. .. py:function:: create_experimental_holdem_config(**kwargs) Create an experimental Hold'em configuration with mixed providers. .. py:function:: create_heads_up_holdem_config(**kwargs) Create a heads-up specialized Hold'em configuration. .. py:function:: create_holdem_config(player1_model = 'gpt-4o', player2_model = 'claude-3-5-sonnet-20240620', **kwargs) Create a configurable Hold'em configuration with simple model specifications. :param player1_model: Model for player 1 and analyzer :param player2_model: Model for player 2 and analyzer :param \*\*kwargs: Additional configuration parameters :returns: Configured Hold'em game :rtype: ConfigurableHoldemConfig .. rubric:: Examples >>> config = create_holdem_config("gpt-4o", "claude-3-opus", temperature=0.5) >>> config = create_holdem_config( ... "openai:gpt-4o", ... "anthropic:claude-3-5-sonnet-20240620", ... heads_up_mode=True ... ) .. py:function:: create_holdem_config_from_example(example_name, **kwargs) Create a configurable Hold'em configuration from a predefined example. :param example_name: Name of the example configuration :param \*\*kwargs: Additional configuration parameters to override :returns: Configured Hold'em game :rtype: ConfigurableHoldemConfig Available examples: - "gpt_vs_claude": GPT vs Claude - "gpt_only": GPT for both players - "claude_only": Claude for both players - "budget": Cost-effective models - "mixed": Different provider per role - "poker_pros": High-powered models for strategic gameplay - "heads_up": Specialized for heads-up play .. rubric:: Examples >>> config = create_holdem_config_from_example("budget", temperature=0.3) >>> config = create_holdem_config_from_example("poker_pros", heads_up_mode=True) .. py:function:: create_holdem_config_from_player_configs(player_configs, **kwargs) Create a configurable Hold'em configuration from detailed player configurations. :param player_configs: Dictionary mapping role names to player configurations :param \*\*kwargs: Additional configuration parameters :returns: Configured Hold'em game :rtype: ConfigurableHoldemConfig Expected roles: - "player1_player": Player 1 configuration - "player2_player": Player 2 configuration - "player1_analyzer": Player 1 analyzer configuration - "player2_analyzer": Player 2 analyzer configuration .. rubric:: Examples >>> player_configs = { ... "player1_player": PlayerAgentConfig( ... llm_config="gpt-4o", ... temperature=0.7, ... player_name="Poker Pro" ... ), ... "player2_player": PlayerAgentConfig( ... llm_config="claude-3-opus", ... temperature=0.3, ... player_name="Card Shark" ... ), ... "player1_analyzer": PlayerAgentConfig( ... llm_config="gpt-4o", ... temperature=0.2, ... player_name="Strategic Analyst" ... ), ... "player2_analyzer": PlayerAgentConfig( ... llm_config="claude-3-opus", ... temperature=0.2, ... player_name="Game Theory Expert" ... ), ... } >>> config = create_holdem_config_from_player_configs(player_configs) .. py:function:: create_poker_pro_holdem_config(**kwargs) Create a poker professional-style Hold'em configuration with powerful models. .. py:function:: get_example_config(name) Get a predefined example configuration by name. :param name: Name of the example configuration :returns: The example configuration :rtype: ConfigurableHoldemConfig :raises ValueError: If the example name is not found .. py:function:: list_example_configurations() List all available example configurations. :returns: Mapping of configuration names to descriptions :rtype: Dict[str, str]