Spaces:
Running
Running
茂道
commited on
Commit
·
9bdadf3
1
Parent(s):
852b8b8
update prompt
Browse files- .idea/workspace.xml +3 -1
- werewolf/witch/prompt.py +2 -3
- werewolf/witch/witch_agent.py +4 -4
.idea/workspace.xml
CHANGED
@@ -3,6 +3,8 @@
|
|
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,7 +72,7 @@
|
|
70 |
<option name="number" value="Default" />
|
71 |
<option name="presentableId" value="Default" />
|
72 |
<updated>1745132074997</updated>
|
73 |
-
<workItem from="1745132078229" duration="
|
74 |
</task>
|
75 |
<servers />
|
76 |
</component>
|
|
|
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$/werewolf/witch/prompt.py" beforeDir="false" afterPath="$PROJECT_DIR$/werewolf/witch/prompt.py" afterDir="false" />
|
7 |
+
<change beforePath="$PROJECT_DIR$/werewolf/witch/witch_agent.py" beforeDir="false" afterPath="$PROJECT_DIR$/werewolf/witch/witch_agent.py" afterDir="false" />
|
8 |
</list>
|
9 |
<option name="SHOW_DIALOG" value="false" />
|
10 |
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
|
72 |
<option name="number" value="Default" />
|
73 |
<option name="presentableId" value="Default" />
|
74 |
<updated>1745132074997</updated>
|
75 |
+
<workItem from="1745132078229" duration="10057000" />
|
76 |
</task>
|
77 |
<servers />
|
78 |
</component>
|
werewolf/witch/prompt.py
CHANGED
@@ -29,11 +29,10 @@ VOTE_PROMPT = """{history}
|
|
29 |
|
30 |
SKILL_PROMPT = """{history}
|
31 |
你是{name},作为女巫,你现在可以使用你的技能。
|
32 |
-
|
33 |
|
34 |
你目前拥有的药水:
|
35 |
-
|
36 |
-
- 毒药:{'有' if has_poison else '已用完'}
|
37 |
|
38 |
你可以:
|
39 |
1. 使用解药救活{tonight_killed}(如果你还有解药)
|
|
|
29 |
|
30 |
SKILL_PROMPT = """{history}
|
31 |
你是{name},作为女巫,你现在可以使用你的技能。
|
32 |
+
今晚信息:{tonight_killed}。
|
33 |
|
34 |
你目前拥有的药水:
|
35 |
+
{skill_info}
|
|
|
36 |
|
37 |
你可以:
|
38 |
1. 使用解药救活{tonight_killed}(如果你还有解药)
|
werewolf/witch/witch_agent.py
CHANGED
@@ -83,17 +83,17 @@ class WitchAgent(BasicRoleAgent):
|
|
83 |
elif req.status == STATUS_SKILL:
|
84 |
has_poison = self.memory.load_variable("has_poison")
|
85 |
has_antidote = self.memory.load_variable("has_antidote")
|
86 |
-
tonight_killed = req.
|
87 |
|
88 |
choices = [name for name in req.message.split(",") if name != self.memory.load_variable("name")] # 排除自己
|
89 |
self.memory.set_variable("choices", choices)
|
90 |
-
|
|
|
91 |
prompt = format_prompt(SKILL_PROMPT, {
|
92 |
"name": self.memory.load_variable("name"),
|
93 |
"choices": choices,
|
94 |
"tonight_killed": tonight_killed,
|
95 |
-
"
|
96 |
-
"has_antidote": has_antidote,
|
97 |
"history": "\n".join(self.memory.load_history())
|
98 |
})
|
99 |
|
|
|
83 |
elif req.status == STATUS_SKILL:
|
84 |
has_poison = self.memory.load_variable("has_poison")
|
85 |
has_antidote = self.memory.load_variable("has_antidote")
|
86 |
+
tonight_killed = req.message
|
87 |
|
88 |
choices = [name for name in req.message.split(",") if name != self.memory.load_variable("name")] # 排除自己
|
89 |
self.memory.set_variable("choices", choices)
|
90 |
+
|
91 |
+
skill_info = "女巫有{}瓶毒药和{}瓶解药".format("有" if has_poison else "没有", "有" if has_antidote else "没有")
|
92 |
prompt = format_prompt(SKILL_PROMPT, {
|
93 |
"name": self.memory.load_variable("name"),
|
94 |
"choices": choices,
|
95 |
"tonight_killed": tonight_killed,
|
96 |
+
"skill_info": skill_info,
|
|
|
97 |
"history": "\n".join(self.memory.load_history())
|
98 |
})
|
99 |
|