Providers
Vercel AI SDK's generateText
generateText is a plain function, not a method -- wrap it directly, no .bind() needed.
← All recipes
import { Maskea, retries, secrets } from "@nopeatech/maskea";
import { generateText } from "ai";
import { openai } from "@ai-sdk/openai";
const maskea = new Maskea()
.use(retries({ max: 3 }))
.use(secrets({ mode: "mask" }));
const generate = maskea.wrap(generateText);
const { text } = await generate({
model: openai("gpt-4o-mini"),
prompt: "Write a haiku about rate limits.",
});Checked against the shipped @nopeatech/maskea API. Full docs at nopea.tech/maskea/docs.