Skip to content

Commit

Permalink
apply mypy and flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
hmasdev committed Oct 27, 2024
1 parent f359ee2 commit 63b2114
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion langchain_werewolf/game/check_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
REVEAL_ROLES_NODE_NAME: str = 'reveal_roles'

GAME_RESULT_MESSAGE_TEMPLATE: str = 'The game has ended: {result}'
PLAYER_ROLE_MESSAGE_TEMPLATE: str = '- The role of {name} is {role} (State: {state})'
PLAYER_ROLE_MESSAGE_TEMPLATE: str = '- The role of {name} is {role} (State: {state})' # noqa
REVEAL_ALL_PLAYER_ROLES_MESSAGE_TEMPLATE: str = '''The roles of the players are as follows:
{roles}
''' # noqa
Expand Down
2 changes: 1 addition & 1 deletion langchain_werewolf/game/night_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


class GeneratePromptInputForNightAction(BaseModel):
role: ERole = Field(..., title="the role of the player")
role: str = Field(..., title="the role of the player")
night_action: str = Field(..., title="the night action of the player") # noqa
question_to_decide_night_action: str = Field(..., title="the question to decide the night action of the player") # noqa
alive_players_names: list[str] = Field(..., title="the names of the alive players") # noqa
Expand Down
2 changes: 1 addition & 1 deletion langchain_werewolf/game/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _announce_game_rule(
sender=GAME_MASTER_NAME,
participants=[GAME_MASTER_NAME]+[player.name for player in players],
message=game_rule_template.format(
n_roles=len(players),
n_roles=len(roles_explanation),
roles='\n'.join([
f'{idx+1}. {role_exp}'
for idx, role_exp in enumerate(roles_explanation)
Expand Down
2 changes: 1 addition & 1 deletion tests/game/test_night_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def generate_prompt(m: GeneratePromptInputForNightAction) -> str:
assert actual['chat_state'][frozenset([player.name, GAME_MASTER_NAME])]
assert actual['chat_state'][frozenset([player.name, GAME_MASTER_NAME])].messages # noqa
assert actual['chat_state'][frozenset([player.name, GAME_MASTER_NAME])].messages[0].value.name == GAME_MASTER_NAME # noqa
assert actual['chat_state'][frozenset([player.name, GAME_MASTER_NAME])].messages[0].value.message == generate_prompt(GeneratePromptInputForNightAction(role=player.role, night_action=player.night_action, question_to_decide_night_action=player.question_to_decide_night_action, alive_players_names=state.alive_players_names)) # type: ignore # noqa
assert actual['chat_state'][frozenset([player.name, GAME_MASTER_NAME])].messages[0].value.message == generate_prompt(GeneratePromptInputForNightAction(role=player.role.value, night_action=player.night_action, question_to_decide_night_action=player.question_to_decide_night_action, alive_players_names=state.alive_players_names)) # type: ignore # noqa
assert actual['chat_state'][frozenset([player.name, GAME_MASTER_NAME])].messages[0].value.participants == frozenset([player.name, GAME_MASTER_NAME]) # noqa


Expand Down

0 comments on commit 63b2114

Please sign in to comment.