
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@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.
The npm package @gensx/vercel-ai receives a total of 17 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.