StructuredOutputCompletion​Structured​Output​Completion

Generate Structured JSON Output Using the Gemini Client.

yaml
type: "io.kestra.plugin.gemini.StructuredOutputCompletion"

Structured JSON Output Completion using the Gemini Client.

yaml
id: gemini_structured_json_completion
namespace: company.team

tasks:
  - id: gemini_structured_json_completion
    type: io.kestra.plugin.gemini.StructuredOutputCompletion
    apiKey: "{{ secret('GEMINI_API_KEY') }}"
    model: "gemini-2.5-flash-preview-05-20"
    prompt: What are the weather predictions for tomorrow in London?
    jsonResponseSchema: |
        {
            "type": "object",
            "properties": {
                "predictions": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "content": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        }
Properties

Gemini API Key

jsonResponseSchema

Model

Specifies which generative model (e.g., 'gemini-1.5-flash', 'gemini-1.0-pro') to use for the completion.

Prompt

SubType string

List of text predictions made by the model.

The number of candidate tokens generated by the Gemini model.

The number of tokens used in the input prompt.

The total number of tokens processed by the Gemini model (prompt + generated).