UNPKG

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.

24 lines (20 loc) 709 B
In Javascript, you can define the user persona by calling `withPersonaOptions` when creating the `AiChat` component. The `withPersonaOptions` function takes an object with two properties: `bot` and `user`. The `user` property is what you use to define the user persona, as shown in the example below. ```javascript const aiChat = createAiChat() .withAdapter(adapter) .withPersonaOptions({ user: { name: 'Alex', avatar: 'https://nlux.ai/images/demos/persona-user.jpeg' } }); ``` The object passed to the `user` property should match the following interface: ```typescript interface UserPersona { name: string; picture: string | HTMLElement; } ```