feat:为no_reply增加正反馈

This commit is contained in:
SengokuCola
2025-06-23 22:43:17 +08:00
parent ab861d4854
commit 44a556c179
4 changed files with 26 additions and 13 deletions

View File

@@ -76,10 +76,14 @@ class ChattingObservation(Observation):
self.last_observe_time = datetime.now().timestamp()
initial_messages = get_raw_msg_before_timestamp_with_chat(self.chat_id, self.last_observe_time, 10)
print(f"initial_messages: {initial_messages}")
initial_messages_short = get_raw_msg_before_timestamp_with_chat(self.chat_id, self.last_observe_time, 5)
self.last_observe_time = initial_messages[-1]["time"] if initial_messages else self.last_observe_time
self.talking_message = initial_messages
self.talking_message_short = initial_messages_short
self.talking_message_str = build_readable_messages(self.talking_message, show_actions=True)
self.talking_message_str_truncate = build_readable_messages(self.talking_message, show_actions=True, truncate=True)
self.talking_message_str_short = build_readable_messages(self.talking_message_short, show_actions=True)
self.talking_message_str_truncate_short = build_readable_messages(self.talking_message_short, show_actions=True, truncate=True)
def to_dict(self) -> dict:
"""将观察对象转换为可序列化的字典"""