Method: projects.locations.chat

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

string

Required. The parent value for chat request. Pattern: projects/{project}/locations/{location}

Request body

The request body contains data with the following structure:

JSON representation
{
  "messages": [
    {
      object (Message)
    }
  ],
  "credentials": {
    object (Credentials)
  },
  "thinkingMode": enum (ThinkingMode),
  "model": enum (Model),

  // Union field context_provider can be only one of the following:
  "inlineContext": {
    object (Context)
  },
  "conversationReference": {
    object (ConversationReference)
  },
  "dataAgentContext": {
    object (DataAgentContext)
  },
  "clientManagedResourceContext": {
    object (ClientManagedResourceContext)
  }
  // End of list of possible types for union field context_provider.

  // Union field datasource_settings can be only one of the following:
  "lookerSettings": {
    object (LookerSettings)
  }
  // End of list of possible types for union field datasource_settings.
}
Fields
messages[]

object (Message)

Required. Content of current conversation.

credentials

object (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

enum (ThinkingMode)

Optional. The thinking mode to use for the agent loop. Defaults to THINKING_MODE_UNSPECIFIED if not specified.

model

enum (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

object (Context)

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

object (ConversationReference)

Optional. Reference to a persisted conversation and agent context. Use this to chat with an Agent using managed conversation persistence.

dataAgentContext

object (DataAgentContext)

Optional. Context for the chat request. Use this to chat with an Agent statelessly, without managed conversation persistence.

clientManagedResourceContext

object (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

object (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 (DataAgentContext)
  }
}
Fields
conversation

string

Required. Name of the conversation resource. Format: projects/{project}/locations/{location}/conversations/{conversationId}

dataAgentContext

object (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 (ContextVersion)
}
Fields
dataAgent

string

Required. The name of the data agent resource.

contextVersion

enum (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 (Context)
  },
  "conversationId": string,
  "agentId": string
}
Fields
inlineContext

object (Context)

Required. Context for the chat request. Use this to chat without GDA API managed conversation and agent persistence by passing all context inline.

conversationId

string

Optional. The client managed conversation id.

agentId

string

Optional. The client managed agent id.

LookerSettings

Message to hold Looker specific custom settings.

JSON representation
{
  "enableDevMode": boolean
}
Fields
enableDevMode

boolean

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 kind can be only one of the following:
  "oauth": {
    object (OAuthCredentials)
  }
  // End of list of possible types for union field kind.
}
Fields
Union field kind. The kind of credentials. kind can be only one of the following:
oauth

object (OAuthCredentials)

OAuth credentials.

OAuthCredentials

Represents OAuth credentials.

JSON representation
{

  // Union field kind can be only one of the following:
  "secret": {
    object (SecretBased)
  },
  "token": {
    object (TokenBased)
  }
  // End of list of possible types for union field kind.
}
Fields
Union field kind. The kind of OAuth credentials. kind can be only one of the following:
secret

object (SecretBased)

Secret-based OAuth credentials.

token

object (TokenBased)

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

string

Required. An OAuth client ID.

clientSecret

string

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

string

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.