Argument

JSON 表示法
{
  "name": string,
  "rawText": string,
  "textValue": string,
  "status": {
    object (Status)
  },

  // Union field value can be only one of the following:
  "intValue": string,
  "floatValue": number,
  "boolValue": boolean,
  "datetimeValue": {
    object (DateTime)
  },
  "placeValue": {
    object (Location)
  },
  "extension": {
    "@type": string,
    field1: ...,
    ...
  },
  "structuredValue": {
    object
  }
  // End of list of possible types for union field value.
}
欄位
name

string

針對輸入內容提供的引數名稱。

rawText

string

提供引數值的原始文字,包括輸入或說出的內容。

textValue

string

當查詢模式包含 $org.schema.type.Text 類型,或是預期的輸入內容有內建意圖時,指定此屬性:actions.intent.TEXTactions.intent.OPTION。請注意,針對 OPTION 意圖,我們將 textValue 設為選項鍵,上方的 rawText 會指出使用者查詢中的原始時距。

status

object (Status)

指定計算引數時發生的錯誤。舉例來說,如果使用者拒絕存取裝置位置資訊的權限,內建意圖「actions.intent.PLACE」就會傳回錯誤狀態。

聯集欄位 value。已指定下列其中一個值。value 只能是下列其中一項:
intValue

string (int64 format)

當查詢模式包含 $org.schema.type.Number 類型,或是預期的輸入內容有內建意圖時 (「assistant.intent.action.NUMBER」時就會指定)。

floatValue

number

為內建意圖指定「actions.intent.NUMBER」

boolValue

boolean

當查詢模式包含 $org.schema.type.YesNo 類型,或是預期的輸入內容有內建意圖時,就會指定:actions.intent.CONFIRMATION。注意:如果缺少布林值,則代表 false

datetimeValue

object (DateTime)

為內建意圖指定:actions.intent.DATETIME

placeValue

object (Location)

當查詢模式包含 $org.schema.type.Location 類型,或是預期輸入內容含有內建意圖時 (「actions.intent.PLACE」)。

extension

object

擴充功能型別取決於引數。舉例來說,如果 actions.intent.SIGN_IN 意圖的引數名稱為 SIGN_IN,則這項擴充功能會包含 SignInValue 值。

包含任意類型欄位的物件。額外的 "@type" 欄位則包含能辨識類型的 URI。例如:{ "id": 1234, "@type": "types.example.com/standard/id" }.

structuredValue

object (Struct format)

Google 需要以 JSON 格式傳送資料值時指定。

狀態

Status 類型會定義適用於不同程式設計環境 (包含 REST API 和遠端程序呼叫 (RPC) API) 的邏輯錯誤模型。gRPC 會使用這個模型。每個 Status 訊息包含三部分的資料:錯誤代碼、錯誤訊息和錯誤詳細資料。

如要進一步瞭解這個錯誤模型,以及如何使用這個錯誤模型,請參閱 API 設計指南

JSON 表示法
{
  "code": integer,
  "message": string,
  "details": [
    {
      "@type": string,
      field1: ...,
      ...
    }
  ]
}
欄位
code

integer

狀態碼,應為 google.rpc.Code 的列舉值。

message

string

向開發人員顯示的錯誤訊息,應以英文呈現。任何向使用者顯示的錯誤訊息都應進行本地化並透過 google.rpc.Status.details 欄位傳送,或是由用戶端加以本地化。

details[]

object

包含錯誤詳細資料的訊息清單。這是供 API 使用的一組常用訊息類型。

包含任意類型欄位的物件。額外的 "@type" 欄位則包含能辨識類型的 URI。例如:{ "id": 1234, "@type": "types.example.com/standard/id" }.

DateTime

從使用者輸入內容剖析出的日期和時間引數值。不含時區資訊。

JSON 表示法
{
  "date": {
    object (Date)
  },
  "time": {
    object (TimeOfDay)
  }
}
欄位
date

object (Date)

日期值

time

object (TimeOfDay)

時間值

日期

表示完整或部分的日曆日期,例如生日。您可以視重要性決定是否要在別處指定時段和時區。日期以西曆為主,可用來表示:

  • 完整日期,具有非零的年、月和日值
  • 月和日值,年值為零。例如:週年紀念日
  • 只有年,月和日值為零
  • 年和月值,日值為零。例如:信用卡到期日

相關類型為 google.type.TimeOfDaygoogle.protobuf.Timestamp

JSON 表示法
{
  "year": integer,
  "month": integer,
  "day": integer
}
欄位
year

integer

日期。必須為 1 到 9999;如要指定不含年份的日期,請輸入 0。

month

integer

月份。必須為 1 到 12;如要指定不含日期的年份,請輸入 0。

day

integer

日期。必須為 1 到 31,並屬於有效的年和月;如果只指定年份,或只指定年份和月份,而不指定當月第幾日的話,請輸入 0。

TimeOfDay

代表一天中的時間。日期和時區並不需要指定,或是在其他位置上指定。API 可選擇允許閏秒。相關類型為 google.type.Dategoogle.protobuf.Timestamp

JSON 表示法
{
  "hours": integer,
  "minutes": integer,
  "seconds": integer,
  "nanos": integer
}
欄位
hours

integer

時段,採用 24 小時格式。值應介於 0 到 23 之間。API 可選擇允許使用「24:00:00」這類的值來表示營業打烊時間等情況。

minutes

integer

一天內的分鐘。值必須介於 0 到 59 之間。

seconds

integer

當下時間的秒數。正常情況下,值必須介於 0 到 59 之間。如果 API 允許閏秒,則可允許值為 60。

nanos

integer

秒數的小數,以奈秒為單位。值必須介於 0 到 999,999,999 之間。