Spaces:
Running
Running
茂道
commited on
Commit
·
539b420
1
Parent(s):
b362bc7
update
Browse files- .idea/workspace.xml +2 -3
- werewolf/app.py +4 -4
- werewolf/seer/__pycache__/seer_agent.cpython-312.pyc +0 -0
- werewolf/seer/seer_agent.py +2 -2
- werewolf/villager/__pycache__/villager_agent.cpython-312.pyc +0 -0
- werewolf/villager/villager_agent.py +2 -2
- werewolf/witch/__pycache__/witch_agent.cpython-312.pyc +0 -0
- werewolf/witch/witch_agent.py +2 -2
- werewolf/wolf/__pycache__/wolf_agent.cpython-312.pyc +0 -0
- werewolf/wolf/wolf_agent.py +2 -2
.idea/workspace.xml
CHANGED
|
@@ -3,7 +3,6 @@
|
|
| 3 |
<component name="ChangeListManager">
|
| 4 |
<list default="true" id="be0bdb17-6f52-4720-b934-341fa7978d29" name="Changes" comment="">
|
| 5 |
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
| 6 |
-
<change beforePath="$PROJECT_DIR$/requirements.txt" beforeDir="false" afterPath="$PROJECT_DIR$/requirements.txt" afterDir="false" />
|
| 7 |
</list>
|
| 8 |
<option name="SHOW_DIALOG" value="false" />
|
| 9 |
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
@@ -71,7 +70,7 @@
|
|
| 71 |
<option name="number" value="Default" />
|
| 72 |
<option name="presentableId" value="Default" />
|
| 73 |
<updated>1745132074997</updated>
|
| 74 |
-
<workItem from="1745132078229" duration="
|
| 75 |
</task>
|
| 76 |
<servers />
|
| 77 |
</component>
|
|
@@ -101,6 +100,6 @@
|
|
| 101 |
</breakpoint-manager>
|
| 102 |
</component>
|
| 103 |
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
| 104 |
-
<SUITE FILE_PATH="coverage/werewolf_1$app.coverage" NAME="app Coverage Results" MODIFIED="
|
| 105 |
</component>
|
| 106 |
</project>
|
|
|
|
| 3 |
<component name="ChangeListManager">
|
| 4 |
<list default="true" id="be0bdb17-6f52-4720-b934-341fa7978d29" name="Changes" comment="">
|
| 5 |
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
|
|
|
| 6 |
</list>
|
| 7 |
<option name="SHOW_DIALOG" value="false" />
|
| 8 |
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
|
|
| 70 |
<option name="number" value="Default" />
|
| 71 |
<option name="presentableId" value="Default" />
|
| 72 |
<updated>1745132074997</updated>
|
| 73 |
+
<workItem from="1745132078229" duration="4105000" />
|
| 74 |
</task>
|
| 75 |
<servers />
|
| 76 |
</component>
|
|
|
|
| 100 |
</breakpoint-manager>
|
| 101 |
</component>
|
| 102 |
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
| 103 |
+
<SUITE FILE_PATH="coverage/werewolf_1$app.coverage" NAME="app Coverage Results" MODIFIED="1745138641306" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/werewolf" />
|
| 104 |
</component>
|
| 105 |
</project>
|
werewolf/app.py
CHANGED
|
@@ -11,9 +11,9 @@ from agent_build_sdk.sdk.werewolf_agent import WerewolfAgent
|
|
| 11 |
if __name__ == '__main__':
|
| 12 |
name = 'spy'
|
| 13 |
agent = WerewolfAgent(name, model_name=os.getenv('MODEL_NAME'))
|
| 14 |
-
agent.register_role_agent(ROLE_VILLAGER, VillagerAgent())
|
| 15 |
-
agent.register_role_agent(ROLE_WOLF, WolfAgent())
|
| 16 |
-
agent.register_role_agent(ROLE_SEER, SeerAgent())
|
| 17 |
-
agent.register_role_agent(ROLE_WITCH, WitchAgent())
|
| 18 |
agent_builder = AgentBuilder(name, agent=agent)
|
| 19 |
agent_builder.start()
|
|
|
|
| 11 |
if __name__ == '__main__':
|
| 12 |
name = 'spy'
|
| 13 |
agent = WerewolfAgent(name, model_name=os.getenv('MODEL_NAME'))
|
| 14 |
+
agent.register_role_agent(ROLE_VILLAGER, VillagerAgent(model_name=os.getenv('MODEL_NAME')))
|
| 15 |
+
agent.register_role_agent(ROLE_WOLF, WolfAgent(model_name=os.getenv('MODEL_NAME')))
|
| 16 |
+
agent.register_role_agent(ROLE_SEER, SeerAgent(model_name=os.getenv('MODEL_NAME')))
|
| 17 |
+
agent.register_role_agent(ROLE_WITCH, WitchAgent(model_name=os.getenv('MODEL_NAME')))
|
| 18 |
agent_builder = AgentBuilder(name, agent=agent)
|
| 19 |
agent_builder.start()
|
werewolf/seer/__pycache__/seer_agent.cpython-312.pyc
CHANGED
|
Binary files a/werewolf/seer/__pycache__/seer_agent.cpython-312.pyc and b/werewolf/seer/__pycache__/seer_agent.cpython-312.pyc differ
|
|
|
werewolf/seer/seer_agent.py
CHANGED
|
@@ -11,8 +11,8 @@ from seer.prompt import DESC_PROMPT, VOTE_PROMPT, SKILL_PROMPT
|
|
| 11 |
class SeerAgent(BasicRoleAgent):
|
| 12 |
"""预言家角色Agent"""
|
| 13 |
|
| 14 |
-
def __init__(self,
|
| 15 |
-
super().__init__(ROLE_SEER)
|
| 16 |
self.memory.set_variable("checked_players", {}) # 存储已查验的玩家信息
|
| 17 |
|
| 18 |
def perceive(self, req=AgentReq):
|
|
|
|
| 11 |
class SeerAgent(BasicRoleAgent):
|
| 12 |
"""预言家角色Agent"""
|
| 13 |
|
| 14 |
+
def __init__(self, model_name):
|
| 15 |
+
super().__init__(ROLE_SEER, model_name=model_name)
|
| 16 |
self.memory.set_variable("checked_players", {}) # 存储已查验的玩家信息
|
| 17 |
|
| 18 |
def perceive(self, req=AgentReq):
|
werewolf/villager/__pycache__/villager_agent.cpython-312.pyc
CHANGED
|
Binary files a/werewolf/villager/__pycache__/villager_agent.cpython-312.pyc and b/werewolf/villager/__pycache__/villager_agent.cpython-312.pyc differ
|
|
|
werewolf/villager/villager_agent.py
CHANGED
|
@@ -11,8 +11,8 @@ from agent_build_sdk.sdk.agent import format_prompt
|
|
| 11 |
class VillagerAgent(BasicRoleAgent):
|
| 12 |
"""平民角色Agent"""
|
| 13 |
|
| 14 |
-
def __init__(self):
|
| 15 |
-
super().__init__(ROLE_VILLAGER)
|
| 16 |
|
| 17 |
def perceive(self, req=AgentReq):
|
| 18 |
if req.status == STATUS_START:
|
|
|
|
| 11 |
class VillagerAgent(BasicRoleAgent):
|
| 12 |
"""平民角色Agent"""
|
| 13 |
|
| 14 |
+
def __init__(self, model_name):
|
| 15 |
+
super().__init__(ROLE_VILLAGER, model_name=model_name)
|
| 16 |
|
| 17 |
def perceive(self, req=AgentReq):
|
| 18 |
if req.status == STATUS_START:
|
werewolf/witch/__pycache__/witch_agent.cpython-312.pyc
CHANGED
|
Binary files a/werewolf/witch/__pycache__/witch_agent.cpython-312.pyc and b/werewolf/witch/__pycache__/witch_agent.cpython-312.pyc differ
|
|
|
werewolf/witch/witch_agent.py
CHANGED
|
@@ -11,8 +11,8 @@ from witch.prompt import DESC_PROMPT, VOTE_PROMPT, SKILL_PROMPT
|
|
| 11 |
class WitchAgent(BasicRoleAgent):
|
| 12 |
"""女巫角色Agent"""
|
| 13 |
|
| 14 |
-
def __init__(self,
|
| 15 |
-
super().__init__(ROLE_WITCH)
|
| 16 |
# 初始化女巫的两瓶药
|
| 17 |
self.memory.set_variable("has_poison", True)
|
| 18 |
self.memory.set_variable("has_antidote", True)
|
|
|
|
| 11 |
class WitchAgent(BasicRoleAgent):
|
| 12 |
"""女巫角色Agent"""
|
| 13 |
|
| 14 |
+
def __init__(self, model_name):
|
| 15 |
+
super().__init__(ROLE_WITCH, model_name=model_name)
|
| 16 |
# 初始化女巫的两瓶药
|
| 17 |
self.memory.set_variable("has_poison", True)
|
| 18 |
self.memory.set_variable("has_antidote", True)
|
werewolf/wolf/__pycache__/wolf_agent.cpython-312.pyc
CHANGED
|
Binary files a/werewolf/wolf/__pycache__/wolf_agent.cpython-312.pyc and b/werewolf/wolf/__pycache__/wolf_agent.cpython-312.pyc differ
|
|
|
werewolf/wolf/wolf_agent.py
CHANGED
|
@@ -11,8 +11,8 @@ from wolf.prompt import DESC_PROMPT, VOTE_PROMPT, KILL_PROMPT, WOLF_SPEECH_PROMP
|
|
| 11 |
class WolfAgent(BasicRoleAgent):
|
| 12 |
"""狼人角色Agent"""
|
| 13 |
|
| 14 |
-
def __init__(self,
|
| 15 |
-
super().__init__(ROLE_WOLF)
|
| 16 |
self.memory.set_variable("teammates", []) # 存储队友信息
|
| 17 |
|
| 18 |
def perceive(self, req=AgentReq):
|
|
|
|
| 11 |
class WolfAgent(BasicRoleAgent):
|
| 12 |
"""狼人角色Agent"""
|
| 13 |
|
| 14 |
+
def __init__(self, model_name):
|
| 15 |
+
super().__init__(ROLE_WOLF, model_name=model_name)
|
| 16 |
self.memory.set_variable("teammates", []) # 存储队友信息
|
| 17 |
|
| 18 |
def perceive(self, req=AgentReq):
|