curl \
-X PATCH 'MEILISEARCH_URL/chats/WORKSPACE_NAME/settings' \
-H "Authorization: Bearer MEILISEARCH_KEY" \
-H "Content-Type: application/json" \
--data-binary '{ "apiKey": "your-valid-api-key" }'import requests
url = "http://localhost:7700/chats/{workspace_uid}/settings"
payload = {
"orgId": "dcba4321...",
"projectId": "4321dcba...",
"apiVersion": "2024-02-01",
"deploymentId": "1234abcd...",
"baseUrl": "https://api.mistral.ai/v1",
"apiKey": "abcd1234...",
"prompts": {
"system": "You are a helpful assistant...",
"searchDescription": "This is the search function...",
"searchQParam": "This is query parameter...",
"searchFilterParam": "This is filter parameter...",
"searchIndexUidParam": "This is index you want to search in..."
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orgId: 'dcba4321...',
projectId: '4321dcba...',
apiVersion: '2024-02-01',
deploymentId: '1234abcd...',
baseUrl: 'https://api.mistral.ai/v1',
apiKey: 'abcd1234...',
prompts: {
system: 'You are a helpful assistant...',
searchDescription: 'This is the search function...',
searchQParam: 'This is query parameter...',
searchFilterParam: 'This is filter parameter...',
searchIndexUidParam: 'This is index you want to search in...'
}
})
};
fetch('http://localhost:7700/chats/{workspace_uid}/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "7700",
CURLOPT_URL => "http://localhost:7700/chats/{workspace_uid}/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'orgId' => 'dcba4321...',
'projectId' => '4321dcba...',
'apiVersion' => '2024-02-01',
'deploymentId' => '1234abcd...',
'baseUrl' => 'https://api.mistral.ai/v1',
'apiKey' => 'abcd1234...',
'prompts' => [
'system' => 'You are a helpful assistant...',
'searchDescription' => 'This is the search function...',
'searchQParam' => 'This is query parameter...',
'searchFilterParam' => 'This is filter parameter...',
'searchIndexUidParam' => 'This is index you want to search in...'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:7700/chats/{workspace_uid}/settings"
payload := strings.NewReader("{\n \"orgId\": \"dcba4321...\",\n \"projectId\": \"4321dcba...\",\n \"apiVersion\": \"2024-02-01\",\n \"deploymentId\": \"1234abcd...\",\n \"baseUrl\": \"https://api.mistral.ai/v1\",\n \"apiKey\": \"abcd1234...\",\n \"prompts\": {\n \"system\": \"You are a helpful assistant...\",\n \"searchDescription\": \"This is the search function...\",\n \"searchQParam\": \"This is query parameter...\",\n \"searchFilterParam\": \"This is filter parameter...\",\n \"searchIndexUidParam\": \"This is index you want to search in...\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("http://localhost:7700/chats/{workspace_uid}/settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"orgId\": \"dcba4321...\",\n \"projectId\": \"4321dcba...\",\n \"apiVersion\": \"2024-02-01\",\n \"deploymentId\": \"1234abcd...\",\n \"baseUrl\": \"https://api.mistral.ai/v1\",\n \"apiKey\": \"abcd1234...\",\n \"prompts\": {\n \"system\": \"You are a helpful assistant...\",\n \"searchDescription\": \"This is the search function...\",\n \"searchQParam\": \"This is query parameter...\",\n \"searchFilterParam\": \"This is filter parameter...\",\n \"searchIndexUidParam\": \"This is index you want to search in...\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:7700/chats/{workspace_uid}/settings")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orgId\": \"dcba4321...\",\n \"projectId\": \"4321dcba...\",\n \"apiVersion\": \"2024-02-01\",\n \"deploymentId\": \"1234abcd...\",\n \"baseUrl\": \"https://api.mistral.ai/v1\",\n \"apiKey\": \"abcd1234...\",\n \"prompts\": {\n \"system\": \"You are a helpful assistant...\",\n \"searchDescription\": \"This is the search function...\",\n \"searchQParam\": \"This is query parameter...\",\n \"searchFilterParam\": \"This is filter parameter...\",\n \"searchIndexUidParam\": \"This is index you want to search in...\"\n }\n}"
response = http.request(request)
puts response.read_body{
"source": "openAi",
"baseUrl": null,
"apiKey": "$LLM_API_KEY",
"prompts": {
"system": "My super system prompt",
"searchDescription": "My super search tool description",
"searchQParam": "My awesome q search parameter description",
"searchIndexUidParam": "My incredible index uid param description"
}
}{
"message": "The Authorization header is missing. It must use the bearer authorization method.",
"code": "missing_authorization_header",
"type": "auth",
"link": "https://docs.meilisearch.com/errors#missing_authorization_header"
}{
"message": "Chat :workspaceUid not found.",
"code": "chat_not_found",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#chat_not_found"
}Update settings of a chat workspace
curl \
-X PATCH 'MEILISEARCH_URL/chats/WORKSPACE_NAME/settings' \
-H "Authorization: Bearer MEILISEARCH_KEY" \
-H "Content-Type: application/json" \
--data-binary '{ "apiKey": "your-valid-api-key" }'import requests
url = "http://localhost:7700/chats/{workspace_uid}/settings"
payload = {
"orgId": "dcba4321...",
"projectId": "4321dcba...",
"apiVersion": "2024-02-01",
"deploymentId": "1234abcd...",
"baseUrl": "https://api.mistral.ai/v1",
"apiKey": "abcd1234...",
"prompts": {
"system": "You are a helpful assistant...",
"searchDescription": "This is the search function...",
"searchQParam": "This is query parameter...",
"searchFilterParam": "This is filter parameter...",
"searchIndexUidParam": "This is index you want to search in..."
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orgId: 'dcba4321...',
projectId: '4321dcba...',
apiVersion: '2024-02-01',
deploymentId: '1234abcd...',
baseUrl: 'https://api.mistral.ai/v1',
apiKey: 'abcd1234...',
prompts: {
system: 'You are a helpful assistant...',
searchDescription: 'This is the search function...',
searchQParam: 'This is query parameter...',
searchFilterParam: 'This is filter parameter...',
searchIndexUidParam: 'This is index you want to search in...'
}
})
};
fetch('http://localhost:7700/chats/{workspace_uid}/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "7700",
CURLOPT_URL => "http://localhost:7700/chats/{workspace_uid}/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'orgId' => 'dcba4321...',
'projectId' => '4321dcba...',
'apiVersion' => '2024-02-01',
'deploymentId' => '1234abcd...',
'baseUrl' => 'https://api.mistral.ai/v1',
'apiKey' => 'abcd1234...',
'prompts' => [
'system' => 'You are a helpful assistant...',
'searchDescription' => 'This is the search function...',
'searchQParam' => 'This is query parameter...',
'searchFilterParam' => 'This is filter parameter...',
'searchIndexUidParam' => 'This is index you want to search in...'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:7700/chats/{workspace_uid}/settings"
payload := strings.NewReader("{\n \"orgId\": \"dcba4321...\",\n \"projectId\": \"4321dcba...\",\n \"apiVersion\": \"2024-02-01\",\n \"deploymentId\": \"1234abcd...\",\n \"baseUrl\": \"https://api.mistral.ai/v1\",\n \"apiKey\": \"abcd1234...\",\n \"prompts\": {\n \"system\": \"You are a helpful assistant...\",\n \"searchDescription\": \"This is the search function...\",\n \"searchQParam\": \"This is query parameter...\",\n \"searchFilterParam\": \"This is filter parameter...\",\n \"searchIndexUidParam\": \"This is index you want to search in...\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("http://localhost:7700/chats/{workspace_uid}/settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"orgId\": \"dcba4321...\",\n \"projectId\": \"4321dcba...\",\n \"apiVersion\": \"2024-02-01\",\n \"deploymentId\": \"1234abcd...\",\n \"baseUrl\": \"https://api.mistral.ai/v1\",\n \"apiKey\": \"abcd1234...\",\n \"prompts\": {\n \"system\": \"You are a helpful assistant...\",\n \"searchDescription\": \"This is the search function...\",\n \"searchQParam\": \"This is query parameter...\",\n \"searchFilterParam\": \"This is filter parameter...\",\n \"searchIndexUidParam\": \"This is index you want to search in...\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:7700/chats/{workspace_uid}/settings")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orgId\": \"dcba4321...\",\n \"projectId\": \"4321dcba...\",\n \"apiVersion\": \"2024-02-01\",\n \"deploymentId\": \"1234abcd...\",\n \"baseUrl\": \"https://api.mistral.ai/v1\",\n \"apiKey\": \"abcd1234...\",\n \"prompts\": {\n \"system\": \"You are a helpful assistant...\",\n \"searchDescription\": \"This is the search function...\",\n \"searchQParam\": \"This is query parameter...\",\n \"searchFilterParam\": \"This is filter parameter...\",\n \"searchIndexUidParam\": \"This is index you want to search in...\"\n }\n}"
response = http.request(request)
puts response.read_body{
"source": "openAi",
"baseUrl": null,
"apiKey": "$LLM_API_KEY",
"prompts": {
"system": "My super system prompt",
"searchDescription": "My super search tool description",
"searchQParam": "My awesome q search parameter description",
"searchIndexUidParam": "My incredible index uid param description"
}
}{
"message": "The Authorization header is missing. It must use the bearer authorization method.",
"code": "missing_authorization_header",
"type": "auth",
"link": "https://docs.meilisearch.com/errors#missing_authorization_header"
}{
"message": "Chat :workspaceUid not found.",
"code": "chat_not_found",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#chat_not_found"
}Authorizations
An API key is a token that you provide when making API calls. Read more about how to secure your project.
Include the API key to the Authorization header, for instance:
-H 'Authorization: Bearer 6436fc5237b0d6e0d64253fbaac21d135012ecf1'
If you use a SDK, ensure you instantiate the client with the API key, for instance with JS SDK:
const client = new MeiliSearch({
host: 'MEILISEARCH_URL',
apiKey: '6436fc5237b0d6e0d64253fbaac21d135012ecf1'
});
Path Parameters
The unique identifier of the chat workspace.
Body
Settings for a chat workspace
LLM provider to use for chat completions
openAi, mistral, azureOpenAi, vLlm Organization ID for the LLM provider
"dcba4321..."
Project ID for the LLM provider
"4321dcba..."
API version for the LLM provider
"2024-02-01"
Deployment ID for Azure OpenAI
"1234abcd..."
Base URL for the LLM API
"https://api.mistral.ai/v1"
API key for authentication with the LLM provider
"abcd1234..."
Custom prompts for chat completions
Show child attributes
Show child attributes
Response
Chat settings retrieved.
Was this page helpful?