fix:非提及不回复
This commit is contained in:
@@ -518,8 +518,9 @@ class HeartFChatting:
|
|||||||
)
|
)
|
||||||
reply_result = None
|
reply_result = None
|
||||||
|
|
||||||
# 过滤掉planner返回的reply动作(如果存在)
|
# 只在提及情况下过滤掉planner返回的reply动作(提及时已有独立回复生成)
|
||||||
action_to_use_info = [action for action in action_to_use_info if action.action_type != "reply"]
|
if force_reply_message:
|
||||||
|
action_to_use_info = [action for action in action_to_use_info if action.action_type != "reply"]
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
f"{self.log_prefix} 决定执行{len(action_to_use_info)}个动作: {' '.join([a.action_type for a in action_to_use_info])}"
|
f"{self.log_prefix} 决定执行{len(action_to_use_info)}个动作: {' '.join([a.action_type for a in action_to_use_info])}"
|
||||||
|
|||||||
@@ -37,41 +37,54 @@ def init_prompt():
|
|||||||
"""
|
"""
|
||||||
{time_block}
|
{time_block}
|
||||||
{name_block}
|
{name_block}
|
||||||
兴趣:{interest}。{chat_context_description}
|
你的兴趣是:{interest}
|
||||||
|
{chat_context_description},以下是具体的聊天内容
|
||||||
**聊天内容**
|
**聊天内容**
|
||||||
{chat_content_block}
|
{chat_content_block}
|
||||||
|
|
||||||
**可用动作**
|
**可选的action**
|
||||||
reply - 回复消息(可回复被呼叫但未回应的消息,或自然延续话题。不回复自己的消息和纯表情包)
|
reply
|
||||||
{{
|
动作描述:
|
||||||
"action": "reply",
|
1.你可以选择呼叫了你的名字,但是你没有做出回应的消息进行回复
|
||||||
"target_message_id":"消息id(m+数字)",
|
2.你可以自然的顺着正在进行的聊天内容进行回复或自然的提出一个问题
|
||||||
"reason":"原因"
|
3.不要回复你自己发送的消息
|
||||||
}}
|
4.不要单独对表情包进行回复
|
||||||
|
{{"action":"reply", "target_message_id":"消息id(m+数字)", "reason":"原因"}}
|
||||||
|
|
||||||
no_reply - 保持沉默,控制发言频率
|
no_reply
|
||||||
{{
|
动作描述:
|
||||||
"action": "no_reply"
|
保持沉默,不回复直到有新消息
|
||||||
}}
|
控制聊天频率,不要太过频繁的发言
|
||||||
|
{{"action":"no_reply"}}
|
||||||
|
|
||||||
no_reply_until_call - 保持沉默直到被直接呼叫(话题不相关或频繁no_reply时使用)
|
no_reply_until_call
|
||||||
{{
|
动作描述:
|
||||||
"action": "no_reply_until_call"
|
保持沉默,直到有人直接叫你的名字
|
||||||
}}
|
当前话题不感兴趣时使用,或有人不喜欢你的发言时使用
|
||||||
|
当你频繁选择no_reply时使用,表示话题暂时与你无关
|
||||||
|
{{"action":"no_reply_until_call"}}
|
||||||
|
|
||||||
{action_options_text}
|
{action_options_text}
|
||||||
|
|
||||||
**历史记录**
|
**你之前的action执行和思考记录**
|
||||||
{actions_before_now_block}
|
{actions_before_now_block}
|
||||||
|
|
||||||
**要求**
|
请选择**可选的**且符合使用条件的action,并说明触发action的消息id(消息id格式:m+数字)
|
||||||
|
不要回复你自己发送的消息
|
||||||
|
先输出你的选择思考理由,再输出你选择的action,理由是一段平文本,不要分点,精简。
|
||||||
|
**动作选择要求**
|
||||||
|
请你根据聊天内容,用户的最新消息和以下标准选择合适的动作:
|
||||||
{plan_style}
|
{plan_style}
|
||||||
{moderation_prompt}
|
{moderation_prompt}
|
||||||
|
|
||||||
先输出思考理由(平文本,精简),再输出JSON格式的动作。消息id格式:m+数字。可输出多个动作:
|
请选择所有符合使用要求的action,动作用json格式输出,如果输出多个json,每个json都要单独用```json包裹,你可以重复使用同一个动作或不同动作:
|
||||||
|
**示例**
|
||||||
|
// 理由文本
|
||||||
```json
|
```json
|
||||||
{{"action":"动作名", "target_message_id":"m123", "reason":"原因"}}
|
{{"action":"动作名", "target_message_id":"m123", "reason":"原因"}}
|
||||||
|
```
|
||||||
|
```json
|
||||||
|
{{"action":"动作名", "target_message_id":"m456", "reason":"原因"}}
|
||||||
```""",
|
```""",
|
||||||
"planner_prompt",
|
"planner_prompt",
|
||||||
)
|
)
|
||||||
@@ -82,11 +95,7 @@ no_reply_until_call - 保持沉默直到被直接呼叫(话题不相关或频
|
|||||||
动作描述:{action_description}
|
动作描述:{action_description}
|
||||||
使用条件{parallel_text}:
|
使用条件{parallel_text}:
|
||||||
{action_require}
|
{action_require}
|
||||||
{{
|
{{"action":"{action_name}",{action_parameters}, "target_message_id":"消息id(m+数字)", "reason":"原因"}}
|
||||||
"action": "{action_name}",{action_parameters},
|
|
||||||
"target_message_id":"触发action的消息id",
|
|
||||||
"reason":"触发action的原因"
|
|
||||||
}}
|
|
||||||
""",
|
""",
|
||||||
"action_prompt",
|
"action_prompt",
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user