
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@gensx/vercel-ai
Advanced tools
Vercel AI SDK for GenSX
npm install @gensx/vercel-ai
@gensx/core
This 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.
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
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.