Message

使用者與系統互動時傳送的訊息。

JSON 表示法
{
  "timestamp": string,
  "messageId": string,

  // Union field kind can be only one of the following:
  "userMessage": {
    object (UserMessage)
  },
  "systemMessage": {
    object (SystemMessage)
  }
  // End of list of possible types for union field kind.
}
欄位
timestamp

string (Timestamp format)

僅供輸出。如果是使用者訊息,這是指系統收到訊息的時間。如果是系統訊息,則為系統產生訊息的時間。

使用 RFC 3339,產生的輸出內容一律會經過 Z 正規化,並使用 0、3、6 或 9 個小數位數,也接受「Z」以外的偏移量。範例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

messageId

string

選用。對話中訊息的專屬 ID,用於保存對話。

聯集欄位 kind。訊息類型。kind 只能是下列其中一個設定:
userMessage

object (UserMessage)

與系統互動的使用者傳送的訊息。

systemMessage

object (SystemMessage)

系統回覆使用者的訊息。

UserMessage

與系統互動的使用者傳送的訊息。

JSON 表示法
{

  // Union field kind can be only one of the following:
  "text": string
  // End of list of possible types for union field kind.
}
欄位
聯集欄位 kind。使用者訊息中的內容類型。kind 只能是下列其中一個設定:
text

string

文字應使用這個欄位,而非 Blob。

SystemMessage

系統回覆使用者的訊息。這則訊息也可以是使用者傳送的訊息,做為系統多輪對話的歷史脈絡。

JSON 表示法
{
  "citation": {
    object (Citation)
  },

  // Union field kind can be only one of the following:
  "text": {
    object (TextMessage)
  },
  "schema": {
    object (SchemaMessage)
  },
  "data": {
    object (DataMessage)
  },
  "analysis": {
    object (AnalysisMessage)
  },
  "chart": {
    object (ChartMessage)
  },
  "error": {
    object (ErrorMessage)
  },
  "exampleQueries": {
    object (ExampleQueries)
  }
  // End of list of possible types for union field kind.
  "groupId": integer
}
欄位
citation

object (Citation)

僅供輸出。系統訊息的引用資訊。

聯集欄位 kind。系統訊息中的內容類型。kind 只能是下列其中一個設定:
text

object (TextMessage)

直接以自然語言回覆使用者訊息。

schema

object (SchemaMessage)

結構定義解析期間產生的訊息。

data

object (DataMessage)

在資料擷取期間產生的訊息。

analysis

object (AnalysisMessage)

分析期間產生的訊息。

chart

object (ChartMessage)

圖表生成期間產生的訊息。

error

object (ErrorMessage)

錯誤訊息。

exampleQueries

object (ExampleQueries)

選用。包含查詢範例的訊息。

groupId

integer

用於識別事件所屬的群組。類似事件在邏輯上互有關聯,應在 UI 中一併顯示。

TextMessage

包含多個部分的簡訊。

JSON 表示法
{
  "parts": [
    string
  ],
  "textType": enum (TextType),
  "thoughtSignature": string
}
欄位
parts[]

string

選用。郵件的各個部分。

textType

enum (TextType)

選用。簡訊類型。

thoughtSignature

string (bytes format)

選用。想法的不透明簽章,可在後續要求中重複使用。

Base64 編碼字串。

TextType

簡訊類型。

列舉
TEXT_TYPE_UNSPECIFIED 預設文字類型。
FINAL_RESPONSE 這段文字是使用者問題的最終回覆。
THOUGHT 這段文字是模型生成的想法。
PROGRESS 這段文字是關於代理程式進度的資訊訊息,例如工具的叫用情形。這與代理的內部思考過程 (THOUGHT) 和給使用者的最終答案 (FINAL_RESPONSE) 不同。這些訊息可深入瞭解代理的動作。
FOLLOWUP_QUESTIONS 這段文字是建議的後續問題清單。parts 中的每個項目都是後續問題。

SchemaMessage

結構定義解析期間產生的訊息。

JSON 表示法
{

  // Union field kind can be only one of the following:
  "query": {
    object (SchemaQuery)
  },
  "result": {
    object (SchemaResult)
  }
  // End of list of possible types for union field kind.
}
欄位
聯集欄位 kind。這則訊息是否包含查詢或結構定義解析結果。kind 只能是下列其中一個設定:
query

object (SchemaQuery)

結構定義解析查詢。

result

object (SchemaResult)

結構定義解析查詢的結果。

SchemaQuery

查詢,用於解決與所提問題相關的結構定義。

JSON 表示法
{
  "question": string
}
欄位
question

string

選用。要傳送給系統以解析結構定義的問題。

SchemaResult

結構定義解析結果。

JSON 表示法
{
  "datasources": [
    {
      object (Datasource)
    }
  ]
}
欄位
datasources[]

object (Datasource)

選用。用於解析結構定義查詢的資料來源。

資料來源

可用於回答問題的資料來源。

JSON 表示法
{
  "schema": {
    object (Schema)
  },
  "structSchema": {
    object
  },

  // Union field reference can be only one of the following:
  "bigqueryTableReference": {
    object (BigQueryTableReference)
  },
  "studioDatasourceId": string,
  "lookerExploreReference": {
    object (LookerExploreReference)
  },
  "bigqueryPropertyGraphReference": {
    object (BigQueryPropertyGraphReference)
  }
  // End of list of possible types for union field reference.
}
欄位
schema

object (Schema)

選用。資料來源的結構定義。

structSchema

object (Struct format)

選用。結構定義的結構體表示法。如果資料來源的結構定義無法完全以強型別的 schema 欄位表示,系統就會填入這個欄位。

如果是 Looker 資料來源,這會對應至 LookmlModelExplore 型別:https://cloud.google.com/looker/docs/reference/looker-api/latest/types/LookmlModelExplore

聯集欄位 reference。資料來源的參照。reference 只能是下列其中一個設定:
bigqueryTableReference

object (BigQueryTableReference)

BigQuery 資料表的參照。

studioDatasourceId

string

Looker Studio 資料來源的參照。

lookerExploreReference

object (LookerExploreReference)

Looker 探索的參照。

bigqueryPropertyGraphReference

object (BigQueryPropertyGraphReference)

BigQuery 屬性圖的參照。

BigQueryPropertyGraphReference

代表單一 BigQuery 屬性圖參考資料的訊息。

JSON 表示法
{
  "projectId": string,
  "datasetId": string,
  "propertyGraphId": string
}
欄位
projectId

string

這是必要旗標,屬性圖所屬的專案。

datasetId

string

這是必要旗標,屬性圖所屬的資料集。

propertyGraphId

string

這是必要旗標,屬性圖 ID。

DataMessage

在資料擷取期間產生的訊息。

JSON 表示法
{

  // Union field kind can be only one of the following:
  "query": {
    object (DataQuery)
  },
  "generatedSql": string,
  "result": {
    object (DataResult)
  },
  "bigQueryJob": {
    object (BigQueryJob)
  },
  "matchedQuery": {
    object (MatchedQuery)
  }
  // End of list of possible types for union field kind.
}
欄位
聯集欄位 kind。這則訊息是否包含查詢、結果,或是擷取資料時產生的 SQL。kind 只能是下列其中一個設定:
query

object (DataQuery)

資料擷取查詢。

generatedSql

string

系統生成的 SQL,用於擷取資料。

result

object (DataResult)

已擷取的資料。

bigQueryJob

object (BigQueryJob)

系統執行的 BigQuery 工作,用於擷取資料。

matchedQuery

object (MatchedQuery)

系統比對後擷取資料的現有查詢。

DataQuery

用於擷取資料的查詢。

JSON 表示法
{
  "question": string,
  "name": string,
  "datasources": [
    {
      object (Datasource)
    }
  ],

  // Union field query_type can be only one of the following:
  "looker": {
    object (LookerQuery)
  }
  // End of list of possible types for union field query_type.
}
欄位
question

string

選用。要回答的自然語言問題。

name

string

選用。查詢的蛇形命名名稱,反映查詢意圖。用於命名對應的資料結果,以便在後續步驟中參照。

  • 例如:「total_sales_by_product」
  • 例如:「sales_for_product_12345」
datasources[]

object (Datasource)

選用。可用於回答問題的資料來源。

聯集欄位 query_type。要執行的查詢類型。query_type 只能是下列其中一個設定:
looker

object (LookerQuery)

選用。查詢,用於從 Looker 探索擷取資料。

DataResult

已擷取的資料。

JSON 表示法
{
  "name": string,
  "schema": {
    object (Schema)
  },
  "data": [
    {
      object
    }
  ],
  "formattedData": [
    {
      object
    }
  ]
}
欄位
name

string

選用。資料結果的蛇形命名法名稱,可反映其內容。這個名稱用於依參照傳遞結果,並做為其意義的信號。

  • 例如:「total_sales_by_product」
  • 例如:「sales_for_product_12345」
schema

object (Schema)

選用。資料的結構定義。

data[]

object (Struct format)

選用。資料內容。每個資料列都是符合結構定義的結構體。簡單值會以字串表示,巢狀結構則會以清單或結構體表示。

formattedData[]

object (Struct format)

選用。資料的格式化表示法 (如適用)。每個資料列都是一個結構體,直接對應至 data 欄位中相同索引的資料列。這些值是原始資料的字串表示法,並根據資料來源規格格式化 (例如貨幣的「$1,234.56」)。沒有格式的資料欄會預設為原始值表示法。如果沒有任何欄位套用格式規則,這個欄位會留空。

BigQueryJob

系統執行的 BigQuery 工作。

JSON 表示法
{
  "projectId": string,
  "jobId": string,
  "location": string,
  "destinationTable": {
    object (BigQueryTableReference)
  },
  "schema": {
    object (Schema)
  }
}
欄位
projectId

string

這是必要旗標,工作所屬的專案。

請參閱 JobReference

jobId

string

這是必要旗標,工作 ID。

請參閱 JobReference

location

string

選用。工作地點。

請參閱 JobReference

destinationTable

object (BigQueryTableReference)

選用。工作查詢結果目的地資料表的參照。

請參閱 JobConfigurationQuery

schema

object (Schema)

選用。工作查詢結果的結構定義。

請參閱 JobStatistics2

MatchedQuery

如果代理程式判斷目前的問題適用於內容中提供的其中一個查詢範例,就會顯示相符的查詢訊息。比對程序也會提供其他資訊。

JSON 表示法
{
  "exampleQuery": {
    object (ExampleQuery)
  },
  "queryParameterValues": [
    {
      object (QueryParameterValues)
    }
  ]
}
欄位
exampleQuery

object (ExampleQuery)

根據查詢範例比對出的查詢。

queryParameterValues[]

object (QueryParameterValues)

查詢參數的擷取值。

QueryParameterValues

查詢參數值訊息代表 LLM 根據範例查詢,從使用者問題中擷取的查詢參數值。

JSON 表示法
{
  "name": string,
  "value": string
}
欄位
name

string

這是必要旗標,參數的名稱。

value

string

這是必要旗標,參數的值。

AnalysisMessage

分析期間產生的訊息。

JSON 表示法
{

  // Union field kind can be only one of the following:
  "query": {
    object (AnalysisQuery)
  },
  "progressEvent": {
    object (AnalysisEvent)
  }
  // End of list of possible types for union field kind.
}
欄位
聯集欄位 kind。這封郵件是否包含查詢或分析中的其中一個事件。kind 只能是下列其中一個設定:
query

object (AnalysisQuery)

分析查詢。

progressEvent

object (AnalysisEvent)

表示分析進度的事件。

AnalysisQuery

用於執行分析的查詢。

JSON 表示法
{
  "question": string,
  "dataResultNames": [
    string
  ]
}
欄位
question

string

選用。分析問題,協助解答使用者的原始問題。

dataResultNames[]

string

選用。要分析的先前擷取資料結果名稱。

AnalysisEvent

表示分析進度的事件。

JSON 表示法
{

  // Union field kind can be only one of the following:
  "plannerReasoning": string,
  "coderInstruction": string,
  "code": string,
  "executionOutput": string,
  "executionError": string,
  "resultVegaChartJson": string,
  "resultNaturalLanguage": string,
  "resultCsvData": string,
  "resultReferenceData": string,
  "error": string
  // End of list of possible types for union field kind.
}
欄位
聯集欄位 kind。分析期間發生的事件類型。kind 只能是下列其中一個設定:
plannerReasoning

string

Python 程式碼產生器規劃工具的推論。

coderInstruction

string

生成程式碼的指令。

code

string

產生的程式碼。

executionOutput

string

執行程式碼的輸出內容。

executionError

string

執行程式碼時發生錯誤。

resultVegaChartJson

string

結果為 Vega 圖表 JSON 字串。

resultNaturalLanguage

string

以 NL 字串形式傳回結果。

resultCsvData

string

以 CSV 字串形式呈現結果。

resultReferenceData

string

結果做為資料來源的參照。

error

string

一般錯誤訊息。

ChartMessage

圖表生成期間產生的訊息。

JSON 表示法
{

  // Union field kind can be only one of the following:
  "query": {
    object (ChartQuery)
  },
  "result": {
    object (ChartResult)
  }
  // End of list of possible types for union field kind.
}
欄位
聯集欄位 kind。這則訊息是否包含查詢內容或圖表生成結果。kind 只能是下列其中一個設定:
query

object (ChartQuery)

生成圖表的查詢。

result

object (ChartResult)

圖表生成查詢的結果。

ChartQuery

生成圖表的查詢。

JSON 表示法
{
  "instructions": string,
  "dataResultName": string
}
欄位
instructions

string

選用。生成圖表的自然語言指令。

dataResultName

string

選用。要在圖表中使用先前擷取的資料結果名稱。

ChartResult

圖表生成查詢的結果。

JSON 表示法
{
  "vegaConfig": {
    object
  },
  "image": {
    object (Blob)
  }
}
欄位
vegaConfig

object (Struct format)

選用。產生的 Vega 圖表設定。請參閱 https://vega.github.io/vega/docs/config/

image

object (Blob)

選用。如果是在背景資訊充足的情況下要求,就會顯示圖表。

Blob

具有 MIME 類型的資料 Blob。

JSON 表示法
{
  "mimeType": string,
  "data": string
}
欄位
mimeType

string

這是必要旗標,訊息資料的 IANA 標準 MIME 類型。

data

string (bytes format)

這是必要旗標,以位元組表示的資料。

Base64 編碼字串。

ErrorMessage

工具呼叫的錯誤訊息。這則訊息代表代理程式嘗試使用工具時發生錯誤。請注意,並非所有錯誤都會導致終止。許多錯誤都可以復原,代理程式可能會使用這則錯誤訊息中的資訊自行修正,然後重試工具呼叫或嘗試其他方法。

舉例來說,如果資料查詢失敗,代理程式可能會收到 ErrorMessage、分析該錯誤,然後產生修正後的查詢。

用戶端應謹慎解讀這則訊息,不宜視為明確的失敗。這可能是代理程式完成工作的正常疊代程序。如果直接向使用者顯示這些錯誤,但未提供相關背景資訊 (例如以「硬性失敗」的形式),可能會造成誤導。

JSON 表示法
{
  "text": string
}
欄位
text

string

僅供輸出。錯誤文字。

ExampleQueries

包含衍生和撰寫範例查詢的訊息。

JSON 表示法
{
  "exampleQueries": [
    {
      object (ExampleQuery)
    }
  ]
}
欄位
exampleQueries[]

object (ExampleQuery)

選用。衍生和撰寫的範例查詢清單,提供相關且常用的 SQL 查詢範例,以及對應的自然語言查詢 (如有)。目前僅適用於 BigQuery 資料來源。

引用內容

內容的來源出處。

JSON 表示法
{
  "sources": [
    {
      object (CitationSource)
    }
  ],
  "anchors": [
    {
      object (CitationAnchor)
    }
  ]
}
欄位
sources[]

object (CitationSource)

僅供輸出。列出引用的來源。

anchors[]

object (CitationAnchor)

僅供輸出。引用內容的錨點清單。

CitationSource

引用來源。

JSON 表示法
{
  "id": string,
  "title": string,

  // Union field source_type can be only one of the following:
  "uri": string,
  "exampleQuery": {
    object (ExampleQuery)
  },
  "glossaryTerm": {
    object (GlossaryTerm)
  }
  // End of list of possible types for union field source_type.
}
欄位
id

string

僅供輸出。來源的專屬 ID。這個 ID 是由服務產生,在單一Citation訊息的範圍內是唯一的。

title

string

僅供輸出。來源的標題。

聯集欄位 source_type。引文來源,可以是其中一種支援的類型。source_type 只能是下列其中一個設定:
uri

string

僅供輸出。做為來源的 URI,例如網路基礎網址。

exampleQuery

object (ExampleQuery)

僅供輸出。做為來源的範例查詢。

glossaryTerm

object (GlossaryTerm)

僅供輸出。做為來源的字彙表字詞。

CitationAnchor

引文的錨點。

JSON 表示法
{

  // Union field anchor_type can be only one of the following:
  "textMessageAnchor": {
    object (TextMessageCitationAnchor)
  }
  // End of list of possible types for union field anchor_type.
}
欄位
聯集欄位 anchor_type。引文的錨點,可以是其中一種支援的類型。anchor_type 只能是下列其中一個設定:
textMessageAnchor

object (TextMessageCitationAnchor)

僅供輸出。只有在引文是 TextMessage 時才設定。

TextMessageCitationAnchor

TextMessage 內的引用錨點。

JSON 表示法
{
  "partIndex": integer,
  "startOffsetBytes": integer,
  "endOffsetBytes": integer,
  "sourceIds": [
    string
  ]
}
欄位
partIndex

integer

僅供輸出。TextMessage.parts 欄位中部分的從 0 開始的索引。

startOffsetBytes

integer

僅供輸出。引用內容在部分字串中的位移值,以 UTF-8 位元組為單位 (含)。舉例來說,在「Hello, world」這段文字中,如果引用「world」,則開始位移位元組 (含) 為 7,結束位移位元組 (不含) 為 12。

endOffsetBytes

integer

僅供輸出。引文在部分字串中的結束位置 (不含),以 UTF-8 位元組為單位。舉例來說,在「Hello, world」這段文字中,如果引用「world」,則開始位移位元組 (含) 為 7,結束位移位元組 (不含) 為 12。

sourceIds[]

string

僅供輸出。所引用來源的 ID。