From 61a809ecd73cb641fd24f3db84a352c52d6d9ae5 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Wed, 11 Mar 2026 02:51:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=88=B0=E7=B3=BB=E7=BB=9F=E5=8A=A9=E6=89=8B?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E4=B8=AD=EF=BC=9B=E4=BF=AE=E6=94=B9=E7=94=9F?= =?UTF-8?q?=E6=95=88=E6=97=A5=E6=9C=9F=E6=8F=8F=E8=BF=B0=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/flowme-life/chat.ts | 4 +++- src/routes/flowme-life/list.ts | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/routes/flowme-life/chat.ts b/src/routes/flowme-life/chat.ts index a225ece..b2f989c 100644 --- a/src/routes/flowme-life/chat.ts +++ b/src/routes/flowme-life/chat.ts @@ -2,6 +2,7 @@ import { schema, app, cnb, models } from '@/app.ts' import z from 'zod'; import { runAgent } from '@kevisual/ai/agent' +import dayjs from 'dayjs'; app.route({ path: 'flowme-life', @@ -22,10 +23,11 @@ app.route({ ctx.throw(400, '缺少参数 question 或 messages'); } const routes = ctx.app.getList().filter(r => r.path.startsWith('flowme-life') && r.key !== 'chat'); + const currentTime = dayjs().toISOString(); const messages = _messages || [ { "role": "system" as const, - "content": `你是我的智能助手,协助我操作我的数据, 请根据我的提问选择合适的接口进行调用。` + "content": `你是我的智能助手,协助我操作我的数据, 请根据我的提问选择合适的接口进行调用。当前时间是 ${currentTime}。` }, { "role": "user" as const, diff --git a/src/routes/flowme-life/list.ts b/src/routes/flowme-life/list.ts index 5e476f3..c6f8f02 100644 --- a/src/routes/flowme-life/list.ts +++ b/src/routes/flowme-life/list.ts @@ -72,7 +72,7 @@ app.route({ tags: z.array(z.string()).describe('标签').optional(), link: z.string().describe('链接').optional(), data: z.record(z.string(), z.any()).describe('数据').optional(), - effectiveAt: z.string().describe('生效日期').optional(), + effectiveAt: z.string().describe('生效日期, 格式为 YYYY-MM-DD HH:mm:ss').optional(), type: z.string().describe('类型: 智能, 每年农历, 备忘, 归档等.默认智能').optional(), prompt: z.string().describe('提示词').optional(), taskType: z.string().describe('任务类型').optional(), @@ -86,7 +86,7 @@ app.route({ if (rest.effectiveAt && isNaN(Date.parse(rest.effectiveAt))) { rest.effectiveAt = null; } else if (rest.effectiveAt) { - rest.effectiveAt = dayjs(rest.effectiveAt).toISOString(); + rest.effectiveAt = dayjs(rest.effectiveAt) } const lifeItem = await db.insert(schema.life).values({ title: rest.title || '', @@ -144,7 +144,7 @@ app.route({ if (rest.effectiveAt && isNaN(Date.parse(rest.effectiveAt))) { rest.effectiveAt = null; } else if (rest.effectiveAt) { - rest.effectiveAt = dayjs(rest.effectiveAt).toISOString(); + rest.effectiveAt = dayjs(rest.effectiveAt) } const lifeItem = await db.update(schema.life).set({ title: rest.title,