refactor: 移除未使用的变量以简化代码逻辑

This commit is contained in:
春河晴
2025-04-17 15:45:39 +09:00
parent b305879541
commit 959401f765
3 changed files with 2 additions and 6 deletions

View File

@@ -119,7 +119,6 @@ class ChatObserver:
self.last_cold_chat_check = current_time
# 判断是否冷场
is_cold = False
if self.last_message_time is None:
is_cold = True
else:

View File

@@ -69,7 +69,6 @@ class ResponseGenerator:
return None
async def _generate_response_with_model(self, message: MessageThinking, model: LLMRequest, thinking_id: str):
sender_name = ""
info_catcher = info_catcher_manager.get_info_catcher(thinking_id)

View File

@@ -101,16 +101,15 @@ class PromptBuilder:
related_memory = await HippocampusManager.get_instance().get_memory_from_text(
text=message_txt, max_memory_num=2, max_memory_length=2, max_depth=3, fast_retrieval=False
)
related_memory_info = ""
if related_memory:
related_memory_info = ""
for memory in related_memory:
related_memory_info += memory[1]
# memory_prompt = f"你想起你之前见过的事情:{related_memory_info}。\n以上是你的回忆不一定是目前聊天里的人说的也不一定是现在发生的事情请记住。\n"
memory_prompt = await global_prompt_manager.format_prompt(
"memory_prompt", related_memory_info=related_memory_info
)
else:
related_memory_info = ""
# print(f"相关记忆:{related_memory_info}")
@@ -162,7 +161,6 @@ class PromptBuilder:
# 知识构建
start_time = time.time()
prompt_info = ""
prompt_info = await self.get_prompt_info(message_txt, threshold=0.38)
if prompt_info:
# prompt_info = f"""\n你有以下这些**知识**\n{prompt_info}\n请你**记住上面的知识**,之后可能会用到。\n"""