Spaces:
Running
Running
茂道
commited on
Commit
·
be334a3
1
Parent(s):
6b5fe86
update
Browse files- .idea/misc.xml +1 -1
- .idea/werewolf_1.iml +1 -1
- requirements.txt +2 -1
- werewolf/app.py +5 -5
- werewolf/hunter/__pycache__/hunter_agent.cpython-312.pyc +0 -0
- werewolf/hunter/__pycache__/prompt.cpython-312.pyc +0 -0
- werewolf/hunter/hunter_agent.py +2 -2
- werewolf/seer/__pycache__/prompt.cpython-312.pyc +0 -0
- werewolf/seer/__pycache__/seer_agent.cpython-312.pyc +0 -0
- werewolf/seer/seer_agent.py +2 -2
- werewolf/villager/__pycache__/prompt.cpython-312.pyc +0 -0
- werewolf/villager/__pycache__/villager_agent.cpython-312.pyc +0 -0
- werewolf/villager/villager_agent.py +1 -1
- werewolf/witch/__pycache__/prompt.cpython-312.pyc +0 -0
- werewolf/witch/__pycache__/witch_agent.cpython-312.pyc +0 -0
- werewolf/witch/witch_agent.py +2 -2
- werewolf/wolf/__pycache__/prompt.cpython-312.pyc +0 -0
- werewolf/wolf/__pycache__/wolf_agent.cpython-312.pyc +0 -0
- werewolf/wolf/wolf_agent.py +2 -2
.idea/misc.xml
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<project version="4">
|
3 |
-
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.
|
4 |
</project>
|
|
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<project version="4">
|
3 |
+
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (venv) (3)" project-jdk-type="Python SDK" />
|
4 |
</project>
|
.idea/werewolf_1.iml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<module type="PYTHON_MODULE" version="4">
|
3 |
<component name="NewModuleRootManager">
|
4 |
<content url="file://$MODULE_DIR$" />
|
5 |
-
<orderEntry type="
|
6 |
<orderEntry type="sourceFolder" forTests="false" />
|
7 |
</component>
|
8 |
</module>
|
|
|
2 |
<module type="PYTHON_MODULE" version="4">
|
3 |
<component name="NewModuleRootManager">
|
4 |
<content url="file://$MODULE_DIR$" />
|
5 |
+
<orderEntry type="jdk" jdkName="Python 3.10 (venv) (3)" jdkType="Python SDK" />
|
6 |
<orderEntry type="sourceFolder" forTests="false" />
|
7 |
</component>
|
8 |
</module>
|
requirements.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
fastapi
|
2 |
uvicorn[standard]
|
3 |
-
openai
|
|
|
|
1 |
fastapi
|
2 |
uvicorn[standard]
|
3 |
+
openai
|
4 |
+
werewolf-agent-build-sdk==0.0.1
|
werewolf/app.py
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
import os
|
2 |
|
3 |
from agent_build_sdk.builder import AgentBuilder
|
4 |
-
from
|
5 |
-
from
|
6 |
-
from
|
7 |
-
from
|
8 |
-
from
|
9 |
from agent_build_sdk.model.roles import ROLE_VILLAGER,ROLE_WOLF,ROLE_SEER,ROLE_WITCH,ROLE_HUNTER
|
10 |
from agent_build_sdk.sdk.werewolf_agent import WerewolfAgent
|
11 |
|
|
|
1 |
import os
|
2 |
|
3 |
from agent_build_sdk.builder import AgentBuilder
|
4 |
+
from werewolf.hunter.hunter_agent import HunterAgent
|
5 |
+
from werewolf.seer.seer_agent import SeerAgent
|
6 |
+
from werewolf.villager.villager_agent import VillagerAgent
|
7 |
+
from werewolf.witch.witch_agent import WitchAgent
|
8 |
+
from werewolf.wolf.wolf_agent import WolfAgent
|
9 |
from agent_build_sdk.model.roles import ROLE_VILLAGER,ROLE_WOLF,ROLE_SEER,ROLE_WITCH,ROLE_HUNTER
|
10 |
from agent_build_sdk.sdk.werewolf_agent import WerewolfAgent
|
11 |
|
werewolf/hunter/__pycache__/hunter_agent.cpython-312.pyc
ADDED
Binary file (7.6 kB). View file
|
|
werewolf/hunter/__pycache__/prompt.cpython-312.pyc
ADDED
Binary file (2.36 kB). View file
|
|
werewolf/hunter/hunter_agent.py
CHANGED
@@ -5,14 +5,14 @@ from agent_build_sdk.model.werewolf_model import AgentResp, AgentReq, STATUS_STA
|
|
5 |
from agent_build_sdk.utils.logger import logger
|
6 |
from agent_build_sdk.sdk.role_agent import BasicRoleAgent
|
7 |
from agent_build_sdk.sdk.agent import format_prompt
|
8 |
-
from
|
9 |
|
10 |
|
11 |
class HunterAgent(BasicRoleAgent):
|
12 |
"""猎人角色Agent"""
|
13 |
|
14 |
def __init__(self, llm_caller=None, memory=None):
|
15 |
-
super().__init__(ROLE_HUNTER
|
16 |
|
17 |
def perceive(self, req=AgentReq):
|
18 |
if req.status == STATUS_START:
|
|
|
5 |
from agent_build_sdk.utils.logger import logger
|
6 |
from agent_build_sdk.sdk.role_agent import BasicRoleAgent
|
7 |
from agent_build_sdk.sdk.agent import format_prompt
|
8 |
+
from werewolf.hunter.prompt import DESC_PROMPT, VOTE_PROMPT, SKILL_PROMPT
|
9 |
|
10 |
|
11 |
class HunterAgent(BasicRoleAgent):
|
12 |
"""猎人角色Agent"""
|
13 |
|
14 |
def __init__(self, llm_caller=None, memory=None):
|
15 |
+
super().__init__(ROLE_HUNTER)
|
16 |
|
17 |
def perceive(self, req=AgentReq):
|
18 |
if req.status == STATUS_START:
|
werewolf/seer/__pycache__/prompt.cpython-312.pyc
ADDED
Binary file (2.41 kB). View file
|
|
werewolf/seer/__pycache__/seer_agent.cpython-312.pyc
ADDED
Binary file (7.89 kB). View file
|
|
werewolf/seer/seer_agent.py
CHANGED
@@ -5,14 +5,14 @@ from agent_build_sdk.model.werewolf_model import AgentResp, AgentReq, STATUS_STA
|
|
5 |
from agent_build_sdk.utils.logger import logger
|
6 |
from agent_build_sdk.sdk.role_agent import BasicRoleAgent
|
7 |
from agent_build_sdk.sdk.agent import format_prompt
|
8 |
-
from
|
9 |
|
10 |
|
11 |
class SeerAgent(BasicRoleAgent):
|
12 |
"""预言家角色Agent"""
|
13 |
|
14 |
def __init__(self, llm_caller=None, memory=None):
|
15 |
-
super().__init__(ROLE_SEER
|
16 |
self.memory.set_variable("checked_players", {}) # 存储已查验的玩家信息
|
17 |
|
18 |
def perceive(self, req=AgentReq):
|
|
|
5 |
from agent_build_sdk.utils.logger import logger
|
6 |
from agent_build_sdk.sdk.role_agent import BasicRoleAgent
|
7 |
from agent_build_sdk.sdk.agent import format_prompt
|
8 |
+
from werewolf.seer.prompt import DESC_PROMPT, VOTE_PROMPT, SKILL_PROMPT
|
9 |
|
10 |
|
11 |
class SeerAgent(BasicRoleAgent):
|
12 |
"""预言家角色Agent"""
|
13 |
|
14 |
def __init__(self, llm_caller=None, memory=None):
|
15 |
+
super().__init__(ROLE_SEER)
|
16 |
self.memory.set_variable("checked_players", {}) # 存储已查验的玩家信息
|
17 |
|
18 |
def perceive(self, req=AgentReq):
|
werewolf/villager/__pycache__/prompt.cpython-312.pyc
ADDED
Binary file (1.59 kB). View file
|
|
werewolf/villager/__pycache__/villager_agent.cpython-312.pyc
ADDED
Binary file (6.18 kB). View file
|
|
werewolf/villager/villager_agent.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from
|
2 |
from agent_build_sdk.model.roles import ROLE_VILLAGER
|
3 |
from agent_build_sdk.model.werewolf_model import AgentResp, AgentReq, STATUS_START, STATUS_WOLF_SPEECH, \
|
4 |
STATUS_VOTE_RESULT, STATUS_SKILL, STATUS_SKILL_RESULT, STATUS_NIGHT_INFO, STATUS_DAY, STATUS_DISCUSS, STATUS_VOTE, \
|
|
|
1 |
+
from werewolf.villager.prompt import DESC_PROMPT, VOTE_PROMPT
|
2 |
from agent_build_sdk.model.roles import ROLE_VILLAGER
|
3 |
from agent_build_sdk.model.werewolf_model import AgentResp, AgentReq, STATUS_START, STATUS_WOLF_SPEECH, \
|
4 |
STATUS_VOTE_RESULT, STATUS_SKILL, STATUS_SKILL_RESULT, STATUS_NIGHT_INFO, STATUS_DAY, STATUS_DISCUSS, STATUS_VOTE, \
|
werewolf/witch/__pycache__/prompt.cpython-312.pyc
ADDED
Binary file (2.76 kB). View file
|
|
werewolf/witch/__pycache__/witch_agent.cpython-312.pyc
ADDED
Binary file (8.66 kB). View file
|
|
werewolf/witch/witch_agent.py
CHANGED
@@ -5,14 +5,14 @@ from agent_build_sdk.model.werewolf_model import AgentResp, AgentReq, STATUS_STA
|
|
5 |
from agent_build_sdk.utils.logger import logger
|
6 |
from agent_build_sdk.sdk.role_agent import BasicRoleAgent
|
7 |
from agent_build_sdk.sdk.agent import format_prompt
|
8 |
-
from
|
9 |
|
10 |
|
11 |
class WitchAgent(BasicRoleAgent):
|
12 |
"""女巫角色Agent"""
|
13 |
|
14 |
def __init__(self, llm_caller=None, memory=None):
|
15 |
-
super().__init__(ROLE_WITCH
|
16 |
# 初始化女巫的两瓶药
|
17 |
self.memory.set_variable("has_poison", True)
|
18 |
self.memory.set_variable("has_antidote", True)
|
|
|
5 |
from agent_build_sdk.utils.logger import logger
|
6 |
from agent_build_sdk.sdk.role_agent import BasicRoleAgent
|
7 |
from agent_build_sdk.sdk.agent import format_prompt
|
8 |
+
from werewolf.witch.prompt import DESC_PROMPT, VOTE_PROMPT, SKILL_PROMPT
|
9 |
|
10 |
|
11 |
class WitchAgent(BasicRoleAgent):
|
12 |
"""女巫角色Agent"""
|
13 |
|
14 |
def __init__(self, llm_caller=None, memory=None):
|
15 |
+
super().__init__(ROLE_WITCH)
|
16 |
# 初始化女巫的两瓶药
|
17 |
self.memory.set_variable("has_poison", True)
|
18 |
self.memory.set_variable("has_antidote", True)
|
werewolf/wolf/__pycache__/prompt.cpython-312.pyc
ADDED
Binary file (2.67 kB). View file
|
|
werewolf/wolf/__pycache__/wolf_agent.cpython-312.pyc
ADDED
Binary file (9.16 kB). View file
|
|
werewolf/wolf/wolf_agent.py
CHANGED
@@ -5,14 +5,14 @@ from agent_build_sdk.model.werewolf_model import AgentResp, AgentReq, STATUS_STA
|
|
5 |
from agent_build_sdk.utils.logger import logger
|
6 |
from agent_build_sdk.sdk.role_agent import BasicRoleAgent
|
7 |
from agent_build_sdk.sdk.agent import format_prompt
|
8 |
-
from
|
9 |
|
10 |
|
11 |
class WolfAgent(BasicRoleAgent):
|
12 |
"""狼人角色Agent"""
|
13 |
|
14 |
def __init__(self, llm_caller=None, memory=None):
|
15 |
-
super().__init__(ROLE_WOLF
|
16 |
self.memory.set_variable("teammates", []) # 存储队友信息
|
17 |
|
18 |
def perceive(self, req=AgentReq):
|
|
|
5 |
from agent_build_sdk.utils.logger import logger
|
6 |
from agent_build_sdk.sdk.role_agent import BasicRoleAgent
|
7 |
from agent_build_sdk.sdk.agent import format_prompt
|
8 |
+
from werewolf.wolf.prompt import DESC_PROMPT, VOTE_PROMPT, KILL_PROMPT, WOLF_SPEECH_PROMPT
|
9 |
|
10 |
|
11 |
class WolfAgent(BasicRoleAgent):
|
12 |
"""狼人角色Agent"""
|
13 |
|
14 |
def __init__(self, llm_caller=None, memory=None):
|
15 |
+
super().__init__(ROLE_WOLF)
|
16 |
self.memory.set_variable("teammates", []) # 存储队友信息
|
17 |
|
18 |
def perceive(self, req=AgentReq):
|