ai-mistral-text

ai-mistral-text — Generate text using Mistral Chat Completion


Description

- step: ai-mistral-text
  args:
    - '${PROMPT}'
    - '${REASONING_EFFORT}'  # optional
  context:
    SYSTEM_PROMPT: '${SYSTEM_PROMPT}'  # optional

The ai-mistral-text step generates text using Mistral’s Chat Completion API.

Usage in a workflow YAML:

workflow:
  - step: ai-mistral-text
    args:
      - "Explain the benefits of renewable energy."
      - "medium"
    context:
      SYSTEM_PROMPT: "You are a friendly, clear, and concise assistant."

Parameters

Parameter Type Description
prompt string The text prompt to send to Mistral.
reasoning_effort string Optional. One of "minimal", "low", "medium", "high". Controls depth of reasoning.

Context requirements:

Context Key Type Description
MISTRAL_API_KEY string Required. Mistral API key.
SYSTEM_PROMPT string Optional. System prompt to guide the model.

Return Values

"This is the text generated by Mistral based on your prompt."
{
  "error": "Description of the error or API failure"
}

Behavior


Examples

Example #1 — Basic text generation

workflow:
  - step: ai-mistral-text
    args:
      - "Summarize the latest AI news."

Stores the generated summary in ${prev}.

Example #2 — Specifying reasoning effort

workflow:
  - step: ai-mistral-text
    args:
      - "Explain black holes for beginners."
      - "medium"

Example #3 — Using system prompt

workflow:
  - step: ai-mistral-text
    args:
      - "Write a professional email draft."
    context:
      SYSTEM_PROMPT: "You are a polite and concise assistant."

Notes


See Also