Skip to content

Commit

Permalink
fix bug in extracting the ai choice in the next round messag
Browse files Browse the repository at this point in the history
  • Loading branch information
phelps-sg committed Nov 5, 2023
1 parent a2cdab9 commit 1c1425c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion llm_cooperation/gametypes/simultaneous.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ def analyse_rounds(
def next_round(
partner_strategy: Strategy[CT], state: GameState[CT, PT, RT]
) -> List[Completion]:
ai_choice = state.game_setup.extract_choice(state.messages[-2])
previous_message = state.messages[-1]
logger.debug("previous_message = %s", previous_message)
ai_choice = state.game_setup.extract_choice(previous_message)
user_choice = partner_strategy(state)
logger.debug("ai_choice = %s", ai_choice)
logger.debug("user_choice = %s", user_choice)
ai_payoff, user_payoff = state.game_setup.payoffs(ai_choice, user_choice)
return [
user_message(
Expand Down

0 comments on commit 1c1425c

Please sign in to comment.