This commit is contained in:
2025-12-03 16:41:01 +08:00
parent 3d50fde0eb
commit d49ecc83fa
27 changed files with 7542 additions and 43 deletions

15
backend/test/chat.ts Normal file
View File

@@ -0,0 +1,15 @@
import { app, sleep } from './common';
const res = await app.call({
path: 'noco-life',
key: "chat",
payload: {
// question: '今天我需要做什么事情?',
// question: '任务5 完成了,帮我判断下一次运行时间应该是什么时候?',
// question: '任务59 完成了',
question: '我的多维表格配置'
}
})
console.log('res', res.code, res.body, res.message);

18
backend/test/common.ts Normal file
View File

@@ -0,0 +1,18 @@
import { app } from '../src/index.ts';
export const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
// await sleep(1000); // 等待服务启动
import { useContextKey } from '@kevisual/context';
import { BailianProvider } from '@kevisual/ai';
import dotenv from 'dotenv';
dotenv.config();
console.log('process.env.BAILIAN_API_KEY', process.env.BAILIAN_API_KEY);
const ai = useContextKey('ai', () => {
return new BailianProvider({
apiKey: process.env.BAILIAN_API_KEY || '',
model: 'qwen-turbo'
});
});
export {
app,
ai,
}

13
backend/test/done.ts Normal file
View File

@@ -0,0 +1,13 @@
import { app, sleep } from './common';
const res = await app.call({
path: 'noco-life',
key: "done",
payload: {
id: 59, // 洗漱
// id:4, // 爸爸
}
})
console.log('res', res.code, res.message, res.body);

9
backend/test/today.ts Normal file
View File

@@ -0,0 +1,9 @@
import { app, sleep } from './common';
const res = await app.call({
path: 'noco-life',
key: "today"
})
console.log('res', res.body);