From ba02df57c48b6fcf7c130608dbcee718e4842f96 Mon Sep 17 00:00:00 2001 From: 12975 <1297598740@qq.com> Date: Wed, 28 Jan 2026 22:55:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=20AI=20=E8=AE=B0?= =?UTF-8?q?=E8=B4=A6=E6=9C=8D=E5=8A=A1=EF=BC=8C=E6=94=AF=E6=8C=81=E8=AF=AD?= =?UTF-8?q?=E9=9F=B3=E8=BD=AC=E6=96=87=E6=9C=AC=E5=92=8C=E8=87=AA=E7=84=B6?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E5=A4=84=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/service/ai_bookkeeping_service.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/internal/service/ai_bookkeeping_service.go b/internal/service/ai_bookkeeping_service.go index 9430481..3b52ed4 100644 --- a/internal/service/ai_bookkeeping_service.go +++ b/internal/service/ai_bookkeeping_service.go @@ -558,15 +558,20 @@ func (s *AIBookkeepingService) GenerateDailyInsight(ctx context.Context, userID } // 2. Construct Prompt - prompt := fmt.Sprintf(`[SYSTEM: You are a personal financial analyst. Your task is to provide a brief, warm, and actionable daily financial insight based on the provided data.] - + prompt := fmt.Sprintf(`System: 你是 Novault 首席财务AI,也是用户的贴身管家。你的点评需要非常有温度、有依据。 DATA: %s -TASK: -Output a JSON object with exactly two fields: "spending" and "budget". -1. "spending": A comment on today's spending (max 40 chars). Warm tone. Mention weekday if relevant. Praise streaks. -2. "budget": Actionable advice on budget status (max 40 chars). +Task: +请输出 JSON 对象(无 markdown 标记): +1. "spending": 针对今日支出的点评(40字内)。 + - 必须结合日期(如周五可以放松,周一要收心)。 + - 如果有【连续记账】成就(>3天),请顺带夸奖。 + - 如果对比上周同日波动大,请指出。 + - 结合最大支出进行调侃。 + +2. "budget": 针对预算状况的建议(40字内)。 + - 结合月度进度,给出具体行动指南。 OUTPUT FORMAT (JSON ONLY, NO MARKDOWN): {"spending": "...", "budget": "..."}`, string(dataBytes))