
Google Cloud MultimodalCompletion
CertifiedGenerate multimodal completions with Vertex AI
Google Cloud MultimodalCompletion
Generate multimodal completions with Vertex AI
Sends text and/or media parts to a Vertex multimodal model and returns the response.
type: io.kestra.plugin.gcp.vertexai.MultimodalCompletionExamples
Text completion using the Vertex Gemini API
id: gcp_vertexai_multimodal_completion
namespace: company.team
tasks:
- id: multimodal_completion
type: io.kestra.plugin.gcp.vertexai.MultimodalCompletion
region: us-central1
projectId: my-project
contents:
- content: Please tell me a joke
Multimodal completion using the Vertex Gemini API
id: gcp_vertexai_multimodal_completion
namespace: company.team
inputs:
- id: image
type: FILE
tasks:
- id: multimodal_completion
type: io.kestra.plugin.gcp.vertexai.MultimodalCompletion
region: us-central1
projectId: my-project
contents:
- content: Can you describe this image?
- mimeType: image/jpeg
content: "{{ inputs.image }}"
Properties
contents *Requiredarray
1Prompt parts
Ordered list of text or media parts sent to the model
io.kestra.plugin.gcp.vertexai.MultimodalCompletion-Content
The content itself, should be a string for text content or a Kestra internal storage URI for other content types
If the content is not text, the mimeType property must be set.
Mime type of the content, use it only when the content is not text
region *Requiredstring
Region
Vertex AI region used for the API endpoint
impersonatedServiceAccount string
The GCP service account to impersonate
modelId string
gemini-proModel ID
Vertex model name (e.g., gemini-1.5-flash); defaults to gemini-pro
parameters Non-dynamic
{
"temperature": 0.2,
"maxOutputTokens": 128,
"topK": 40,
"topP": 0.95
}Model parameters
Temperature/topK/topP/maxOutputTokens generation settings
io.kestra.plugin.gcp.vertexai.AbstractGenerativeAi-ModelParameter
128>= 1<= 1024Maximum number of tokens that can be generated in the response
Specify a lower value for shorter responses and a higher value for longer responses. A token may be smaller than a word. A token is approximately four characters. 100 tokens correspond to roughly 60-80 words.
0.2> <= 1Temperature used for sampling during the response generation, which occurs when topP and topK are applied
Temperature controls the degree of randomness in token selection. Lower temperatures are good for prompts that require a more deterministic and less open-ended or creative response, while higher temperatures can lead to more diverse or creative results. A temperature close to 0 is nearly deterministic: the highest probability response is almost always selected. For most use cases, try starting with a temperature of 0.2.
40>= 1<= 40Top-k changes how the model selects tokens for output
A top-k of 1 means the selected token is the most probable among all tokens in the model's vocabulary (also called greedy decoding), while a top-k of 3 means that the next token is selected from among the 3 most probable tokens (using temperature). For each token selection step, the top K tokens with the highest probabilities are sampled. Then tokens are further filtered based on topP with the final token selected using temperature sampling. Specify a lower value for less random responses and a higher value for more random responses.
0.95> <= 1Top-p changes how the model selects tokens for output
Tokens are selected from most K (see topK parameter) probable to least until the sum of their probabilities equals the top-p value. For example, if tokens A, B, and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, then the model will select either A or B as the next token (using temperature) and doesn't consider C. The default top-p value is 0.95. Specify a lower value for less random responses and a higher value for more random responses.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
projectId string
The GCP project ID
scopes array
["https://www.googleapis.com/auth/cloud-platform"]The GCP scopes to be used
serviceAccount string
The GCP service account
Outputs
blocked boolean
falseWhether the response has been blocked for safety reasons
finishReason string
The reason the generation has finished
safetyRatings array
The response safety ratings
io.kestra.plugin.gcp.vertexai.MultimodalCompletion-SafetyRating
Whether the response has been blocked for safety reasons
Safety category
Safety rating probability
text string
The generated response text
Metrics
candidate.token.count counter
Number of tokens in the candidate response.
prompt.token.count counter
Number of tokens in the prompt.
serialized.size counter
bytesSize of the serialized metadata.
total.token.count counter
Total number of tokens (prompt + candidate).