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.
44 lines (36 loc) • 1.11 kB
text/mdx
Your final code will look like this:
```tsx
import {AiChat} from '@nlux/react';
import {useChatAdapter, ChatAdapterOptions} from '@nlux/nlbridge-react';
import '@nlux/themes/nova.css';
const adapterOptions: ChatAdapterOptions = {
url: 'http://localhost:8080/chat-api',
};
export const App = () => {
const nlbridgeAdapter = useChatAdapter(adapterOptions);
return (
<AiChat
adapter={nlbridgeAdapter}
promptBoxOptions={{
placeholder: 'How can I help you today?'
}}
/>
);
};
```
You can now run your app and test the chatbot.<br />
The result is a fully functional chatbot UI:
<div
style={{
display: "inline-block",
border: "1px solid #ddd",
borderRadius: "4px",
overflow: "hidden",
width: "400px",
height: "387px",
backgroundImage: 'url("/learn/get-started-guides/open-ai-chatbot-demo.gif")',
backgroundSize: "cover",
}}
alt="AiChat demo"
></div>
And _NLUX_ is handling all the UI interactions and the communication with the _nlbridge_ server.