JSONStructuredExtraction ​J​S​O​N​Structured​Extraction

yaml
type: "io.kestra.plugin.ai.completion.jsonstructuredextraction"
yaml
id: json_structured_extraction
namespace: company.ai

tasks:
  - id: extract_person
    type: io.kestra.plugin.ai.completion.JSONStructuredExtraction
    schemaName: Person
    jsonFields:
      - name
      - city
      - country
      - email
    prompt: |
      From the text below, extract the person's name, city, and email.
      If a field is missing, leave it blank.

      Text:
      "Hi! I'm John Smith from Paris, France. You can reach me at john.smith@example.com."
    provider:
      type: io.kestra.plugin.ai.provider.GoogleGemini
      apiKey: "{{ kv('GEMINI_API_KEY') }}"
      modelName: gemini-2.5-flash

yaml
id: json_structured_extraction_order
namespace: company.ai

tasks:
  - id: extract_order
    type: io.kestra.plugin.ai.completion.JSONStructuredExtraction
    schemaName: Order
    jsonFields:
      - order_id
      - customer_name
      - city
      - total_amount
    prompt: |
      Extract the order_id, customer_name, city, and total_amount from the message.
      For the total amount, keep only the number without the currency symbol.
      Return only JSON with the requested keys.

      Message:
      "Order #A-1043 for Jane Doe, shipped to Berlin. Total: 249.99 EUR."
    provider:
      type: io.kestra.plugin.ai.provider.OpenAI
      apiKey: "{{ kv('OPENAI_API_KEY') }}"
      modelName: gpt-5-mini
Properties
SubType string
Default {}
Possible Values
STOPLENGTHTOOL_EXECUTIONCONTENT_FILTEROTHER
Default https://api.deepseek.com/v1
Default TEXT
Possible Values
TEXTJSON
Default COHERE
Possible Values
COHERETITAN