diff --git a/src/heart_flow/observation.py b/src/heart_flow/observation.py index 9bd06c5f0..fb84ea5c4 100644 --- a/src/heart_flow/observation.py +++ b/src/heart_flow/observation.py @@ -51,8 +51,10 @@ class ChattingObservation(Observation): # 将新消息转换为字符串格式 new_messages_str = "" for msg in new_messages: - if "sender_name" in msg and "content" in msg: - new_messages_str += f"{msg['sender_name']}: {msg['content']}\n" + if "detailed_plain_text" in msg: + new_messages_str += f"{msg['detailed_plain_text']}\n" + + print(f"new_messages_str:{new_messages_str}") # 将新消息添加到talking_message,同时保持列表长度不超过20条 self.talking_message.extend(new_messages) @@ -90,8 +92,8 @@ class ChattingObservation(Observation): # 将新消息转换为字符串格式 new_messages_str = "" for msg in new_messages: - if "sender_name" in msg and "content" in msg: - new_messages_str += f"{msg['sender_name']}: {msg['content']}\n" + if "detailed_plain_text" in msg: + new_messages_str += f"{msg['detailed_plain_text']}\n" # 将新消息添加到talking_message,同时保持列表长度不超过30条 self.talking_message.extend(new_messages) @@ -116,6 +118,9 @@ class ChattingObservation(Observation): 以及聊天中的一些重要信息,记得不要分点,不要太长,精简的概括成一段文本\n""" prompt += "总结概括:" self.observe_info, reasoning_content = await self.llm_summary.generate_response_async(prompt) + print(f"prompt:{prompt}") + print(f"self.observe_info:{self.observe_info}") + def translate_message_list_to_str(self): self.talking_message_str = "" diff --git a/src/heart_flow/sub_heartflow.py b/src/heart_flow/sub_heartflow.py index 46dbae932..8989e3b64 100644 --- a/src/heart_flow/sub_heartflow.py +++ b/src/heart_flow/sub_heartflow.py @@ -146,7 +146,7 @@ class SubHeartflow: logger.info(f"麦麦的脑内状态:{self.current_mind}") async def do_after_reply(self, reply_content, chat_talking_prompt): - # print("麦麦脑袋转起来了") + print("麦麦回复之后脑袋转起来了") current_thinking_info = self.current_mind mood_info = self.current_state.mood diff --git a/template/bot_config_template.toml b/template/bot_config_template.toml index 8a84f09b1..d952aaa4f 100644 --- a/template/bot_config_template.toml +++ b/template/bot_config_template.toml @@ -66,7 +66,7 @@ heart_flow_update_interval = 300 # 心流更新频率,间隔 单位秒 max_context_size = 15 # 麦麦获得的上文数量,建议15,太短太长都会导致脑袋尖尖 emoji_chance = 0.2 # 麦麦使用表情包的概率 thinking_timeout = 120 # 麦麦最长思考时间,超过这个时间的思考会放弃 -max_response_length = 1024 # 麦麦回答的最大token数 +max_response_length = 256 # 麦麦回答的最大token数 ban_words = [ # "403","张三" ]