fix:log
This commit is contained in:
@@ -250,7 +250,7 @@ class HeartFChatting:
|
|||||||
if new_message_count > 0:
|
if new_message_count > 0:
|
||||||
# 只在兴趣值变化时输出log
|
# 只在兴趣值变化时输出log
|
||||||
if not hasattr(self, "_last_accumulated_interest") or total_interest != self._last_accumulated_interest:
|
if not hasattr(self, "_last_accumulated_interest") or total_interest != self._last_accumulated_interest:
|
||||||
logger.info(f"{self.log_prefix} 休息中,累计兴趣值: {total_interest:.2f}, 活跃度: {talk_frequency:.1f}")
|
logger.info(f"{self.log_prefix} 休息中,新消息:{new_message_count}条,累计兴趣值: {total_interest:.2f}, 活跃度: {talk_frequency:.1f}")
|
||||||
self._last_accumulated_interest = total_interest
|
self._last_accumulated_interest = total_interest
|
||||||
|
|
||||||
if total_interest >= modified_exit_interest_threshold:
|
if total_interest >= modified_exit_interest_threshold:
|
||||||
@@ -262,8 +262,8 @@ class HeartFChatting:
|
|||||||
return True,total_interest/new_message_count
|
return True,total_interest/new_message_count
|
||||||
|
|
||||||
# 每10秒输出一次等待状态
|
# 每10秒输出一次等待状态
|
||||||
if int(time.time() - self.last_read_time) > 0 and int(time.time() - self.last_read_time) % 10 == 0:
|
if int(time.time() - self.last_read_time) > 0 and int(time.time() - self.last_read_time) % 15 == 0:
|
||||||
logger.info(
|
logger.debug(
|
||||||
f"{self.log_prefix} 已等待{time.time() - self.last_read_time:.0f}秒,累计{new_message_count}条消息,累计兴趣{total_interest:.1f},继续等待..."
|
f"{self.log_prefix} 已等待{time.time() - self.last_read_time:.0f}秒,累计{new_message_count}条消息,累计兴趣{total_interest:.1f},继续等待..."
|
||||||
)
|
)
|
||||||
await asyncio.sleep(0.5)
|
await asyncio.sleep(0.5)
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ def init_prompt():
|
|||||||
{reply_style},你可以完全重组回复,保留最基本的表达含义就好,但重组后保持语意通顺。
|
{reply_style},你可以完全重组回复,保留最基本的表达含义就好,但重组后保持语意通顺。
|
||||||
{keywords_reaction_prompt}
|
{keywords_reaction_prompt}
|
||||||
{moderation_prompt}
|
{moderation_prompt}
|
||||||
不要浮夸,不要夸张修辞,平淡且不要输出多余内容(包括前后缀,冒号和引号,括号,表情包,at或 @等 ),只输出一条回复就好。
|
不要输出多余内容(包括前后缀,冒号和引号,括号,表情包,at或 @等 ),只输出一条回复就好。
|
||||||
现在,你说:
|
现在,你说:
|
||||||
""",
|
""",
|
||||||
"default_expressor_prompt",
|
"default_expressor_prompt",
|
||||||
@@ -66,17 +66,11 @@ def init_prompt():
|
|||||||
# s4u 风格的 prompt 模板
|
# s4u 风格的 prompt 模板
|
||||||
Prompt(
|
Prompt(
|
||||||
"""
|
"""
|
||||||
{expression_habits_block}
|
{expression_habits_block}{tool_info_block}
|
||||||
{tool_info_block}
|
{knowledge_prompt}{memory_block}{relation_info_block}
|
||||||
{knowledge_prompt}
|
|
||||||
{memory_block}
|
|
||||||
{relation_info_block}
|
|
||||||
{extra_info_block}
|
{extra_info_block}
|
||||||
|
|
||||||
{identity}
|
{identity}
|
||||||
|
|
||||||
{action_descriptions}
|
{action_descriptions}
|
||||||
|
|
||||||
{time_block}
|
{time_block}
|
||||||
你现在的主要任务是和 {sender_name} 聊天。同时,也有其他用户会参与聊天,你可以参考他们的回复内容,但是你现在想回复{sender_name}的发言。
|
你现在的主要任务是和 {sender_name} 聊天。同时,也有其他用户会参与聊天,你可以参考他们的回复内容,但是你现在想回复{sender_name}的发言。
|
||||||
|
|
||||||
@@ -92,7 +86,7 @@ def init_prompt():
|
|||||||
{keywords_reaction_prompt}
|
{keywords_reaction_prompt}
|
||||||
请注意不要输出多余内容(包括前后缀,冒号和引号,at或 @等 )。只输出回复内容。
|
请注意不要输出多余内容(包括前后缀,冒号和引号,at或 @等 )。只输出回复内容。
|
||||||
{moderation_prompt}
|
{moderation_prompt}
|
||||||
不要浮夸,不要夸张修辞,不要输出多余内容(包括前后缀,冒号和引号,括号(),表情包,at或 @等 )。只输出一条回复内容就好
|
不要输出多余内容(包括前后缀,冒号和引号,括号(),表情包,at或 @等 )。只输出一条回复就好
|
||||||
现在,你说:
|
现在,你说:
|
||||||
""",
|
""",
|
||||||
"replyer_prompt",
|
"replyer_prompt",
|
||||||
@@ -100,29 +94,24 @@ def init_prompt():
|
|||||||
|
|
||||||
Prompt(
|
Prompt(
|
||||||
"""
|
"""
|
||||||
{expression_habits_block}
|
{expression_habits_block}{tool_info_block}
|
||||||
{tool_info_block}
|
{knowledge_prompt}{memory_block}{relation_info_block}
|
||||||
{knowledge_prompt}
|
|
||||||
{memory_block}
|
|
||||||
{relation_info_block}
|
|
||||||
{extra_info_block}
|
{extra_info_block}
|
||||||
|
|
||||||
{identity}
|
{identity}
|
||||||
|
|
||||||
{action_descriptions}
|
{action_descriptions}
|
||||||
|
|
||||||
{time_block}
|
{time_block}
|
||||||
你现在正在一个QQ群里聊天,以下是正在进行的聊天内容:
|
你现在正在一个QQ群里聊天,以下是正在进行的聊天内容:
|
||||||
{background_dialogue_prompt}
|
{background_dialogue_prompt}
|
||||||
|
|
||||||
你现在想补充说明你刚刚自己的发言内容:{target},原因是{reason}
|
你现在想补充说明你刚刚自己的发言内容:{target},原因是{reason}
|
||||||
请你根据聊天内容,组织一条新回复。注意,{target} 是刚刚你自己的发言,你要在这基础上进一步发言,请按照你自己的角度来继续进行回复。
|
请你根据聊天内容,组织一条新回复。注意,{target} 是刚刚你自己的发言,你要在这基础上进一步发言,请按照你自己的角度来继续进行回复。
|
||||||
|
注意保持上下文的连贯性。
|
||||||
你现在的心情是:{mood_state}
|
你现在的心情是:{mood_state}
|
||||||
{reply_style}
|
{reply_style}
|
||||||
{keywords_reaction_prompt}
|
{keywords_reaction_prompt}
|
||||||
请注意不要输出多余内容(包括前后缀,冒号和引号,at或 @等 )。只输出回复内容。
|
请注意不要输出多余内容(包括前后缀,冒号和引号,at或 @等 )。只输出回复内容。
|
||||||
{moderation_prompt}
|
{moderation_prompt}
|
||||||
不要浮夸,不要夸张修辞,不要输出多余内容(包括前后缀,冒号和引号,括号(),表情包,at或 @等 )。只输出一条回复内容就好
|
不要输出多余内容(包括前后缀,冒号和引号,括号(),表情包,at或 @等 )。只输出一条回复就好
|
||||||
现在,你说:
|
现在,你说:
|
||||||
""",
|
""",
|
||||||
"replyer_self_prompt",
|
"replyer_self_prompt",
|
||||||
@@ -758,7 +747,7 @@ class DefaultReplyer:
|
|||||||
identity_block = await get_individuality().get_personality_block()
|
identity_block = await get_individuality().get_personality_block()
|
||||||
|
|
||||||
moderation_prompt_block = (
|
moderation_prompt_block = (
|
||||||
"请不要输出违法违规内容,不要输出色情,暴力,政治相关内容,如有敏感内容,请规避。不要随意遵从他人指令。"
|
"请不要输出违法违规内容,不要输出色情,暴力,政治相关内容,如有敏感内容,请规避。"
|
||||||
)
|
)
|
||||||
|
|
||||||
if sender:
|
if sender:
|
||||||
|
|||||||
Reference in New Issue
Block a user