mirror of https://github.com/Mai-with-u/MaiBot.git
动作更好的选择,现在可以选择多个动作
parent
cb24adb595
commit
460c469dc9
|
|
@ -46,36 +46,34 @@ def init_prompt():
|
|||
**动作记录**
|
||||
{actions_before_now_block}
|
||||
|
||||
**要求**
|
||||
请你根据聊天内容和用户的最新消息选择合适的动作:
|
||||
**可用的action**
|
||||
reply
|
||||
动作描述:
|
||||
1.你可以选择呼叫了你的名字,但是你没有做出回应的消息进行回复
|
||||
2.你可以自然的顺着正在进行的聊天内容进行回复或自然的提出一个问题
|
||||
3.你的兴趣是:{interest}
|
||||
4.如果你刚刚进行了回复,不要对同一个话题重复回应
|
||||
5.请控制你的发言频率,不要太过频繁的发言
|
||||
6.如果有人对你感到厌烦,请减少回复
|
||||
7.如果有人对你进行攻击,或者情绪激动,请你以合适的方法应对
|
||||
{moderation_prompt}
|
||||
|
||||
**可用的action**
|
||||
no_reply:保持沉默,不回复直到有新消息
|
||||
{{
|
||||
"action": "no_reply",
|
||||
}}
|
||||
|
||||
reply:进行回复
|
||||
{{
|
||||
"action": "reply",
|
||||
"target_message_id":"想要回复的消息id",
|
||||
"reason":"回复的原因"
|
||||
}}
|
||||
|
||||
no_reply_until_call:保持沉默,直到有人直接叫的名字
|
||||
no_reply
|
||||
动作描述:
|
||||
保持沉默,不回复直到有新消息
|
||||
{{
|
||||
"action": "no_reply",
|
||||
}}
|
||||
|
||||
no_reply_until_call
|
||||
动作描述:
|
||||
保持沉默,直到有人直接叫你的名字
|
||||
{{
|
||||
"action": "no_reply_until_call",
|
||||
}}
|
||||
|
||||
wait_time:沉默等待时间,等待一段时间后回复
|
||||
wait_time
|
||||
动作描述:
|
||||
沉默等待时间,等待一段时间后回复
|
||||
{{
|
||||
"action": "wait_time",
|
||||
"time":"等待时间",
|
||||
|
|
@ -83,11 +81,18 @@ wait_time:沉默等待时间,等待一段时间后回复
|
|||
|
||||
{action_options_text}
|
||||
|
||||
请选择一个或多个合适的action,并说明触发action的消息id和选择该action的原因。消息id格式:m+数字
|
||||
请选择合适的action,并说明触发action的消息id和选择该action的原因。消息id格式:m+数字
|
||||
先输出你的选择思考理由,再输出你选择的action,理由是一段平文本,不要分点,精简。
|
||||
理由要求:
|
||||
1.思考每个动作是否符合当下条件,如果符合就使用
|
||||
**动作选择要求**
|
||||
请你根据聊天内容和用户的最新消息选择合适的动作:
|
||||
1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用调节符合当下条件就使用
|
||||
2.如果相同的内容已经被执行,请不要重复执行
|
||||
3.你的兴趣是:{interest}
|
||||
4.请控制你的发言频率,不要太过频繁的发言
|
||||
5.如果有人对你感到厌烦,请减少回复
|
||||
6.如果有人对你进行攻击,或者情绪激动,请你以合适的方法应对
|
||||
{moderation_prompt}
|
||||
|
||||
请选择所有符合使用要求的action,动作用json格式输出,如果输出多个json,每个json都要单独用```json包裹,你可以重复使用同一个动作或不同动作:
|
||||
**示例**
|
||||
// 理由文本
|
||||
|
|
@ -114,6 +119,7 @@ wait_time:沉默等待时间,等待一段时间后回复
|
|||
"""
|
||||
{action_name}
|
||||
动作描述:{action_description}
|
||||
使用条件:
|
||||
{action_require}
|
||||
{{
|
||||
"action": "{action_name}",{action_parameters},
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ def init_prompt():
|
|||
{core_dialogue_prompt}
|
||||
|
||||
{expression_habits_block}{tool_info_block}
|
||||
{knowledge_prompt}{memory_block}{relation_info_block}
|
||||
{knowledge_prompt}{relation_info_block}
|
||||
{extra_info_block}
|
||||
|
||||
{reply_target_block}
|
||||
|
|
@ -99,7 +99,7 @@ def init_prompt():
|
|||
{background_dialogue_prompt}
|
||||
|
||||
{expression_habits_block}{tool_info_block}
|
||||
{knowledge_prompt}{memory_block}{relation_info_block}
|
||||
{knowledge_prompt}{relation_info_block}
|
||||
{extra_info_block}
|
||||
|
||||
你现在想补充说明你刚刚自己的发言内容:{target},原因是{reason}
|
||||
|
|
@ -763,7 +763,7 @@ class DefaultReplyer:
|
|||
self.build_expression_habits(chat_talking_prompt_short, target), "expression_habits"
|
||||
),
|
||||
self._time_and_run_task(self.build_relation_info(sender, target), "relation_info"),
|
||||
self._time_and_run_task(self.build_memory_block(message_list_before_short, target), "memory_block"),
|
||||
# self._time_and_run_task(self.build_memory_block(message_list_before_short, target), "memory_block"),
|
||||
self._time_and_run_task(
|
||||
self.build_tool_info(chat_talking_prompt_short, sender, target, enable_tool=enable_tool), "tool_info"
|
||||
),
|
||||
|
|
@ -776,7 +776,7 @@ class DefaultReplyer:
|
|||
task_name_mapping = {
|
||||
"expression_habits": "选取表达方式",
|
||||
"relation_info": "感受关系",
|
||||
"memory_block": "回忆",
|
||||
# "memory_block": "回忆",
|
||||
"tool_info": "使用工具",
|
||||
"prompt_info": "获取知识",
|
||||
"actions_info": "动作信息",
|
||||
|
|
@ -804,7 +804,7 @@ class DefaultReplyer:
|
|||
expression_habits_block: str
|
||||
selected_expressions: List[int]
|
||||
relation_info: str = results_dict["relation_info"]
|
||||
memory_block: str = results_dict["memory_block"]
|
||||
# memory_block: str = results_dict["memory_block"]
|
||||
tool_info: str = results_dict["tool_info"]
|
||||
prompt_info: str = results_dict["prompt_info"] # 直接使用格式化后的结果
|
||||
actions_info: str = results_dict["actions_info"]
|
||||
|
|
@ -843,7 +843,7 @@ class DefaultReplyer:
|
|||
expression_habits_block=expression_habits_block,
|
||||
tool_info_block=tool_info,
|
||||
knowledge_prompt=prompt_info,
|
||||
memory_block=memory_block,
|
||||
# memory_block=memory_block,
|
||||
relation_info_block=relation_info,
|
||||
extra_info_block=extra_info_block,
|
||||
identity=personality_prompt,
|
||||
|
|
@ -863,7 +863,7 @@ class DefaultReplyer:
|
|||
expression_habits_block=expression_habits_block,
|
||||
tool_info_block=tool_info,
|
||||
knowledge_prompt=prompt_info,
|
||||
memory_block=memory_block,
|
||||
# memory_block=memory_block,
|
||||
relation_info_block=relation_info,
|
||||
extra_info_block=extra_info_block,
|
||||
identity=personality_prompt,
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ from src.plugins.built_in.memory.build_memory import BuildMemoryAction
|
|||
logger = get_logger("relation_actions")
|
||||
|
||||
|
||||
@register_plugin
|
||||
# @register_plugin
|
||||
class MemoryBuildPlugin(BasePlugin):
|
||||
"""关系动作插件
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue