🤖 自动格式化代码 [skip ci]
This commit is contained in:
@@ -343,10 +343,15 @@ class Heartflow:
|
||||
|
||||
for sub_hf in subflows_snapshot:
|
||||
# Double-check if subflow still exists and is in CHAT state
|
||||
if sub_hf.subheartflow_id in self._subheartflows and sub_hf.chat_state.chat_status == ChatState.CHAT:
|
||||
if (
|
||||
sub_hf.subheartflow_id in self._subheartflows
|
||||
and sub_hf.chat_state.chat_status == ChatState.CHAT
|
||||
):
|
||||
evaluated_count += 1
|
||||
if await sub_hf.should_evaluate_reply():
|
||||
stream_name = chat_manager.get_stream_name(sub_hf.subheartflow_id) or sub_hf.subheartflow_id
|
||||
stream_name = (
|
||||
chat_manager.get_stream_name(sub_hf.subheartflow_id) or sub_hf.subheartflow_id
|
||||
)
|
||||
log_prefix = f"[{stream_name}]"
|
||||
logger.info(f"{log_prefix} 兴趣概率触发,尝试将状态从 CHAT 提升到 FOCUSED")
|
||||
# set_chat_state handles limit checks and HeartFChatting creation internally
|
||||
|
||||
@@ -476,7 +476,6 @@ class PromptBuilder:
|
||||
return related_info
|
||||
|
||||
async def get_prompt_info(self, message: str, threshold: float):
|
||||
|
||||
related_info = ""
|
||||
start_time = time.time()
|
||||
|
||||
@@ -486,7 +485,9 @@ class PromptBuilder:
|
||||
|
||||
end_time = time.time()
|
||||
if found_knowledge_from_lpmm is not None:
|
||||
logger.debug(f"从LPMM知识库获取知识,相关信息:{found_knowledge_from_lpmm[:100]}...,信息长度: {len(found_knowledge_from_lpmm)}")
|
||||
logger.debug(
|
||||
f"从LPMM知识库获取知识,相关信息:{found_knowledge_from_lpmm[:100]}...,信息长度: {len(found_knowledge_from_lpmm)}"
|
||||
)
|
||||
related_info += found_knowledge_from_lpmm
|
||||
logger.debug(f"获取知识库内容耗时: {(end_time - start_time):.3f}秒")
|
||||
logger.debug(f"获取知识库内容,相关信息:{related_info[:100]}...,信息长度: {len(related_info)}")
|
||||
@@ -498,8 +499,6 @@ class PromptBuilder:
|
||||
logger.debug(f"获取知识库内容,相关信息:{related_info[:100]}...,信息长度: {len(related_info)}")
|
||||
return related_info
|
||||
|
||||
|
||||
|
||||
@staticmethod
|
||||
def get_info_from_db(
|
||||
query_embedding: list, limit: int = 1, threshold: float = 0.5, return_raw: bool = False
|
||||
|
||||
Reference in New Issue
Block a user