remove:冗余的sbhf代码和focus代码

This commit is contained in:
SengokuCola
2025-07-06 20:14:09 +08:00
parent dc24a76413
commit 1365099fd4
44 changed files with 132 additions and 2210 deletions

View File

@@ -1,7 +1,6 @@
from src.chat.heart_flow.heartflow import heartflow
from src.chat.heart_flow.sub_heartflow import ChatState
from src.common.logger import get_logger
import time
logger = get_logger("api")
@@ -20,39 +19,6 @@ async def forced_change_subheartflow_status(subheartflow_id: str, status: ChatSt
return False
async def get_subheartflow_cycle_info(subheartflow_id: str, history_len: int) -> dict:
"""获取子心流的循环信息"""
subheartflow_cycle_info = await heartflow.api_get_subheartflow_cycle_info(subheartflow_id, history_len)
logger.debug(f"子心流 {subheartflow_id} 循环信息: {subheartflow_cycle_info}")
if subheartflow_cycle_info:
return subheartflow_cycle_info
else:
logger.warning(f"子心流 {subheartflow_id} 循环信息未找到")
return None
async def get_normal_chat_replies(subheartflow_id: str, limit: int = 10) -> list:
"""获取子心流的NormalChat回复记录
Args:
subheartflow_id: 子心流ID
limit: 最大返回数量默认10条
Returns:
list: 回复记录列表,如果未找到则返回空列表
"""
replies = await heartflow.api_get_normal_chat_replies(subheartflow_id, limit)
logger.debug(f"子心流 {subheartflow_id} NormalChat回复记录: 获取到 {len(replies) if replies else 0}")
if replies:
# 格式化时间戳为可读时间
for reply in replies:
if "time" in reply:
reply["formatted_time"] = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(reply["time"]))
return replies
else:
logger.warning(f"子心流 {subheartflow_id} NormalChat回复记录未找到")
return []
async def get_all_states():
"""获取所有状态"""