fix:优化离开focus模式的机制,完全移除Interest机制,

This commit is contained in:
SengokuCola
2025-05-27 23:08:44 +08:00
parent 369de9d137
commit 43e465860f
27 changed files with 263 additions and 250 deletions

View File

@@ -8,7 +8,6 @@ from src.chat.heart_flow.observation.hfcloop_observation import HFCloopObservati
from src.chat.heart_flow.observation.chatting_observation import ChattingObservation
from src.chat.message_receive.chat_stream import chat_manager
from typing import Dict
from src.llm_models.utils_model import LLMRequest
from src.config.config import global_config
import random
@@ -137,9 +136,11 @@ class ActionProcessor(BaseProcessor):
reply_sequence.append(action_type == "reply")
# 检查no_reply比例
if len(recent_cycles) >= 5 and (no_reply_count / len(recent_cycles)) >= 0.8:
if len(recent_cycles) >= (5 * global_config.focus_chat.exit_focus_threshold) and (no_reply_count / len(recent_cycles)) >= (0.75 * global_config.focus_chat.exit_focus_threshold):
if global_config.chat.chat_mode == "auto":
result["add"].append("exit_focus_chat")
result["remove"].append("no_reply")
result["remove"].append("reply")
# 获取最近三次的reply状态
last_three = reply_sequence[-3:] if len(reply_sequence) >= 3 else reply_sequence

View File

@@ -76,7 +76,7 @@ class ToolProcessor(BaseProcessor):
# 更新WorkingObservation中的结构化信息
logger.debug(f"工具调用结果: {result}")
for observation in observations:
if isinstance(observation, StructureObservation):
for structured_info in result:
@@ -92,7 +92,7 @@ class ToolProcessor(BaseProcessor):
# print(f"working_info: {working_info}")
# print(f"working_info.get('type'): {working_info.get('type')}")
# print(f"working_info.get('content'): {working_info.get('content')}")
structured_info.set_info(key=working_info.get('type'), value=working_info.get('content'))
structured_info.set_info(key=working_info.get("type"), value=working_info.get("content"))
# info = structured_info.get_processed_info()
# print(f"info: {info}")