feat: add ai agent http agent

This commit is contained in:
qianrui.mmmy
2026-05-11 21:09:55 +08:00
committed by mamamiyear
parent 6014ec0707
commit bc372c5ba1
8 changed files with 1276 additions and 5 deletions
+6 -3
View File
@@ -79,6 +79,12 @@ class TableGame:
self._advance_button()
assert self.button_index is not None
# Notify every agent that a new hand is starting. Pushing here (as
# opposed to after ``_award_pots``) lets HTTP agents seed a fresh
# session with the latest table state and per-hand history before
# any decision is asked of them.
self._broadcast_game_update()
self._deal_hole_cards(deck)
small_blind_index, big_blind_index = self._blind_indexes()
self._post_blind(small_blind_index, "small_blind", self.small_blind)
@@ -115,9 +121,6 @@ class TableGame:
finished_at=time(),
)
self.hand_summaries.append(summary)
# Notify every agent so HTTP-backed clients can render the just
# finished hand. Failures here must never abort the table.
self._broadcast_game_update()
return summary
def run_hands(self, max_hands: int, until_one_left: bool = False) -> list[HandSummary]: