
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/core
Advanced tools
GenSX is a framework for building LLM workflows and AI agents with TypeScript. Every GenSX component is a pure function, and thus easily shareable by default.
pnpm install @gensx/core
yarn add @gensx/core
npm install @gensx/core
import * as gensx from "@gensx/core";
import { openai } from "@ai-sdk/openai";
import { generateText } from "@gensx/vercel-ai";
// input interface
interface WriteDraftInput {
research: string[];
prompt: string;
}
// components are pure functions that are reusable by default
const WriteDraft = gensx.Component(
"WriteDraft",
async ({ prompt, research }: WriteDraftInput) => {
const systemMessage = `You're an expert technical writer.
Use the information when responding to users: ${research.join("\n")}`;
const result = await generateText({
messages: [
{
role: "system",
content: systemMessage,
},
{
role: "user",
content: `Write a blog post about ${prompt}`,
},
],
model: openai("gpt-4.1-mini"),
});
return result.text;
},
);
Components can be composed together to create more complex agents and workflows:
import * as gensx from "@gensx/core";
import { OpenAIProvider } from "gensx/openai";
import { Research, WriteDraft, EditDraft } from "./writeBlog";
interface WriteBlogInput {
title: string;
description: string;
}
const WriteBlog = gensx.Workflow(
"WriteBlog",
async ({ title, description }: WriteBlogInput) => {
const queries = await GenerateQueries({
title,
description,
});
const research = await ResearchBlog({ queries });
const draft = await WriteDraft({ title, context: research });
const final = await EditDraft({ title, content: draft });
return final;
},
);
const result = await WriteBlog({
title: "How AI broke modern infra",
description: "Long-running workflows require a new approach to infra",
});
FAQs
Build AI workflows using JSX.
The npm package @gensx/core receives a total of 157 weekly downloads. As such, @gensx/core popularity was classified as not popular.
We found that @gensx/core 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.