From 1335896c2c80dbb8bf0398ad570d16ec84b0c65b Mon Sep 17 00:00:00 2001 From: ATRI Date: Thu, 9 Jul 2026 09:10:54 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E6=96=B0=E5=A2=9EAI=E5=88=86?= =?UTF-8?q?=E6=9E=90=EF=BC=9A=E5=8F=91=E9=80=81=E5=9B=BE=E8=A1=A8=E5=90=8E?= =?UTF-8?q?=E7=94=A8AstrBot=20LLM=E6=8E=A5=E5=8F=A3=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=88=86=E6=9E=90=E6=96=87=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skills/atri_cf_query_plugin.py | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/ATRI My Dear Moments/skills/atri_cf_query_plugin.py b/ATRI My Dear Moments/skills/atri_cf_query_plugin.py index 49a7260..78c0ecf 100644 --- a/ATRI My Dear Moments/skills/atri_cf_query_plugin.py +++ b/ATRI My Dear Moments/skills/atri_cf_query_plugin.py @@ -406,13 +406,28 @@ class CFQueryPlugin(Star): style = self.config.get("default_chart_style", "combined") if charts: + # 先发图表 if style == "combined" and len(charts) >= 2: combined = str(self.temp_dir / f"cf_combined_{handle}_{ts}.png") if _combine_charts(charts, combined): yield event.image_result(combined) - return - for c in charts: - yield event.image_result(c) + else: + for c in charts: + yield event.image_result(c) + + # 再用AI生成分析文本 + try: + analysis_prompt = _build_analysis_prompt(handle, user_info, history, analysis) + provider_id = self.context.get_current_chat_provider_id(event.unified_msg_origin) + llm_resp = await self.context.llm_generate( + chat_provider_id=provider_id, + prompt=analysis_prompt, + ) + if llm_resp and llm_resp.completion_text: + yield event.plain_result(llm_resp.completion_text) + except Exception as e: + # AI分析失败不影响主流程 + pass return # 没有图表时才发文本报告