From 10f56a8bc11220a3d711c7273ba2faa270a7c7ff Mon Sep 17 00:00:00 2001 From: tt-P607 <68868379+tt-P607@users.noreply.github.com> Date: Thu, 23 Oct 2025 20:07:51 +0800 Subject: [PATCH] =?UTF-8?q?chore(log):=20=E8=B0=83=E6=95=B4LLM=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=97=A5=E5=BF=97=E7=BA=A7=E5=88=AB=E4=B8=BADEBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将LLM原始提示词和响应的日志级别从`INFO`调整为`DEBUG`。 此举旨在减少非调试模式下的日志输出,避免过长的模型交互内容刷屏,从而保持日志的整洁性,仅在需要时提供详细的调试信息。 --- src/llm_models/utils_model.py | 1 + src/plugins/built_in/affinity_flow_chatter/plan_filter.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/llm_models/utils_model.py b/src/llm_models/utils_model.py index f60f8c205..49c83c135 100644 --- a/src/llm_models/utils_model.py +++ b/src/llm_models/utils_model.py @@ -961,6 +961,7 @@ class LLMRequest: ) await self._record_usage(model_info, response.usage, time.time() - start_time, "/chat/completions") + logger.debug(f"LLM原始响应: {response.content}") if not response.content and not response.tool_calls: if raise_when_empty: diff --git a/src/plugins/built_in/affinity_flow_chatter/plan_filter.py b/src/plugins/built_in/affinity_flow_chatter/plan_filter.py index 6b97c056b..229860cf1 100644 --- a/src/plugins/built_in/affinity_flow_chatter/plan_filter.py +++ b/src/plugins/built_in/affinity_flow_chatter/plan_filter.py @@ -60,13 +60,13 @@ class ChatterPlanFilter: prompt, used_message_id_list = await self._build_prompt(plan) plan.llm_prompt = prompt if global_config.debug.show_prompt: - logger.info(f"规划器原始提示词:{prompt}") + logger.debug(f"规划器原始提示词:{prompt}") llm_content, _ = await self.planner_llm.generate_response_async(prompt=prompt) if llm_content: if global_config.debug.show_prompt: - logger.info(f"LLM规划器原始响应:{llm_content}") + logger.debug(f"LLM规划器原始响应:{llm_content}") try: parsed_json = orjson.loads(repair_json(llm_content)) except orjson.JSONDecodeError: