GoogleAI conversation
Type: conversation.googleai
Status: alpha
Reference: https://docs.dapr.io/reference/components-reference/supported-conversation/googleai/
Example
apiVersion: cra.diagrid.io/v1beta1
kind: Component
metadata:
name: <name>
spec:
type: conversation.googleai
version: v1
metadata:
# API key for GoogleAI.
- name: key
value: |
**********
# A time-to-live value for a prompt cache to expire. Uses Golang durations (Optional)
#- name: cacheTTL
# value: "10m"
# OpenAI-compatible endpoint URL. If not specified, the Gemini API OpenAI-compatible endpoint is used. (Optional)
#- name: endpoint
# value: "https://generativelanguage.googleapis.com/v1beta/openai/"
# HTTP headers to send on every request to the model endpoint, as a JSON object of header names to string values. Use it for headers that a gateway or proxy in front of the provider requires, for example a tenant ID or a gateway key. A header in this field replaces the header of the same name that the component sets. This includes the Authorization header that the component builds from key. Without workload identity federation, key is still required, so set key to any non-empty value if the gateway does its own authentication. Host, Content-Length and hop-by-hop headers are not allowed. When this field is set, the component does not follow redirects to a different origin. With workload identity federation, the component does not send these headers to the token endpoints. The access token sets the Authorization header. (Optional)
#- name: headers
# value: "{"X-Tenant-ID": "tenant-a", "X-Gateway-Key": "**********"}"
# Default maximum number of tokens the model may generate per request. A request-level maxTokens value greater than zero overrides this default. When unset, no cap is sent and the provider's own default applies. (Optional)
#- name: maxTokens
# value: "2048"
# The GoogleAI LLM to use. Configurable via GOOGLEAI_MODEL environment variable. (Optional)
#- name: model
# value: "gemini-2.5-flash-lite"
Authentication profiles
Available authentication profiles:
-
API Key
-
Google Cloud workload identity federation (SPIFFE)
API Key
Authenticate using an API key
key (string)
Required - API key for GoogleAI.
Example value:
**********
Google Cloud workload identity federation (SPIFFE)
Authenticate without an API key. The Dapr runtime mints a JWT SVID for the app's SPIFFE ID, which Google Cloud's Security Token Service exchanges for a short-lived access token. Requires mTLS and Sentry JWT issuing, with Sentry registered as an OIDC provider in a workload identity pool. Use with an endpoint that accepts Google access tokens, such as the Vertex AI OpenAI-compatible endpoint.
workloadIdentityProvider (string)
Required - Full resource name of the workload identity pool provider. Also used as the audience of the JWT SVID.
Example value: //iam.googleapis.com/projects/123456789/locations/global/workloadIdentityPools/dapr/providers/sentry
serviceAccountEmail (string)
Email of the service account to impersonate. If not set, the federated token is used directly.
Example value: dapr-ai@my-project.iam.gserviceaccount.com
Metadata
cacheTTL (string)
A time-to-live value for a prompt cache to expire. Uses Golang durations
Example value: 10m
endpoint (string)
OpenAI-compatible endpoint URL. If not specified, the Gemini API OpenAI-compatible endpoint is used.
Default value: https://generativelanguage.googleapis.com/v1beta/openai/
Example value: https://us-central1-aiplatform.googleapis.com/v1/projects/my-project/locations/us-central1/endpoints/openapi
headers (string)
HTTP headers to send on every request to the model endpoint, as a JSON object of header names to string values. Use it for headers that a gateway or proxy in front of the provider requires, for example a tenant ID or a gateway key. A header in this field replaces the header of the same name that the component sets. This includes the Authorization header that the component builds from key. Without workload identity federation, key is still required, so set key to any non-empty value if the gateway does its own authentication. Host, Content-Length and hop-by-hop headers are not allowed. When this field is set, the component does not follow redirects to a different origin. With workload identity federation, the component does not send these headers to the token endpoints. The access token sets the Authorization header.
Example value: {"X-Tenant-ID": "tenant-a", "X-Gateway-Key": "**********"}
maxTokens (number)
Default maximum number of tokens the model may generate per request. A request-level maxTokens value greater than zero overrides this default. When unset, no cap is sent and the provider's own default applies.
Example value: 2048
model (string)
The GoogleAI LLM to use. Configurable via GOOGLEAI_MODEL environment variable.
Default value: gemini-2.5-flash-lite
Example value: gemini-2.5-flash-lite