Scaffold web app
This commit is contained in:
22
src/lib/tools/createTodo.ts
Normal file
22
src/lib/tools/createTodo.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { createTool } from '@rubriclab/agents'
|
||||
import z from 'zod/v4'
|
||||
import db from '~/db'
|
||||
|
||||
export default createTool({
|
||||
async execute({ status, title }) {
|
||||
await db.task.create({
|
||||
data: {
|
||||
status,
|
||||
title
|
||||
}
|
||||
})
|
||||
return undefined
|
||||
},
|
||||
schema: {
|
||||
input: z.object({
|
||||
status: z.boolean(),
|
||||
title: z.string()
|
||||
}),
|
||||
output: z.undefined()
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user