Add pre commit (#26)

This commit is contained in:
Lamont Huffman
2025-11-05 11:44:19 +08:00
committed by GitHub
parent 2164371e64
commit 30d86efbb3
33 changed files with 565 additions and 496 deletions

View File

@@ -2,8 +2,8 @@
"""The structured output models used in the werewolf game."""
from typing import Literal
from agentscope.agent import AgentBase
from pydantic import BaseModel, Field
from agentscope.agent import AgentBase
class DiscussionModel(BaseModel):
@@ -44,7 +44,9 @@ def get_poison_model(agents: list[AgentBase]) -> type[BaseModel]:
poison: bool = Field(
description="Do you want to use the poison potion",
)
name: Literal[tuple(_.name for _ in agents)] | None = Field( # type: ignore
name: Literal[ # type: ignore
tuple(_.name for _ in agents)
] | None = Field(
description="The name of the player you want to poison, if you "
"don't want to poison anyone, just leave it empty",
default=None,
@@ -75,7 +77,9 @@ def get_hunter_model(agents: list[AgentBase]) -> type[BaseModel]:
shoot: bool = Field(
description="Whether you want to use the shooting ability or not",
)
name: Literal[tuple(_.name for _ in agents)] | None = Field( # type: ignore
name: Literal[ # type: ignore
tuple(_.name for _ in agents)
] | None = Field(
description="The name of the player you want to shoot, if you "
"don't want to the ability, just leave it empty",
default=None,