feat: 更新聊天接口,添加当前时间到系统助手消息中;修改生效日期描述格式
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user