AI.JSX is a framework for building AI applications using Javascript and JSX. With AI.JSX, you get great tools for prompt engineering and can have the LLM render React components in its response (instead of only text). This means you can provide a set of React components and let the LLM construct your UI dynamically at runtime. AI.JSX also provides native support for tools, Document Question & Answering, and much more.
AI.JSX can be used to create standalone LLM applications that can be deployed anywhere Node.js is supported, or it can be used as part of a larger React application.
AI.JSX comes with the following features out-of-the-box:
To get started with AI.JSX, follow these steps:
Here is a simple example using AI.JSX to generate an AI response to a prompt:
import * as AI from 'ai-jsx';
import { ChatCompletion, UserMessage } from 'ai-jsx/core/completion';
const app = (
<ChatCompletion>
<UserMessage>Write a Shakespearean sonnet about AI models.</UserMessage>
</ChatCompletion>
);
const renderContext = AI.createRenderContext();
const response = await renderContext.render(app);
console.log(response);
You can play with live demos on our live demo app or view the source code. For a full set of examples, see the examples package.
We welcome contributions! See the Contribution Guide for details on how to get started.
AI.JSX is open-source software and released under the MIT license.