
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@gensx/vercel-ai
Advanced tools
Vercel AI SDK for GenSX
npm install @gensx/vercel-ai
@gensx/coreThis package requires @gensx/core to be installed as a peer dependency.
npm install @gensx/core
import * as gensx from "@gensx/core";
import { generateText } from "@gensx/vercel-ai";
import { openai } from "@ai-sdk/openai";
export const BasicChat = gensx.Workflow(
"BasicChat",
async ({ userInput }: { userInput: string }): Promise<string> => {
const result = await generateText({
messages: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: userInput },
],
model: openai("gpt-4.1-mini"),
});
return result.text;
},
);
This package provides utilities to convert GenSX ToolBox definitions to Vercel AI SDK ToolSet format for use with AI models.
import { createToolBox } from "@gensx/core";
import { asToolSet } from "@gensx/vercel-ai";
import { generateText } from "@gensx/vercel-ai";
import { openai } from "@ai-sdk/openai";
import { z } from "zod";
// Define a ToolBox using GenSX's createToolBox
const myToolBox = createToolBox({
weather: {
params: z.object({
location: z.string().describe("The location to get weather for"),
}),
result: z.object({
temperature: z.number(),
condition: z.string(),
}),
},
});
const toolSet = asToolSet(myToolBox);
// Use with Vercel AI SDK
const result = await generateText({
messages: [
{
role: "system",
content: "You are a helpful assistant that can use tools.",
},
{ role: "user", content: "What's the weather like in Seattle?" },
],
model: openai("gpt-4.1-mini"),
tools: toolSet, // Use the converted ToolSet
});
The asToolSet function converts GenSX ToolBox definitions to Vercel AI SDK Tool format, automatically handling the integration with GenSX's executeExternalTool function for proper workflow execution.
This package provides many of the functions available in the Vercel AI SDK.
generateText - Generate text responses from AI modelsstreamText - Stream text responses in real-timegenerateObject - Generate structured JSON objects with schema validationstreamObject - Stream structured JSON objects in real-timeembed - Generate embeddings for textembedMany - Generate embeddings for multiple textsgenerateImage - Generate images from text promptsFAQs
Vercel AI SDK for GenSX.
The npm package @gensx/vercel-ai receives a total of 16 weekly downloads. As such, @gensx/vercel-ai popularity was classified as not popular.
We found that @gensx/vercel-ai demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.