DeepSeek ChatCompletion

DeepSeek ChatCompletion

Certified

Send chat to DeepSeek

Calls the DeepSeek Chat Completions API with role-based messages and optional JSON Mode guidance. Uses baseUrl default https://api.deepseek.com/v1 for OpenAI-compatible routing; add jsonResponseSchema to request JSON-only output—schema is advisory and not server-validated.

yaml
type: io.kestra.plugin.deepseek.ChatCompletion

Chat completion with DeepSeek

yaml
id: deepseek_chat
namespace: company.team

tasks:
  - id: chat_completion
    type: io.kestra.plugin.deepseek.ChatCompletion
    apiKey: "{{ secret('DEEPSEEK_API_KEY') }}"
    modelName: deepseek-chat
    messages:
      - type: SYSTEM
        content: You are a helpful assistant.
      - type: USER
        content: What is the capital of Germany? Return only the name.

DeepSeek chat with JSON Mode (schema guidance)

yaml
id: deepseek_chat_json_mode
namespace: company.team

tasks:
  - id: chat_completion_json
    type: io.kestra.plugin.deepseek.ChatCompletion
    apiKey: "{{ secret('DEEPSEEK_API_KEY') }}"
    modelName: deepseek-chat
    messages:
      - type: USER
        content: |
          Extract the book information from: "I recently read 'To Kill a Mockingbird' by Harper Lee." Return JSON only.
    jsonResponseSchema: |
      {
        "type": "object",
        "title": "Book",
        "additionalProperties": false,
        "required": ["name", "authors"],
        "properties": {
          "name": { "type": "string" },
          "authors": { "type": "array", "items": { "type": "string" } }
        }
      }
Properties

API key

DeepSeek API key used for Bearer authentication

Messages

Ordered chat history with roles SYSTEM, USER, or ASSISTANT; rendered before sending.

Definitions
contentstring
typestring
Possible Values
SYSTEMASSISTANTUSER

Model name

DeepSeek model identifier such as deepseek-chat or deepseek-coder

Defaulthttps://api.deepseek.com/v1

Base URL

DeepSeek API endpoint; defaults to https://api.deepseek.com/v1 for OpenAI-compatible clients and can point to a proxy.

JSON Response Schema

Optional JSON Schema string to enable DeepSeek JSON Mode. Sets response_format to json_object and prepends a schema reminder; DeepSeek treats the schema as guidance and does not validate server-side.

Reference (ref) of the pluginDefaults to apply to this task.

Raw response body returned by the DeepSeek API

Assistant response text extracted from the completion