@supawatch/target-ai-tools
v0.14.2
Published
Vercel AI SDK tool definitions generated from live Postgres by supawatch, validated by the generated Zod schemas.
Maintainers
Readme
@supawatch/target-ai-tools
The Vercel AI SDK target for
supawatch. Emits
ai-tools.mjs: tool() definitions per table, list and get, with input
schemas reused from the generated Zod target.
targets: [
{ kind: "zod", strict: true },
{ kind: "ai-tools" },
]npm install ai # peer dependency, v5import { generateText } from "ai";
import postgres from "postgres";
import { createAiTools } from "./src/schemas/ai-tools.mjs";
const sql = postgres(process.env.DATABASE_URL);
const { text } = await generateText({
model,
tools: createAiTools({ sql }),
prompt: "How many open tasks are there?",
});MIT.
