This commit is contained in:
春河晴
2025-06-10 16:13:31 +09:00
parent 440e8bf7f3
commit 8d9a88a903
70 changed files with 1598 additions and 1642 deletions

View File

@@ -62,13 +62,12 @@ class ChattingObservation(Observation):
self.oldest_messages = []
self.oldest_messages_str = ""
self.compressor_prompt = ""
initial_messages = get_raw_msg_before_timestamp_with_chat(self.chat_id, self.last_observe_time, 10)
self.last_observe_time = initial_messages[-1]["time"] if initial_messages else self.last_observe_time
self.talking_message = initial_messages
self.talking_message_str = build_readable_messages(self.talking_message, show_actions=True)
def to_dict(self) -> dict:
"""将观察对象转换为可序列化的字典"""
return {
@@ -283,7 +282,7 @@ class ChattingObservation(Observation):
show_actions=True,
)
# print(f"构建中self.talking_message_str_truncate: {self.talking_message_str_truncate}")
self.person_list = await get_person_id_list(self.talking_message)
# print(f"构建中self.person_list: {self.person_list}")

View File

@@ -42,9 +42,7 @@ class SubHeartflow:
self.history_chat_state: List[Tuple[ChatState, float]] = []
self.is_group_chat, self.chat_target_info = get_chat_type_and_target_info(self.chat_id)
self.log_prefix = (
chat_manager.get_stream_name(self.subheartflow_id) or self.subheartflow_id
)
self.log_prefix = chat_manager.get_stream_name(self.subheartflow_id) or self.subheartflow_id
# 兴趣消息集合
self.interest_dict: Dict[str, tuple[MessageRecv, float, bool]] = {}
@@ -199,7 +197,6 @@ class SubHeartflow:
# 如果实例不存在,则创建并启动
logger.info(f"{log_prefix} 麦麦准备开始专注聊天...")
try:
self.heart_fc_instance = HeartFChatting(
chat_id=self.subheartflow_id,
# observations=self.observations,

View File

@@ -23,7 +23,7 @@ def get_chat_type_and_target_info(chat_id: str) -> Tuple[bool, Optional[Dict]]:
chat_target_info = None
try:
chat_stream = chat_manager.get_stream(chat_id)
chat_stream = chat_manager.get_stream(chat_id)
if chat_stream:
if chat_stream.group_info: