Reduce schema boilerplate

Idea: we often require input schema to be an object, like for tools and prompts. Ex:

ai.defineTool({
  inputSchema: z.object({
    foo: z.string()
  }) 
})


what if we drop z.object part and handle it internally....

ai.defineTool({
  inputSchema: {
    foo: z.string()
  }
})
Was this page helpful?