- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- ConversationReference
- DataAgentContext
- ContextVersion
- ClientManagedResourceContext
- LookerSettings
- Credentials
- OAuthCredentials
- SecretBased
- TokenBased
- ThinkingMode
- Model
Answers a data question by generating a stream of Message objects.
HTTP request
POST https://geminidataanalytics.googleapis.com/v1/{parent=projects/*/locations/*}:chat
The URL uses gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
parent |
Required. The parent value for chat request. Pattern: |
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{ "messages": [ { object ( |
| Fields | |
|---|---|
messages[] |
Required. Content of current conversation. |
credentials |
Optional. The credentials to use when calling the data source(s) specified in the context. This field can be used to provide credentials for various data sources. For example, when connecting to Looker, it currently supports both OAuth token and API key-based credentials, as described in Authentication with an SDK. |
thinkingMode |
Optional. The thinking mode to use for the agent loop. Defaults to THINKING_MODE_UNSPECIFIED if not specified. |
model |
Optional. The model to use for the agent loop when processing the request. This setting only has an effect when context.options.model is not set. |
Union field context_provider. Context Provider for the chat request. It can either be - inline_context, which is a context provided inline in the request. data_agent, which is a reference to a data agent resource. conversation_reference, which is a reference to a persisted conversation and context using conversation_id and agent_id. context_provider can be only one of the following: |
|
inlineContext |
Optional. Inline context for the chat request. Use this to chat statelessly (without managed conversation persistence and without an Agent) by passing all context inline. |
conversationReference |
Optional. Reference to a persisted conversation and agent context. Use this to chat with an Agent using managed conversation persistence. |
dataAgentContext |
Optional. Context for the chat request. Use this to chat with an Agent statelessly, without managed conversation persistence. |
clientManagedResourceContext |
Optional. Context with client managed resources. Some clients may not use GDA managed resources including conversations and agents, instead they create and manage their own conversations and agents resources. |
Union field datasource_settings. Optional settings to customize request behavior, specific to the target datasource. datasource_settings can be only one of the following: |
|
lookerSettings |
Optional. Looker specific settings. |
Response body
If successful, the response body contains a stream of Message instances.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
ConversationReference
Reference to a persisted conversation and agent context.
| JSON representation |
|---|
{
"conversation": string,
"dataAgentContext": {
object ( |
| Fields | |
|---|---|
conversation |
Required. Name of the conversation resource. Format: |
dataAgentContext |
Required. Context for the chat request using a data agent. |
DataAgentContext
Context for the chat request using a data agent.
| JSON representation |
|---|
{
"dataAgent": string,
"contextVersion": enum ( |
| Fields | |
|---|---|
dataAgent |
Required. The name of the data agent resource. |
contextVersion |
Optional. Version of context to be used by DCS (e.g. STAGING, PUBLISHED) |
ContextVersion
List of context versions supported by DCS. There are two versions of context. This is to maintain versioning for the data agent.
| Enums | |
|---|---|
CONTEXT_VERSION_UNSPECIFIED |
Unspecified or unrecognized. |
STAGING |
Using this version, DCS will use the latest staging context for the data agent. |
PUBLISHED |
Using this version, DCS will use the latest published context for the data agent. |
ClientManagedResourceContext
Context with client managed resources. Some clients may not use GDA managed resources including conversations and agents, instead they create and manage their own conversations and agents resources.
| JSON representation |
|---|
{
"inlineContext": {
object ( |
| Fields | |
|---|---|
inlineContext |
Required. Context for the chat request. Use this to chat without GDA API managed conversation and agent persistence by passing all context inline. |
conversationId |
Optional. The client managed conversation id. |
agentId |
Optional. The client managed agent id. |
LookerSettings
Message to hold Looker specific custom settings.
| JSON representation |
|---|
{ "enableDevMode": boolean } |
| Fields | |
|---|---|
enableDevMode |
Optional. Whether to operate in Looker's Development Mode. If true, the API session will be switched to the "dev" workspace, allowing interaction with LookML changes in the user's development branch. If false or unset, the session remains in the default state (Production Mode). See https://cloud.google.com/looker/docs/dev-mode-prod-mode. |
Credentials
Represents different forms of credential specification.
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field kind. The kind of credentials. kind can be only one of the following: |
|
oauth |
OAuth credentials. |
OAuthCredentials
Represents OAuth credentials.
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field kind. The kind of OAuth credentials. kind can be only one of the following: |
|
secret |
Secret-based OAuth credentials. |
token |
Token-based OAuth credentials. |
SecretBased
The name of the secret containing the access token. Represents secret-based OAuth credentials.
| JSON representation |
|---|
{ "clientId": string, "clientSecret": string } |
| Fields | |
|---|---|
clientId |
Required. An OAuth client ID. |
clientSecret |
Required. An OAuth client secret. |
TokenBased
Read more about Looker access tokens here: https://developers.looker.com/api/advanced-usage/looker-api-oauth
| JSON representation |
|---|
{ "accessToken": string } |
| Fields | |
|---|---|
accessToken |
Required. The name of the secret containing the access token. |
ThinkingMode
Mode of thinking for the agent.
| Enums | |
|---|---|
THINKING_MODE_UNSPECIFIED |
Unspecified thinking mode, agent will use THINKING mode by default except for BigQuery user defaulting to FAST mode by default. |
FAST |
Fast mode, answers quickly. |
THINKING |
Thinking mode, solves complex problems. |
Model
Model selection for the agent for BigQuery users.
| Enums | |
|---|---|
MODEL_UNSPECIFIED |
No model specified. Either preview or non preview model can be used. |
LATEST_GA_MODEL |
Use the most up-to-date non-preview model. This may constrain certain request level settings. |