ChatCompletion
yaml
type: "io.kestra.plugin.mistral.ChatCompletion"
Examples
Basic Mistral chat
yaml
id: mistral
namespace: company.team
tasks:
- id: chat_completion
type: io.kestra.plugin.mistral.ChatCompletion
apiKey: "{{ secret('MISTRAL_API_KEY') }}"
modelName: open-mistral-7b
messages:
- type: SYSTEM
content: You are a helpful assistant, answer concisely, avoid overly casual language or unnecessary verbosity.
- type: USER
content: "What is the capital of France?"
Mistral chat with Structured Output (JSON schema)
yaml
id: mistral_structured
namespace: company.team
tasks:
- id: chat_completion_structured
type: io.kestra.plugin.mistral.ChatCompletion
apiKey: "{{ secret('MISTRAL_API_KEY') }}"
modelName: "ministral-8b-latest"
messages:
- type: SYSTEM
content: "Extract the books information."
- type: USER
content: "I recently read 'To Kill a Mockingbird' by Harper Lee."
jsonResponseSchema: |
{
"type": "object",
"title": "Book",
"additionalProperties": false,
"required": ["name", "authors"],
"properties": {
"name": { "type": "string", "title": "Name" },
"authors": { "type": "array", "title": "Authors", "items": { "type": "string" } }
}
}
Properties
apiKey *Requiredstring
API Key
The Mistral API key used for authentication
modelName *Requiredstring
Model
The Mistral model to use (e.g. mistral-small, mistral-medium, mistral-large-latest)
baseUrl string
Default
https://api.mistral.ai/v1
Base URL
The base URL of the Mistral API
jsonResponseSchema string
JSON Response Schema
JSON schema (as string) to force a custom Structured Output. If provided, the request will include response_format = { type: "json_schema", json_schema: { schema, name, strict } } as described in Mistral documentation.
Outputs
raw string
response string
Definitions
io.kestra.plugin.mistral.ChatCompletion-ChatMessage
content string
type string
Possible Values
SYSTEM
ASSISTANT
USER