
Google Cloud Vertex AI ChatCompletion
CertifiedGenerate chat completions with Vertex AI
Google Cloud Vertex AI ChatCompletion
Generate chat completions with Vertex AI
Produces chat-style responses using the configured Vertex model and generation parameters.
type: io.kestra.plugin.gcp.vertexai.ChatCompletionExamples
Chat completion using the Vertex AI Gemini API
id: gcp_vertexai_chat_completion
namespace: company.team
tasks:
- id: chat_completion
type: io.kestra.plugin.gcp.vertexai.ChatCompletion
region: us-central1
projectId: my-project
messages:
- content: Please tell me a joke that talks about sport
Installation
Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:
kestractl plugins get io.kestra.plugin:plugin-gcp --compatible-for $KESTRA_VERSION For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.
Properties
messages *array
1Chat messages
Messages appear in chronological order: oldest first, newest last. When the history of messages causes the input to exceed the maximum length, the oldest messages are removed until the entire prompt is within the allowed limit.
io.kestra.plugin.gcp.vertexai.ChatCompletion-Message
This property is not used anymore since migration to Gemini LLM
region *string
Region
Vertex AI region used for the API endpoint
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150history array
Conversation history provided to the model
Messages appear in chronological order: oldest first, newest last. When the history of messages causes the input to exceed the maximum length, the oldest messages are removed until the entire prompt is within the allowed limit.
io.kestra.plugin.gcp.vertexai.ChatCompletion-Message
This property is not used anymore since migration to Gemini LLM
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
{
"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.
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
When unset or rendered to an empty value, Application Default Credentials are used (e.g. GOOGLE_APPLICATION_CREDENTIALS or the runtime's attached identity).
workloadIdentityAudience string
Audience of the Workload Identity Federation provider
The full resource name of the workload identity pool provider, //iam.googleapis.com/projects/<number>/locations/global/workloadIdentityPools/<pool>/providers/<provider>.
Required with workloadIdentityToken, and must match the aud claim of the token.
workloadIdentityToken string
OIDC token for Workload Identity Federation
When set together with workloadIdentityAudience, the token is exchanged at Google STS for federated credentials and no service account key is needed: Google verifies it against the identity provider that issued it.
Use {{ oidcToken(audience='…') }} to have Kestra Enterprise mint one for the running execution.
Combine with impersonatedServiceAccount to act as a service account the pool may impersonate, and set projectId explicitly since no key file carries it.
Cannot be combined with serviceAccount.
Outputs
predictions array
List of text predictions made by the model
io.kestra.plugin.gcp.vertexai.AbstractGenerativeAi-Prediction
Citation metadata for the generated content
io.kestra.plugin.gcp.vertexai.AbstractGenerativeAi-CitationMetadata
List of citation sources
io.kestra.plugin.gcp.vertexai.AbstractGenerativeAi-Citation
Citation source titles
Generated text content; null when the candidate was blocked by safety or moderation filters (see safetyAttributes.blocked)
Safety attributes and moderation details
io.kestra.plugin.gcp.vertexai.AbstractGenerativeAi-SafetyAttributes
Whether the response was blocked by safety filters or moderation reasons (SAFETY, RECITATION, BLOCKLIST, PROHIBITED_CONTENT, SPII, MODEL_ARMOR)
Safety categories evaluated for the response
Severity scores for each safety category
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).