- Add agent-run module to handle AI interactions with tools and messages. - Create routes for proxying requests to OpenAI and Anthropic APIs. - Implement flowme-life chat route for user queries and task management. - Add services for retrieving and updating life records in the database. - Implement logic for fetching today's tasks and marking tasks as done with next execution time calculation. - Introduce tests for flowme-life functionalities.
36 lines
849 B
TypeScript
36 lines
849 B
TypeScript
import { queryLogin, app, token, showMore } from './common.ts'
|
|
|
|
|
|
// const rest = await app.run({
|
|
// path: 'flowme-life',
|
|
// key: 'today',
|
|
// // @ts-ignore
|
|
// token: token,
|
|
// })
|
|
|
|
// console.log('flowme-life today', rest)
|
|
|
|
const updateId = '8c63cb7a-ff6d-463b-b210-6311ee12ed46'
|
|
|
|
// const updateRest = await app.run({
|
|
// path: 'flowme-life',
|
|
// key: 'done',
|
|
// // @ts-ignore
|
|
// token: token,
|
|
// payload: {
|
|
// id: updateId,
|
|
// }
|
|
// })
|
|
// console.log('flowme-life done', updateRest)
|
|
|
|
const chatRes = await app.run({
|
|
path: 'flowme-life',
|
|
key: 'chat',
|
|
// @ts-ignore
|
|
token: token,
|
|
payload: {
|
|
// question: '帮我查询一下今天的待办事项'
|
|
// question: '帮我查询一下今天的待办事项, 然后帮我把键盘充电的待办标记为完成',
|
|
}
|
|
})
|
|
console.log('flowme-life chat', showMore(chatRes)) |