ChatCompletion​Chat​Completion

yaml
type: "io.kestra.plugin.mistral.ChatCompletion"

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

API Key

The Mistral API key used for authentication

Messages

List of chat messages in conversational order

Model

The Mistral model to use (e.g. mistral-small, mistral-medium, mistral-large-latest)

Default https://api.mistral.ai/v1

Base URL

The base URL of the Mistral API

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.

Possible Values
SYSTEMASSISTANTUSER