Skip to content

Chat Box

Chat Box component offers a complete, fast and reliable chat experience to generate answers based on your index contents and query.

The Chat Box component is included in the Search Box component with no additional configuration needed, but it can also be used as a standalone component.

You can check out a live demo on our main website orama.com.


Installation

To install the Orama UI Components library, you can follow the instructions here.

Usage

The Chat Box supports the following options.

OptionDescriptionDefault
indexThe index configuration. An object with the endpoint and api_key properties. These are the Endpoint URL and Public API Key of your index.Required when clientInstance is not specified.
clientInstanceThe OramaClient instance to use for the search and answer engine.Required when index is not specified.
sourceBaseUrlThe base URL for the search results.Empty
sourcesMapAn object to mapping your document properties with the ChatBox source results.{}
suggestionsAn array of suggestions to display in the initial state.[]

Example

Here is an example of how to use the Chat Box component in your application using React.

import { OramaChatBox } from '@orama/react-components';
<OramaChatBox
index={{
endpoint: 'https://your-index-endpoint-url',
api_key: 'YOUR_PUBLIC_API_KEY'
}}
sourceBaseUrl="https://your-website-url"
sourcesMap={{
title: 'name',
description: 'content',
path: 'url'
}}
suggestions={[
'How to use the Chat Box?',
'What is the Chat Box component?',
'How to integrate the Chat Box in my website?'
]}
/>