-
Notifications
You must be signed in to change notification settings - Fork 266
Improve chat API documentation clarity based on customer feedback #3280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,10 @@ import { RouteHighlighter } from '/snippets/route_highlighter.mdx'; | |
|
||
The `/chats` route enables AI-powered conversational search by integrating Large Language Models (LLMs) with your Meilisearch data. This feature allows users to ask questions in natural language and receive contextual answers based on your indexed content. | ||
|
||
<Tip> | ||
To optimize how your content is presented to the LLM, configure the [conversation settings for each index](/reference/api/settings#conversation). This allows you to customize descriptions, document templates, and search parameters for better AI responses. | ||
</Tip> | ||
|
||
<Note> | ||
This is an experimental feature. Use the Meilisearch Cloud UI or the experimental features endpoint to activate it: | ||
|
||
|
@@ -19,6 +23,7 @@ curl \ | |
"chatCompletions": true | ||
}' | ||
``` | ||
|
||
</Note> | ||
|
||
## Chat completions workspace object | ||
|
@@ -39,6 +44,10 @@ curl \ | |
|
||
Configure the LLM provider and settings for a chat workspace. | ||
|
||
<Note> | ||
If the specified workspace doesn't exist, this endpoint will automatically create it for you. No need to explicitly create workspaces beforehand! | ||
</Note> | ||
|
||
```json | ||
{ | ||
"source": "openAi", | ||
|
@@ -82,7 +91,6 @@ Configure the LLM provider and settings for a chat workspace. | |
| **`searchQParam`** | String | A prompt to explain what the `q` parameter of the search function does and how to use it | | ||
| **`searchIndexUidParam`** | String | A prompt to explain what the `indexUid` parameter of the search function does and how to use it | | ||
|
||
|
||
### Request body | ||
|
||
```json | ||
|
@@ -391,6 +399,19 @@ curl \ | |
} | ||
``` | ||
|
||
## Privacy and data storage | ||
|
||
<Note> | ||
🔒 **Your conversations are private**: Meilisearch does not store any conversation history or context between requests. Each chat completion request is stateless and independent. Any conversation continuity must be managed by your application. | ||
</Note> | ||
|
||
This design ensures: | ||
|
||
- Complete privacy of user conversations | ||
- No data retention of questions or answers | ||
- Full control over conversation history in your application | ||
- Compliance with data protection regulations | ||
|
||
## Authentication | ||
|
||
The chat feature integrates with Meilisearch's authentication system: | ||
|
@@ -549,11 +570,13 @@ This tool reports real-time progress of internal search operations. When declare | |
**Purpose**: Provides transparency about search operations and reduces perceived latency by showing users what's happening behind the scenes. | ||
|
||
**Arguments**: | ||
|
||
- `call_id`: Unique identifier to track the search operation | ||
- `function_name`: Name of the internal function being executed (e.g., "_meiliSearchInIndex") | ||
- `function_parameters`: JSON-encoded string containing search parameters like `q` (query) and `index_uid` | ||
|
||
**Example Response**: | ||
|
||
```json | ||
{ | ||
"function": { | ||
|
@@ -570,12 +593,14 @@ Since the `/chats/{workspace}/chat/completions` endpoint is stateless, this tool | |
**Purpose**: Maintains conversation context for better response quality in subsequent requests by preserving tool calls and results. | ||
|
||
**Arguments**: | ||
|
||
- `role`: Message author role ("user" or "assistant") | ||
- `content`: Message content (for tool results) | ||
Comment on lines
597
to
598
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect value in The description says either - "description": "The role of the messages author, either `role` or `assistant`"
+ "description": "The role of the message author, either `user` or `assistant`"
🧰 Tools🪛 LanguageTool[uncategorized] ~597-~597: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION) 🤖 Prompt for AI Agents
|
||
- `tool_calls`: Array of tool calls made by the assistant | ||
- `tool_call_id`: ID of the tool call this message responds to | ||
|
||
**Example Response**: | ||
|
||
```json | ||
{ | ||
"function": { | ||
|
@@ -592,10 +617,12 @@ This tool provides the source documents that were used by the LLM to generate re | |
**Purpose**: Shows users which documents were used to generate responses, improving trust and enabling source verification. | ||
|
||
**Arguments**: | ||
|
||
- `call_id`: Matches the `call_id` from `_meiliSearchProgress` to associate queries with results | ||
- `documents`: JSON object containing the source documents with only displayed attributes | ||
|
||
**Example Response**: | ||
|
||
```json | ||
{ | ||
"function": { | ||
|
Uh oh!
There was an error while loading. Please reload this page.