Manages Meilisearch conversational search workspaces and chat completions.
Summary
Functions
Performs a chat completion request in a specific workspace.
Performs a chat completion request, raising on error.
Gets settings for a specific chat workspace.
Gets settings for a specific chat workspace, raising on error.
Resets settings for a specific chat workspace to their defaults.
Resets settings for a specific chat workspace, raising on error.
Updates settings for a specific chat workspace.
Updates settings for a specific chat workspace, raising on error.
Functions
Performs a chat completion request in a specific workspace.
Additional Req options (like :into for streaming chunks) can be passed in the opts keyword list.
Examples
body = %{
model: "gpt-4",
messages: [%{role: "user", content: "Hello!"}],
stream: true
}
# Streaming with into:
Meili.Chat.completions("default", body, into: fn {:data, chunk}, state ->
IO.write(chunk)
{:cont, state}
end)
Performs a chat completion request, raising on error.
Gets settings for a specific chat workspace.
Examples
Meili.Chat.get_settings("default")
Meili.Chat.get_settings(client, "default")
Gets settings for a specific chat workspace, raising on error.
Resets settings for a specific chat workspace to their defaults.
Examples
Meili.Chat.reset_settings("default")
Meili.Chat.reset_settings(client, "default")
Resets settings for a specific chat workspace, raising on error.
Updates settings for a specific chat workspace.
Examples
settings = %{
searchable_attributes: ["title"],
system_prompt: "You are a helpful assistant."
}
Meili.Chat.update_settings("default", settings)
Meili.Chat.update_settings(client, "default", settings)
Updates settings for a specific chat workspace, raising on error.