Method: projects.locations.collections.dataConnector.buildActionInvocation

使用 DataConnector 建構動作調用。

HTTP 要求

POST https://discoveryengine.googleapis.com/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector}:buildActionInvocation

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

路徑參數

參數
name

string

這是必要旗標,DataConnector 項資源。

用於建構動作呼叫的資料連接器。

要求主體

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

JSON 表示法
{
  "actionName": string,
  "languageCode": string
}
欄位
actionName

string

必要。動作名稱。

例如:「send_email」

languageCode

string

(選用步驟) 狀態和錯誤訊息所用的語言。

回應主體

DataConnectorService.BuildActionInvocation 方法的回應。

如果成功,回應主體會含有以下結構的資料:

JSON 表示法
{
  "actionInvocation": {
    object (ActionInvocation)
  }
}
欄位
actionInvocation

object (ActionInvocation)

動作叫用。

授權範圍

需要下列其中一種 OAuth 範圍:

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

詳情請參閱Authentication Overview

IAM 權限

需要 name 資源的下列 IAM 權限:

  • discoveryengine.dataConnectors.buildActionInvocation

詳情請參閱 IAM 說明文件

ActionInvocation

代表動作調用。

JSON 表示法
{
  "agentName": string,
  "actionName": string,
  "args": {
    object
  },
  "dataConnector": string,
  "dataSource": string,
  "invocationId": string,
  "actionDisplayName": string,
  "userConfirmationMessage": string,
  "authorizationUrl": string,
  "resendQueryOnUserAuthorization": boolean,
  "parameterDeclaration": {
    object
  },
  "argSetCandidates": [
    {
      object
    }
  ]
}
欄位
agentName

string

選用。執行動作的代理程式名稱。

actionName

string

動作名稱。

例如:「send_email」

args

object (Struct format)

動作的具名引數。

例如:{"recipient": "tom@...", "subject": ... }

提供給使用者時,這部分可能可以編輯。

如果動作引數有多個選項 (例如日曆活動有多個可能的時段),這個欄位會說明第一個選項。

dataConnector

string

DataConnector 項資源。

用於執行動作的資料連接器。

dataSource

string

僅供輸出。資料來源的名稱。

invocationId

string

僅供輸出。動作叫用 ID。

actionDisplayName

string

僅供輸出。向使用者顯示的動作名稱,方便使用者閱讀。

userConfirmationMessage

string

僅供輸出。向使用者顯示的訊息 (可供人閱讀),以及確認對話方塊。

authorizationUrl

string

僅供輸出。授權網址。

resendQueryOnUserAuthorization

boolean

僅供輸出。如果為 true,呼叫者必須在使用者授權後重新傳送查詢。

parameterDeclaration

object (Struct format)

僅供輸出。動作參數的說明,包括轉譯/驗證資訊。格式依據 OpenAPI 的參數規格。參考資料:https://swagger.io/docs/specification/describing-parameters/

範例:

{
    "type": "object",
    "properties": {
        "title": {
            "type": "string",
            "description": "title of the event",
        },
        "startTime": {
            "type": "string",
            "format": "date-time",
            "description": (
                "Start time of the meeting, e.g. 2024-07-12T23:30"
            ),
        },
        "attendees": {
            "type": "array",
            "items": {"type": "string", "format": "email"},
            "description": "List of email addresses of attendees",
        },
        "duration": {
            "type": "integer",
            "format": "int32",
            "minimum": 5,
            "maximum": 240,
            "default": { "numberValue": 30 },
            "description": (
                "Duration of the meeting in minutes. Defaults to 30"
                " minutes."
            ),
        },
        "timezone": {
            "type": "string",
            "description": (
                'IANA time Zone Database name, e.g. "Europe/Zurich". If'
                " omitted, timezone of the user will be used"
            ),
        },
        "eventType": {
            "type": "string",
            "enum": ["meeting", "focus_time", "out_of_office", "task"],
            "description": "type of the event",
        },
    },
    "required": ["startTime", "title", "attendees"]
}
argSetCandidates[]

object (Struct format)

僅供輸出。如果動作引數有多個選項 (例如日曆活動有多個可能的時間間隔),這個欄位會列出這些額外的引數候選項目。

包含引數集清單,每個引數集的格式都與 args 欄位類似。引數集只會包含與 args 欄位不同的引數。提供給使用者時,這些值可能可以編輯。

例如:

args 包含第一個選項和所有引數:

{"title": "Meeting with John", "startTime": "2024-08-01T13:30", ... }

argSetCandidates 包含其餘選項,但只會填入不同的引數:

[{ "startTime": "2024-08-01T14:00" }, { "startTime": "2024-08-01T14:30" }, { "startTime": "2024-08-01T15:30" }]