Method: projects.locations.chat

產生 Message 物件串流,回答資料相關問題。

HTTP 要求


POST https://geminidataanalytics.googleapis.com/v1alpha/{parent=projects/*/locations/*}:chat

這些網址使用 gRPC 轉碼語法。

路徑參數

參數
parent

string

這是必要旗標,即時通訊要求的父項值。圖案:projects/{project}/locations/{location}

要求主體

要求主體包含下列結構的資料:

JSON 表示法
{
  "project": string,
  "messages": [
    {
      object (Message)
    }
  ],

  // 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.
}
欄位
project
(deprecated)

string

選用。用於配額和帳單的 Google Cloud 專案。

messages[]

object (Message)

這是必要旗標,目前對話的內容。

聯集欄位 context_provider。即時通訊要求的內容供應者。可以是 inline_context (要求中提供的內嵌背景資訊)、data_agent (資料代理程式資源的參照),或是 conversation_reference (使用 conversation_id 和 agent_id 參照持續性對話和背景資訊)。context_provider 只能是下列其中一個設定:
inlineContext

object (Context)

選用。即時通訊要求的內嵌情境。您可以透過內嵌傳遞所有背景資訊,以無狀態方式進行對話 (不含受管理的對話持續性,也不含代理程式)。

conversationReference

object (ConversationReference)

選用。參照持續進行的對話和代理程式背景資訊。使用這項功能與服務專員進行即時通訊,並管理對話保留時間。

dataAgentContext

object (DataAgentContext)

選用。即時通訊要求的背景資訊。使用這項功能與代理程式進行無狀態對話,不必管理對話的持續性。

clientManagedResourceContext

object (ClientManagedResourceContext)

選用。使用用戶端管理的資源時的背景資訊。部分客戶可能不會使用 GDA 管理的資源 (包括對話和代理程式),而是自行建立及管理對話和代理程式資源。

回應主體

如果成功,回應主體會包含 Message 例項的串流。

授權範圍

需要下列 OAuth 範圍:

  • https://www.googleapis.com/auth/cloud-platform

詳情請參閱Authentication Overview

ConversationReference

參考持續進行的對話和代理程式背景資訊。

JSON 表示法
{
  "conversation": string,
  "dataAgentContext": {
    object (DataAgentContext)
  }
}
欄位
conversation

string

這是必要旗標,對話資源名稱。格式:projects/{project}/locations/{location}/conversations/{conversationId}

dataAgentContext

object (DataAgentContext)

這是必要旗標,使用資料代理程式的對話要求背景資訊。

DataAgentContext

使用資料代理程式的對話要求背景資訊。

JSON 表示法
{
  "dataAgent": string,
  "credentials": {
    object (Credentials)
  },
  "contextVersion": enum (ContextVersion)
}
欄位
dataAgent

string

這是必要旗標,資料代理程式資源的名稱。

credentials

object (Credentials)

選用。呼叫 Looker 資料來源時使用的憑證。

目前支援 OAuth 權杖和 API 金鑰型憑證,詳情請參閱「使用 SDK 進行驗證」。

contextVersion

enum (ContextVersion)

選用。DCS 要使用的內容版本 (例如 STAGING、PUBLISHED)

ContextVersion

DCS 支援的脈絡版本清單。情境有兩個版本。這是為了維護資料代理程式的版本管理。

列舉
CONTEXT_VERSION_UNSPECIFIED 未指定或無法辨識。
STAGING 使用這個版本時,DCS 會將最新的暫存環境用於資料代理程式。
PUBLISHED 使用這個版本時,DCS 會將最新發布的內容用於資料代理程式。

ClientManagedResourceContext

使用用戶端管理的資源時的背景資訊。部分客戶可能不會使用 GDA 管理的資源 (包括對話和代理程式),而是自行建立及管理對話和代理程式資源。

JSON 表示法
{
  "inlineContext": {
    object (Context)
  },
  "conversationId": string,
  "agentId": string
}
欄位
inlineContext

object (Context)

這是必要旗標,即時通訊要求的背景資訊。您可以透過內嵌傳遞所有內容,在沒有 GDA API 管理的對話和代理程式持續性下進行對話。

conversationId

string

選用。用戶端管理的對話 ID。

agentId

string

選用。客戶管理的代理商 ID。