fix:优化表达方式提取

This commit is contained in:
SengokuCola
2025-08-11 20:41:25 +08:00
parent bad2be2bdc
commit 849928a8f3
2 changed files with 7 additions and 8 deletions

View File

@@ -38,10 +38,9 @@ def init_prompt() -> None:
请从上面这段群聊中概括除了人名为"SELF"之外的人的语言风格 请从上面这段群聊中概括除了人名为"SELF"之外的人的语言风格
1. 只考虑文字,不要考虑表情包和图片 1. 只考虑文字,不要考虑表情包和图片
2. 不要涉及具体的人名,只考虑语言风格 2. 不要涉及具体的人名,只考虑语言风格,特殊的梗,不要总结自己
3. 语言风格包含特殊内容和情感 3. 思考有没有特殊的梗,一并总结成语言风格
4. 思考有没有特殊的梗,一并总结成语言风格 4. 例子仅供参考,请严格根据群聊内容总结!!!
5. 例子仅供参考,请严格根据群聊内容总结!!!
注意:总结成如下格式的规律,总结的内容要详细,但具有概括性: 注意:总结成如下格式的规律,总结的内容要详细,但具有概括性:
例如:当"AAAAA"时,可以"BBBBB", AAAAA代表某个具体的场景不超过20个字。BBBBB代表对应的语言风格特定句式或表达方式不超过20个字。 例如:当"AAAAA"时,可以"BBBBB", AAAAA代表某个具体的场景不超过20个字。BBBBB代表对应的语言风格特定句式或表达方式不超过20个字。
@@ -51,7 +50,7 @@ def init_prompt() -> None:
"想说明某个具体的事实观点,但懒得明说,或者不便明说,或表达一种默契",使用"懂的都懂" "想说明某个具体的事实观点,但懒得明说,或者不便明说,或表达一种默契",使用"懂的都懂"
"当涉及游戏相关时,表示意外的夸赞,略带戏谑意味"时,使用"这么强!" "当涉及游戏相关时,表示意外的夸赞,略带戏谑意味"时,使用"这么强!"
请注意不要总结你自己SELF的发言 请注意不要总结你自己SELF的发言,尽量保证总结内容的逻辑性
现在请你概括 现在请你概括
""" """
Prompt(learn_style_prompt, "learn_style_prompt") Prompt(learn_style_prompt, "learn_style_prompt")
@@ -153,7 +152,7 @@ class ExpressionLearner:
logger.info(f"为聊天流 {self.chat_name} 触发表达学习") logger.info(f"为聊天流 {self.chat_name} 触发表达学习")
# 学习语言风格 # 学习语言风格
learnt_style = await self.learn_and_store(type="style", num=25) learnt_style = await self.learn_and_store(num=25)
# 更新学习时间 # 更新学习时间
self.last_learning_time = time.time() self.last_learning_time = time.time()

View File

@@ -570,7 +570,7 @@ class DefaultReplyer:
if not has_bot_message: if not has_bot_message:
core_dialogue_prompt = "" core_dialogue_prompt = ""
else: else:
core_dialogue_list = core_dialogue_list[-int(global_config.chat.max_context_size * 2) :] # 限制消息数量 core_dialogue_list = core_dialogue_list[-int(global_config.chat.max_context_size * 0.6) :] # 限制消息数量
core_dialogue_prompt_str = build_readable_messages( core_dialogue_prompt_str = build_readable_messages(
core_dialogue_list, core_dialogue_list,
@@ -696,7 +696,7 @@ class DefaultReplyer:
message_list_before_now_long = get_raw_msg_before_timestamp_with_chat( message_list_before_now_long = get_raw_msg_before_timestamp_with_chat(
chat_id=chat_id, chat_id=chat_id,
timestamp=time.time(), timestamp=time.time(),
limit=global_config.chat.max_context_size * 2, limit=global_config.chat.max_context_size * 1,
) )
message_list_before_short = get_raw_msg_before_timestamp_with_chat( message_list_before_short = get_raw_msg_before_timestamp_with_chat(