Merge branch 'dev' of https://github.com/MoFox-Studio/MoFox_Bot into dev
This commit is contained in:
@@ -140,8 +140,6 @@ def init_prompt():
|
||||
--------------------------------
|
||||
{time_block}
|
||||
|
||||
{reply_target_block}
|
||||
|
||||
注意不要复读你前面发过的内容,意思相近也不行。
|
||||
|
||||
请注意不要输出多余内容(包括前后缀,冒号和引号,at或 @等 )。只输出回复内容。
|
||||
@@ -833,16 +831,22 @@ class DefaultReplyer:
|
||||
reply_message.get("user_id"), # type: ignore
|
||||
)
|
||||
person_name = await person_info_manager.get_value(person_id, "person_name")
|
||||
sender = person_name
|
||||
|
||||
# 检查是否是bot自己的名字,如果是则替换为"(你)"
|
||||
bot_user_id = str(global_config.bot.qq_account)
|
||||
current_user_id = person_info_manager.get_value_sync(person_id, "user_id")
|
||||
current_platform = reply_message.get("chat_info_platform")
|
||||
|
||||
if current_user_id == bot_user_id and current_platform == global_config.bot.platform:
|
||||
sender = f"{person_name}(你)"
|
||||
else:
|
||||
# 如果不是bot自己,直接使用person_name
|
||||
sender = person_name
|
||||
target = reply_message.get("processed_plain_text")
|
||||
|
||||
person_info_manager = get_person_info_manager()
|
||||
person_id = person_info_manager.get_person_id_by_person_name(sender)
|
||||
user_id = person_info_manager.get_value_sync(person_id, "user_id")
|
||||
platform = chat_stream.platform
|
||||
if user_id == global_config.bot.qq_account and platform == global_config.bot.platform:
|
||||
logger.warning("选取了自身作为回复对象,跳过构建prompt")
|
||||
return ""
|
||||
|
||||
target = replace_user_references_sync(target, chat_stream.platform, replace_bot_name=True)
|
||||
|
||||
@@ -1061,10 +1065,8 @@ class DefaultReplyer:
|
||||
|
||||
**任务**: 请结合你的智慧和人设,自然地决定是否需要分段。如果需要,请在最恰当的位置插入 `[SPLIT]` 标记。
|
||||
"""
|
||||
# 在 "现在,你说:" 之前插入
|
||||
parts = prompt_text.rsplit("现在,你说:", 1)
|
||||
if len(parts) == 2:
|
||||
prompt_text = f"{parts[0]}{split_instruction}\n现在,你说:{parts[1]}"
|
||||
# 将分段指令添加到提示词顶部
|
||||
prompt_text = f"{split_instruction}\n{prompt_text}"
|
||||
|
||||
return prompt_text
|
||||
|
||||
|
||||
Reference in New Issue
Block a user