2.17.1 • Published 3 months ago

@nlux/react v2.17.1

Weekly downloads
-
License
MPL-2.0
Repository
github
Last release
3 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

5 months ago

2.11.0

5 months ago

2.11.1

5 months ago

2.4.0

6 months ago

2.8.1

5 months ago

2.9.2

5 months ago

2.5.6

6 months ago

2.9.1

5 months ago

2.5.5

6 months ago

2.9.4

5 months ago

2.5.8

5 months ago

2.9.3

5 months ago

2.5.7

6 months ago

2.9.5

5 months ago

2.5.9

5 months ago

2.2.14-beta

6 months ago

2.3.0

6 months ago

2.3.2

6 months ago

2.10.0

5 months ago

2.3.1

6 months ago

2.7.0

5 months ago

2.3.3

6 months ago

2.7.2

5 months ago

2.3.6

6 months ago

2.7.1

5 months ago

2.3.5

6 months ago

2.8.3

5 months ago

2.8.2

5 months ago

2.1.9-beta

6 months ago

2.14.0

5 months ago

2.6.1

5 months ago

2.1.10-beta

6 months ago

2.6.0

5 months ago

2.6.3

5 months ago

2.6.2

5 months ago

2.9.0-beta.2

5 months ago

2.9.0-beta.1

5 months ago

2.2.15-beta

6 months ago

2.3.8

6 months ago

2.7.3

5 months ago

2.3.7

6 months ago

2.17.0

3 months ago

2.7.6

5 months ago

2.17.1

3 months ago

2.7.5

5 months ago

2.3.9

6 months ago

2.13.2

5 months ago

2.7.7

5 months ago

2.13.0

5 months ago

2.13.1

5 months ago

2.5.10

5 months ago

2.5.0-beta.0

6 months ago

2.2.13-beta

6 months ago

2.12.0

5 months ago

2.5.0

6 months ago

2.5.2

6 months ago

2.5.1

6 months ago

2.9.0

5 months ago

2.5.4

6 months ago

2.5.3

6 months ago

2.2.12-beta

6 months ago

2.6.5

5 months ago

2.6.4

5 months ago

2.16.1

4 months ago

2.6.6

5 months ago

2.16.0

4 months ago

2.6.8

5 months ago

2.12.1

5 months ago

2.12.2

5 months ago

2.2.11-beta

6 months ago

2.1.8-beta

6 months ago

2.1.7-beta

6 months ago

2.1.6-beta

6 months ago

2.1.3-beta

6 months ago

2.1.5-beta

6 months ago

2.1.4-beta

6 months ago

2.1.2-beta

6 months ago

2.1.1-beta

6 months ago

2.1.0-beta

6 months ago

2.0.11-alpha

6 months ago

2.0.12-alpha

6 months ago

2.0.10-alpha

6 months ago

2.0.9-alpha

6 months ago

2.0.8-alpha

6 months ago

2.0.7-alpha

6 months ago

2.0.5-alpha

7 months ago

2.0.6-alpha

7 months ago

2.0.4-alpha

7 months ago

2.0.3-alpha

7 months ago

2.0.2-alpha

7 months ago

2.0.1-alpha

7 months ago

1.0.15

7 months ago

1.0.14

7 months ago

1.0.13

7 months ago

1.0.12

7 months ago

1.0.9

7 months ago

2.0.0-alpha.1

7 months ago

1.0.10

7 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.2

8 months ago

1.0.3

8 months ago

1.0.1

9 months ago

1.0.0

9 months ago

0.12.2

9 months ago

0.12.1

9 months ago

0.12.0

9 months ago

0.11.2

10 months ago

0.11.0

10 months ago

0.11.1

10 months ago

0.10.11

10 months ago

0.10.10

10 months ago

0.10.9

10 months ago

0.10.7

10 months ago

0.10.8

10 months ago

0.10.6

10 months ago

0.10.4

10 months ago

0.10.5

10 months ago

0.10.1

10 months ago

0.10.2

10 months ago

0.10.3

10 months ago

0.9.3

10 months ago

0.10.0

10 months ago

0.9.2

11 months ago

0.9.1

11 months ago

0.9.0

11 months ago

0.8.13

11 months ago

0.8.12

11 months ago

0.8.11

11 months ago

0.8.10

11 months ago

0.8.9

11 months ago

0.8.8

11 months ago

0.8.5

11 months ago

0.8.7

11 months ago

0.8.4

11 months ago

0.8.3

11 months ago

0.8.2

11 months ago

0.8.1

11 months ago

0.8.0

12 months ago