From 36e937a57aada5f6bb7c4fe797a6774006fe715d Mon Sep 17 00:00:00 2001 From: minecraft1024a Date: Wed, 13 Aug 2025 21:19:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4=E6=88=B3?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=A8=A1=E5=BC=8F=EF=BC=8C=E5=9C=A8=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E5=9B=9E=E5=A4=8D=E5=92=8C=E8=A7=84=E5=88=92=E5=99=A8?= =?UTF-8?q?=E8=A7=84=E5=88=92=E6=97=B6=EF=BC=9A=E6=B6=88=E6=81=AF=E5=B0=86?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=AE=8C=E6=95=B4=E6=97=A5=E6=9C=9F=20(?= =?UTF-8?q?=E5=A6=82:=202024-01-15=2014:30:22)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chat/planner_actions/planner.py | 3 +-- src/chat/replyer/default_generator.py | 6 +++--- src/config/official_configs.py | 8 ++++++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/chat/planner_actions/planner.py b/src/chat/planner_actions/planner.py index d658c15dd..54c16a269 100644 --- a/src/chat/planner_actions/planner.py +++ b/src/chat/planner_actions/planner.py @@ -35,7 +35,6 @@ def init_prompt(): {mood_block} {time_block} {identity_block} -你的核心任务是智能判断消息是否真正需要你的回应,避免强行插话或无意义的参与。只有当消息确实针对你或你能提供有价值的回应时才参与对话。 {custom_prompt_block} {chat_context_description},以下是具体的聊天内容 @@ -273,7 +272,7 @@ class ActionPlanner: chat_content_block, message_id_list = build_readable_messages_with_id( messages=message_list_before_now, - timestamp_mode="normal_no_YMD", + timestamp_mode="normal", read_mark=self.last_obs_time_mark, truncate=True, show_actions=True, diff --git a/src/chat/replyer/default_generator.py b/src/chat/replyer/default_generator.py index b7c2bf344..cf0c0a1d3 100644 --- a/src/chat/replyer/default_generator.py +++ b/src/chat/replyer/default_generator.py @@ -656,7 +656,7 @@ class DefaultReplyer: background_dialogue_prompt_str = build_readable_messages( latest_25_msgs, replace_bot_name=True, - timestamp_mode="normal_no_YMD", + timestamp_mode="normal", truncate=True, ) background_dialogue_prompt = f"这是其他用户的发言:\n{background_dialogue_prompt_str}" @@ -670,7 +670,7 @@ class DefaultReplyer: core_dialogue_list, replace_bot_name=True, merge_messages=False, - timestamp_mode="normal_no_YMD", + timestamp_mode="normal", read_mark=0.0, truncate=True, show_actions=True, @@ -953,7 +953,7 @@ class DefaultReplyer: unified_message_list, replace_bot_name=True, merge_messages=False, - timestamp_mode="normal_no_YMD", + timestamp_mode="normal", read_mark=0.0, truncate=True, show_actions=True, diff --git a/src/config/official_configs.py b/src/config/official_configs.py index 9ebbc0a74..148d8ed8c 100644 --- a/src/config/official_configs.py +++ b/src/config/official_configs.py @@ -190,6 +190,14 @@ class ChatConfig(ConfigBase): planner_custom_prompt_content: str = "" """决策器自定义提示词内容,仅在planner_custom_prompt_enable为True时生效""" + + timestamp_display_mode: Literal["normal", "normal_no_YMD", "relative"] = "normal_no_YMD" + """ + 消息时间戳显示模式: + - normal: 完整日期时间格式 (YYYY-MM-DD HH:MM:SS) + - normal_no_YMD: 仅显示时间 (HH:MM:SS) + - relative: 相对时间格式 (几分钟前/几小时前等) + """ def get_current_talk_frequency(self, chat_stream_id: Optional[str] = None) -> float: """