feat: 新增 AI 记账服务,支持语音转文本和自然语言处理功能

This commit is contained in:
2026-01-28 22:55:48 +08:00
parent cebce4f758
commit ba02df57c4

View File

@@ -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))