haive.games.poker.agent¶
Enhanced Texas Hold’em Poker agent implementation.
This module implements a robust poker agent with improved: - Structured output handling with proper schema validation - Comprehensive logging and debugging - Error handling and retry policies for invalid moves - Enhanced prompts for LLM decisions
Classes¶
Enhanced agent class for managing a multi-player Texas Hold'em poker game. |
|
Configuration for retry policies. |
Module Contents¶
- class haive.games.poker.agent.PokerAgent(config=PokerAgentConfig())[source]¶
Bases:
haive.core.engine.agent.agent.Agent
[haive.games.poker.config.PokerAgentConfig
]Enhanced agent class for managing a multi-player Texas Hold’em poker game.
Key improvements: - Proper structured output handling - Comprehensive debug logging - Retry policies for failed operations - Enhanced prompts and decision handling
Initialize the enhanced poker agent.
- Parameters:
- end_hand(state)[source]¶
Handle the end of a hand - determine winner(s) and update stats.
- Parameters:
- Return type:
- handle_player_decision(state)[source]¶
Enhanced player decision handling with improved error recovery.
This method: 1. Determines the current player 2. Calculates legal actions 3. Gets decision from the player agent 4. Validates and applies the decision 5. Updates game state
- Parameters:
- Return type:
- initialize_game(state)[source]¶
Initialize the poker game state with enhanced logging.
- Parameters:
- Return type:
- setup_hand(state)[source]¶
Set up a new poker hand with enhanced error handling and debugging.
- Parameters:
- Return type:
- should_continue_round(state)[source]¶
Determine if we should continue the current betting round.
- Parameters:
- Return type:
- should_continue_to_next_phase(state)[source]¶
Determine if the game should advance to the next phase.
- Parameters:
- Return type:
- should_play_another_hand(state)[source]¶
Determine if another hand should be played.
- Parameters:
- Return type: