remix-nlux
Version:
Remix IDE NLUX integration. Remix IDE is the leading IDE for building and deploying smart contracts on Ethereum. NLUX is a JavaScript and React library for building conversational AI experiences.
20 lines (14 loc) • 690 B
text/mdx
You can use the `useChatAdapter` hook to create a LangServe adapter.<br />
You can optionally import `ChatAdapterOptions` from `/nlbridge-react` to define the type of the options object.
```tsx
import {useChatAdapter, ChatAdapterOptions} from '@nlux/nlbridge-react';
const adapterOptions: ChatAdapterOptions = {
url: 'http://localhost:8080/chat-api',
};
export const App = () => {
const nlbridgeAdapter = useChatAdapter(adapterOptions);
}
```
The `ChatAdapterOptions` interface has one required property: `url`.
This is the URL of the _nlbridge_ endpoint that the adapter should connect to.
In this example, we are connecting the endpoint created in the previous section.