2.17.1 • Published 4 months ago

@nlux/react v2.17.1

Weekly downloads
-
License
MPL-2.0
Repository
github
Last release
4 months ago

NLUX React 🌲✨💬

Free And Open Source Docs https://docs.nlkit.com/nlux

The Conversational AI UI Library For Any LLM

NLUX (for Natural Language User Experience) is an open-source React and JavaScript library that makes it super simple to integrate powerful large language models (LLMs) like ChatGPT into your web app or website. With just a few lines of code, you can add conversational AI capabilities and interact with your favorite LLM.

Key Features 🌟

  • Build AI Chat Interfaces In Minutes ― High quality conversational AI interfaces with just a few lines of code.
  • React Components & Hooks<AiChat /> for UI and useChatAdapter hook for easy integration.
  • LLM Adapters ― For ChatGPT / LangChain 🦜 LangServe / HuggingFace 🤗 Inference.
  • A flexible interface to Create Your Own Adapter for any LLM or API.
  • Next.js & Vercel AI ― Out-of-the-box support, demos, and examples for Next.js and Vercel AI.
  • React Server Components (RSC) and Generative UI 🔥 ― With Next.js or any RSC compatible framework.
  • Assistant and User Personas ― Customize the assistant and user personas with names, images, and more.
  • Streaming LLM Output ― Stream the chat response to the UI as it's being generated.
  • Customizable Theme - Easily customize the look and feel of the chat interface using CSS variables.
  • Event Listeners - Listen to messages, errors, and other events to customize the UI and behaviour.
  • Zero Dependency ― Lightweight codebase ― Core with zero dependency and no external UI libraries.

200+ Unit Tests

Docs & Examples 📖

Get Started With NLUX React 🚀

The example below demonstrates how to create an AI chat interface using NLUX React and LangChain, the open source framework for building LLM backends. But you can use NLUX with any LLM ― either via the standard adapters provided, or by creating your own adapter.

To get started with NLUX React and LangChain, install the @nlux/react and @nlux/langchain-react packages:

npm install @nlux/react @nlux/langchain-react

Then include <AiChat /> in your React app to get started. Use the useChatAdapter hook to configure an adapter for your LLM.

import {AiChat} from '@nlux/react';
import {useChatAdapter} from '@nlux/langchain-react';

const App = () => {
    const gptAdapter = useChatAdapter({
        url: 'https://<Your LangServe Runnable URL>'
    });

    return (
        <AiChat
            adapter={gptAdapter}
            composerOptions={{
                placeholder: 'How can I help you today?'
            }}
            conversationOptions={{
                historyPayloadSize: 'max'
            }}
        />
    );
}

You should also include the NLUX theme CSS file in your HTML page or import it in your React app.

And The Result Is ✨

An AI chatbot, powered by LangChain, that can understand and respond to user messages:

NLUX AiChat Component

Theme File and CSS 🎨

You should include a theme CSS file into your HTML page. The recommended way for React developers is to install @nlux/themes

npm install @nlux/themes

Then import the theme CSS file into your app or component as follows:

import '@nlux/themes/nova.css';

This requires that your bundler is configured to load CSS files.

2.8.0-beta.1

6 months ago

2.11.0

6 months ago

2.11.1

6 months ago

2.4.0

7 months ago

2.8.1

6 months ago

2.9.2

6 months ago

2.5.6

7 months ago

2.9.1

6 months ago

2.5.5

7 months ago

2.9.4

6 months ago

2.5.8

7 months ago

2.9.3

6 months ago

2.5.7

7 months ago

2.9.5

6 months ago

2.5.9

7 months ago

2.2.14-beta

7 months ago

2.3.0

7 months ago

2.3.2

7 months ago

2.10.0

6 months ago

2.3.1

7 months ago

2.7.0

6 months ago

2.3.3

7 months ago

2.7.2

6 months ago

2.3.6

7 months ago

2.7.1

6 months ago

2.3.5

7 months ago

2.8.3

6 months ago

2.8.2

6 months ago

2.1.9-beta

7 months ago

2.14.0

6 months ago

2.6.1

6 months ago

2.1.10-beta

7 months ago

2.6.0

6 months ago

2.6.3

6 months ago

2.6.2

6 months ago

2.9.0-beta.2

6 months ago

2.9.0-beta.1

6 months ago

2.2.15-beta

7 months ago

2.3.8

7 months ago

2.7.3

6 months ago

2.3.7

7 months ago

2.17.0

4 months ago

2.7.6

6 months ago

2.17.1

4 months ago

2.7.5

6 months ago

2.3.9

7 months ago

2.13.2

6 months ago

2.7.7

6 months ago

2.13.0

6 months ago

2.13.1

6 months ago

2.5.10

6 months ago

2.5.0-beta.0

7 months ago

2.2.13-beta

7 months ago

2.12.0

6 months ago

2.5.0

7 months ago

2.5.2

7 months ago

2.5.1

7 months ago

2.9.0

6 months ago

2.5.4

7 months ago

2.5.3

7 months ago

2.2.12-beta

7 months ago

2.6.5

6 months ago

2.6.4

6 months ago

2.16.1

5 months ago

2.6.6

6 months ago

2.16.0

5 months ago

2.6.8

6 months ago

2.12.1

6 months ago

2.12.2

6 months ago

2.2.11-beta

7 months ago

2.1.8-beta

7 months ago

2.1.7-beta

7 months ago

2.1.6-beta

7 months ago

2.1.3-beta

7 months ago

2.1.5-beta

7 months ago

2.1.4-beta

7 months ago

2.1.2-beta

7 months ago

2.1.1-beta

7 months ago

2.1.0-beta

7 months ago

2.0.11-alpha

7 months ago

2.0.12-alpha

7 months ago

2.0.10-alpha

7 months ago

2.0.9-alpha

8 months ago

2.0.8-alpha

8 months ago

2.0.7-alpha

8 months ago

2.0.5-alpha

8 months ago

2.0.6-alpha

8 months ago

2.0.4-alpha

8 months ago

2.0.3-alpha

8 months ago

2.0.2-alpha

8 months ago

2.0.1-alpha

8 months ago

1.0.15

8 months ago

1.0.14

8 months ago

1.0.13

8 months ago

1.0.12

8 months ago

1.0.9

8 months ago

2.0.0-alpha.1

8 months ago

1.0.10

8 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.2

9 months ago

1.0.3

9 months ago

1.0.1

10 months ago

1.0.0

10 months ago

0.12.2

10 months ago

0.12.1

10 months ago

0.12.0

10 months ago

0.11.2

11 months ago

0.11.0

11 months ago

0.11.1

11 months ago

0.10.11

11 months ago

0.10.10

11 months ago

0.10.9

11 months ago

0.10.7

11 months ago

0.10.8

11 months ago

0.10.6

11 months ago

0.10.4

11 months ago

0.10.5

11 months ago

0.10.1

11 months ago

0.10.2

11 months ago

0.10.3

11 months ago

0.9.3

11 months ago

0.10.0

11 months ago

0.9.2

12 months ago

0.9.1

12 months ago

0.9.0

12 months ago

0.8.13

1 year ago

0.8.12

1 year ago

0.8.11

1 year ago

0.8.10

1 year ago

0.8.9

1 year ago

0.8.8

1 year ago

0.8.5

1 year ago

0.8.7

1 year ago

0.8.4

1 year ago

0.8.3

1 year ago

0.8.2

1 year ago

0.8.1

1 year ago

0.8.0

1 year ago