ChatCompletion
type: "io.kestra.plugin.gcp.vertexai.ChatCompletion"
Chat completion using the Vertex AI for Google's Gemini large language models (LLM).
See Generative AI quickstart using the Vertex AI API for more information.
Examples
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
context: I love jokes that talk about sport
messages:
- author: user
content: Please tell me a joke
Properties
messages
- Type: array
- SubType: ChatCompletion-Message
- Dynamic: ✔️
- Required: ✔️
- Min items:
1
Chat 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.
region
- Type: string
- Dynamic: ✔️
- Required: ✔️
The GCP region.
context
- Type: string
- Dynamic: ✔️
- Required: ❌
For backward compatibility, since migration to Gemini LLM this property will be the first message to be send to the chat.
examples
- Type: array
- SubType: ChatCompletion-Example
- Dynamic: ✔️
- Required: ❌
This property is not used anymore since migration to Gemini LLM.
history
- Type: array
- SubType: ChatCompletion-Message
- Dynamic: ✔️
- Required: ❌
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.
impersonatedServiceAccount
- Type: string
- Dynamic: ✔️
- Required: ❌
The GCP service account to impersonate.
parameters
- Type: AbstractGenerativeAi-ModelParameter
- Dynamic: ❌
- Required: ❌
- Default:
{ "temperature": 0.2, "maxOutputTokens": 128, "topK": 40, "topP": 0.95 }
The model parameters.
projectId
- Type: string
- Dynamic: ✔️
- Required: ❌
The GCP project ID.
scopes
- Type: array
- SubType: string
- Dynamic: ✔️
- Required: ❌
- Default:
[ "https://www.googleapis.com/auth/cloud-platform" ]
The GCP scopes to be used.
serviceAccount
- Type: string
- Dynamic: ✔️
- Required: ❌
The GCP service account.
Outputs
predictions
- Type: array
- SubType: AbstractGenerativeAi-Prediction
- Required: ❌
Definitions
io.kestra.plugin.gcp.vertexai.ChatCompletion-Example
input
- Type: string
- Dynamic: ✔️
- Required: ✔️
output
- Type: string
- Dynamic: ✔️
- Required: ✔️
io.kestra.plugin.gcp.vertexai.AbstractGenerativeAi-Prediction
citationMetadata
- Type: AbstractGenerativeAi-CitationMetadata
- Dynamic: ❌
- Required: ❓
content
- Type: string
- Dynamic: ❌
- Required: ❓
safetyAttributes
- Type: AbstractGenerativeAi-SafetyAttributes
- Dynamic: ❌
- Required: ❓
io.kestra.plugin.gcp.vertexai.ChatCompletion-Message
content
- Type: string
- Dynamic: ✔️
- Required: ✔️
author
- Type: string
- Dynamic: ✔️
- Required: ❌
io.kestra.plugin.gcp.vertexai.AbstractGenerativeAi-SafetyAttributes
blocked
- Type: boolean
- Dynamic: ❌
- Required: ❓
categories
- Type: array
- SubType: string
- Dynamic: ❌
- Required: ❓
scores
- Type: array
- SubType: number
- Dynamic: ❌
- Required: ❓
io.kestra.plugin.gcp.vertexai.AbstractGenerativeAi-ModelParameter
maxOutputTokens
- Type: integer
- Dynamic: ❌
- Required: ❌
- Default:
128
- Minimum:
›= 1
- Maximum:
‹= 1024
temperature
- Type: number
- Dynamic: ❌
- Required: ❌
- Default:
0.2
- Minimum:
›
- Maximum:
‹= 1
topK
- Type: integer
- Dynamic: ❌
- Required: ❌
- Default:
40
- Minimum:
›= 1
- Maximum:
‹= 40
topP
- Type: number
- Dynamic: ❌
- Required: ❌
- Default:
0.95
- Minimum:
›
- Maximum:
‹= 1
io.kestra.plugin.gcp.vertexai.AbstractGenerativeAi-CitationMetadata
citations
- Type: array
- SubType: AbstractGenerativeAi-Citation
- Dynamic: ❌
- Required: ❓
io.kestra.plugin.gcp.vertexai.AbstractGenerativeAi-Citation
citations
- Type: array
- SubType: string
- Dynamic: ❌
- Required: ❓