Skip to content

Commit df236f5

Browse files
committed
Document the chat index setting
1 parent dc3ce92 commit df236f5

1 file changed

Lines changed: 105 additions & 3 deletions

File tree

reference/api/settings.mdx

Lines changed: 105 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ By default, the settings object looks like this. All fields are modifiable.
126126
"facetSearch": true,
127127
"prefixSearch": "indexingTime",
128128
"searchCutoffMs": null,
129-
"embedders": {}
129+
"embedders": {},
130+
"chat": {}
130131
}
131132
```
132133

@@ -196,7 +197,8 @@ Get the settings of an index.
196197
"facetSearch": true,
197198
"prefixSearch": "indexingTime",
198199
"searchCutoffMs": null,
199-
"embedders": {}
200+
"embedders": {},
201+
"chat": {}
200202
}
201203
```
202204

@@ -240,7 +242,8 @@ If the provided index does not exist, it will be created.
240242
| **[`stopWords`](#stop-words)** | Array of strings | Empty | List of words ignored by Meilisearch when present in search queries |
241243
| **[`synonyms`](#synonyms)** | Object | Empty | List of associated words treated similarly |
242244
| **[`typoTolerance`](#typo-tolerance)** | Object | [Default object](#typo-tolerance-object) | Typo tolerance settings |
243-
| **[`embedders`](#embedders)** | Object of objects | [Default object](#embedders-object) | Embedder required for performing meaning-based search queries |
245+
| **[`embedders`](#embedders)** | Object of objects | [Default object](#embedders-object) | Embedder required for performing meaning-based search queries |
246+
| **[`chat`](#chat)** | Object | [Default object](#chat-object) | Chat settings for performing conversation-based queries |
244247

245248
#### Example
246249

@@ -2917,3 +2920,102 @@ To remove a single embedder, use the [update embedder settings endpoint](#update
29172920
```
29182921

29192922
You can use the returned `taskUid` to get more details on [the status of the task](/reference/api/tasks#get-one-task).
2923+
2924+
## Conversation
2925+
2926+
Conversational querying allows a more human-like interaction with your search engine. It enables you to ask questions and receive relevant answers based on the content of your documents.
2927+
2928+
### Chat object
2929+
2930+
The chat object in the index settings contains multiple settings to configure the conversational querying.
2931+
2932+
```json
2933+
{
2934+
"description": "Contains a bunch of movies from the IMdb database. Each movie has a title, overview, and rating.",
2935+
"documentTemplate": "A movie titled '{{doc.title}}' whose description starts with {{doc.overview|truncatewords: 20}}",
2936+
"documentTemplateMaxBytes": 400,
2937+
"searchParameters": {
2938+
"hybrid": { "embedder": "my-embedder" },
2939+
"limit": 20,
2940+
}
2941+
}
2942+
```
2943+
2944+
These embedder objects may contain the following fields:
2945+
2946+
| Name | Type | Default Value | Description |
2947+
| ------------------------------ | ------- | --------------------------------------- | ---------------------------------------------------------------------------------------------------- |
2948+
| **`description`** | String | Empty | The description of the index. Used to help the LLM decide which index to use when generating answers |
2949+
| **`documentTemplate`** | String | `{% for field in fields %} {% if field.is_searchable and not field.value == nil %}{{ field.name }}: {{ field.value }} {% endif %} {% endfor %}` | Template defining the data Meilisearch sends to the LLM |
2950+
| **`documentTemplateMaxBytes`** | Integer | 400 | Maximum allowed size of rendered document template |
2951+
| **`searchParameters`** | Object | Empty | The search parameters to use when LLM is performing search requests |
2952+
2953+
### Search parameters object
2954+
2955+
Corresponds to a subset of the [search parameters object](/reference/api/search#search-parameters-object):
2956+
- **`hybrid`**
2957+
- **`limit`**
2958+
- **`sort`**
2959+
- **`distinct`**
2960+
- **`matchingStrategy`**
2961+
- **`attributesToSearchOn`**
2962+
- **`rankingScoreThreshold`**
2963+
2964+
### Get index chat settings
2965+
2966+
<RouteHighlighter method="GET" path="/indexes/{index_uid}/settings/chat" />
2967+
2968+
Get the index chat settings configured for an index.
2969+
2970+
#### Path parameters
2971+
2972+
| Name | Type | Description |
2973+
| :---------------- | :----- | :------------------------------------------------------------------------ |
2974+
| **`index_uid`** * | String | [`uid`](/learn/getting_started/indexes#index-uid) of the requested index |
2975+
2976+
#### Example
2977+
2978+
<CodeSamplesGetEmbedders1 />
2979+
2980+
##### Response: `200 OK`
2981+
2982+
```json
2983+
{
2984+
"description": "",
2985+
"documentTemplate": "{% for field in fields %} {% if field.is_searchable and not field.value == nil %}{{ field.name }}: {{ field.value }} {% endif %} {% endfor %}",
2986+
"documentTemplateMaxBytes": 400,
2987+
"searchParameters": {}
2988+
}
2989+
```
2990+
2991+
### Update index chat settings
2992+
2993+
<RouteHighlighter method="PATCH" path="/indexes/{index_uid}/settings/chat" />
2994+
2995+
Partially update the index chat settings for an index.
2996+
2997+
#### Path parameters
2998+
2999+
| Name | Type | Description |
3000+
| :---------------- | :----- | :------------------------------------------------------------------------ |
3001+
| **`index_uid`** * | String | [`uid`](/learn/getting_started/indexes#index-uid) of the requested index |
3002+
3003+
#### Body
3004+
3005+
```json
3006+
{
3007+
"description": <String>,
3008+
"documentTemplate": <String>,
3009+
"documentTemplateMaxBytes": <Integer>,
3010+
"searchParameters": {
3011+
"hybrid": <Object>,
3012+
"limit": <Integer>,
3013+
"sort": <String>,
3014+
"distinct": <String>,
3015+
"matchingStrategy": <String>,
3016+
"attributesToSearchOn": <String>,
3017+
"rankingScoreThreshold": <Float>,
3018+
"limit": <Integer>,
3019+
}
3020+
}
3021+
```

0 commit comments

Comments
 (0)