Action

動作代表您的動作專案支援的特定互動。互動可以是單樣本或多步驟。

JSON 表示法
{
  "name": string,
  "fulfillment": {
    object (Fulfillment)
  },
  "intent": {
    object (Intent)
  },
  "description": string,
  "signInRequired": boolean,
  "source": string
}
欄位
name

string

動作的名稱。即使您使用常見的「在 Google 動作」意圖 (以「actions」開頭),仍須提供名稱。舉例來說,如果您使用的是「actions.intent.MAIN」意圖,遵循慣例的動作名稱就是「MAIN」。動作套件必須宣告至少一項動作。

fulfillment

object (Fulfillment)

如何執行這項動作。

intent

object (Intent)

這個動作執行的意圖。常見動作在 Google 意圖的名稱以「actions」開頭。對話代理程式的動作套件必須有名稱為「actions.intent.MAIN」的意圖。詳情請參閱 https://developers.google.com/actions/reference/rest/intents

description

string

以英文說明動作的用途。這主要用於 Google 審查動作或進行偵錯。使用者不會看到這個說明。長度必須小於 100 個 ASCII 字母。

signInRequired

boolean

指出是否必須登入才能執行這個動作。請注意,只有在 ActionPackage 物件已指定 AccountLinking 屬性時,才能使用這個選項。

source
(deprecated)

string

建立這項動作的工具的字串 ID

出貨

如何執行動作。

JSON 表示法
{

  // Union field conversation can be only one of the following:
  "conversationName": string,
  "useDialogflowFulfillment": boolean
  // End of list of possible types for union field conversation.
}
欄位

聯集欄位 conversation

conversation 只能採用下列其中一種設定:

conversationName

string

透過對話執行要求執行動作。這會參照 ActionPackage.conversations 欄位中 Conversations 的「名稱」欄位。

useDialogflowFulfillment

boolean

這個欄位會指出是否要使用 Dialogflow 執行要求。

意願

意圖及其相關的查詢模式,用於比對使用者的查詢。用於初始觸發。

JSON 表示法
{
  "name": string,
  "parameters": [
    {
      object (Parameter)
    }
  ],
  "trigger": {
    object (Trigger)
  }
}
欄位
name

string

指出這個意圖的名稱,例如BOOK_A_TABLE。可以是從 actions. 開始的內建意圖,在此情況下,系統會忽略參數和查詢模式,因此會予以忽略。

parameters[]

object (Parameter)

queryPatterns 內的參數清單。必須提供 queryPatterns 中的所有參數。

trigger

object (Trigger)

此意圖的觸發規格。

參數

在查詢領域中使用的參數。這是查詢模式中的參數結構化表示法 (例如 $Color:color)。

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

string

參數的名稱,例如 color

type

string

參數的類型可以是動作套件中宣告的常見類型或自訂類型,例如 Color

觸發條件

觸發條件規格。

JSON 表示法
{
  "queryPatterns": [
    string
  ]
}
欄位
queryPatterns[]

string

用於識別指定意圖的模式清單。查詢模式只能參照參數欄位中宣告的參數。