Coder Social home page Coder Social logo

spread0x / ai-jsx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fixie-ai/ai-jsx

0.0 1.0 0.0 19.48 MB

The AI Application Framework for Javascript

Home Page: https://docs.ai-jsx.com

License: MIT License

Shell 0.01% JavaScript 13.44% TypeScript 81.67% CSS 3.16% HTML 0.19% Dockerfile 0.01% MDX 1.53%

ai-jsx's Introduction

AI.JSX — The AI Application Framework for Javascript

Docs Site Discord Follow Twitter Follow

About AI.JSX

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.

Features

AI.JSX comes with the following features out-of-the-box:

  • Componetized → LLM prompt engineering through modular, reusable components.
  • Model Support → Use OpenAI, Anthropic, Llama2, or BYOM. Seamlessly switch between model providers and LLM config (e.g. temperature).
  • Complete AI Toolbox → Built-in support for Tools, Document Question and Answering, and more.
  • Generative UI → Seamlessly interweave LLM calls with standard UI components. LLM can dynamically render UI from a set of components you provide.
  • Streaming → Built-in streaming support.
  • Modern Web Stack Support → First-class support for NextJS and Create React App. (more coming soon)
  • LangChain Integration → Full support for LangChainJS.

Learning AI.JSX

To get started with AI.JSX, follow these steps:

  1. Check out the Getting Started Guide.
  2. Run through the AI.JSX Tutorial.
  3. Say "Hello AI World" by cloning the ai-jsx-template.
  4. Discover many more use cases in the examples package.
  5. If you're new to AI, read the Guide for AI Newcomers.

Examples

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.

Check-out the 2 minute intro video.

Contributing

We welcome contributions! See the Contribution Guide for details on how to get started.

License

AI.JSX is open-source software and released under the MIT license.

ai-jsx's People

Contributors

benlower avatar farzadab avatar felixonmars avatar hessamb avatar jonathanplasse avatar juberti avatar larryatfixie avatar mdepinet avatar mdwelsh avatar nickheiner avatar petersalas avatar zkoch avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.