logo
開發者文件
搜尋
配置 Zapier AI Actions 作為工具

配置 Zapier AI Actions 作為工具

關於 Zapier

Zapier 是一款廣受歡迎的線上自動化工具,讓用戶能夠將不同應用程式、服務與 API 連接起來,實現自動化協作,無需手動搬移資料或執行重複性任務。Zapier 的核心概念是「Zaps」(自動化流程),每個 Zap 由「觸發器」(Trigger,當某應用發生特定事件時啟動)和「動作」(Action,根據觸發自動執行後續任務)組成。

Zapier 提供數千個預建整合方案,涵蓋 Gmail、Google Sheets、Slack、Trello、Salesforce 等眾多熱門應用與服務。即使是非技術背景的用戶,也能輕鬆設置自動化流程,有效提升工作效率,減少重複作業。

透過 Zapier,您可以建立簡單的自動化流程(如將電子郵件轉為任務),也能設計更複雜的跨多應用、資料庫的自動同步與更新。Zapier 平台靈活且易於使用,是企業與個人提升工作效率的利器。

強大的 Zapier AI Actions

Zapier AI Actions 是一個工具,讓開發者能將 Zapier 的操作整合到 AI 平台或自定義應用中!Zapier 自動化平台上超過 20,000 個您熟悉且喜愛的動作,皆可與您偏好的 AI 工具結合使用。

同時,結合 Zapier AI,這些動作變得更加直覺易用!

例如,傳統寄送電子郵件時,需分別填寫收件人、主旨與內容。但透過 AI Action,您只需下達一個「操作指令」,Zapier AI 即可自動解析並執行後續動作。

範例指令:

發送一封電子郵件給 xxxxxx@126.com,請他來我的辦公室。
                      
                      發送一封電子郵件給 xxxxxx@126.com,請他來我的辦公室。

                    
此代碼塊在浮窗中顯示

Zapier AI 會自動進行意圖辨識,將您的指令解析為:

to: xxxxxx@126.com subject: 會議邀請 body: 請來我的辦公室。
                      
                      to: xxxxxx@126.com
subject:	會議邀請
body:	請來我的辦公室。

                    
此代碼塊在浮窗中顯示

並依據解析結果自動執行動作。

這代表,您在 GPTBots 中建立的 Agent,只需簡單配置,即可輕鬆串接 Zapier 的數千個動作,充分發揮其潛力!只要透過對話下達指令,Agent 就能自動調用這些動作,完成各類任務!

Zapier 配置

image-20240221214321769

image-20240221185835648

請造訪 Zapier AI Actions,進入「My Actions - Manage Actions」並建立一個動作(Action)。

image-20240221222728513

選擇您需要的動作,本文以「Gmail:發送電子郵件」為例。此動作可接受一個操作指令,Zapier AI 會自動解析指令中的參數(收件人、主旨、內容等),並執行發信。

授權您的 Gmail 帳號,並依需求設定每個參數。每個欄位可指定固定值,或如圖所示,交由 Zapier AI 自動判斷(Have AI guess a value for this field)。

image-20240221214422066

請確保您的動作已啟用。

image-20240221223328025

建議先到「Test Actions」測試剛剛設定的動作,確認可正常運作。

image-20240221223359569

若「Results」狀態為「success」,即表示動作執行成功,測試通過。

image-20240221223809670

接著,進入「API Playground」,找到 /api/v1/exposed/,執行並取得 Action ID,後續設定 GPTBots 工具時會用到。

image-20240221214527178

在「Credentials」中找到您的「API Key」,同樣會在 GPTBots 工具設定時使用。

GPTBots 工具設定

於「Enterprise Tools」中建立新工具。

認證

image-20240221224124281

可選擇「Developer Authentication - None」,Zapier AI Actions 無需額外認證。

JSON 設定

以下為 Zapier AI Action「Gmail:發送郵件」的工具設定範例。您可依此結構調整其他 Zapier AI Actions。

請特別留意註解部分,其他內容大多可直接複製使用。

{ "openapi": "3.0.0", "servers": [ { "url": "https://actions.zapier.com" } ], "paths": { "/api/v1/dynamic/exposed/<your_action_id>/execute/": { //請將 <your_action_id> 替換為您的 Action ID。 "post": { "operationId": "zpGmailSendEmail", //自訂動作名稱。 "description": "當用戶希望發送電子郵件時調用此 API。", //動作描述,協助 LLM 理解用途。 "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Request" } } } }, "responses": { "200": { "description": "成功發送郵件。", //成功回應描述。 "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "400": { "description": "無效請求。" //400 錯誤描述。 } }, "parameters": [ { "name": "x-api-key", "in": "header", "required": true, "description": "Zapier AI Actions 的 API Key。", "schema": { "type": "string", "default": "<your_api_key>" //請輸入您的 Zapier AI Actions API Key。 } } ] } } }, "components": { "schemas": { "Request": { "type": "object", "properties": { "instructions": { "type": "string", "description": "Zapier AI Action 'zpGmailSendEmail' 的操作指令。" //說明此指令用途。 } }, "required": [ "instructions" ] }, "Response": { "type": "object", "properties": { "id": { "type": "string", "description": "請求 ID" }, "status": { "type": "string", "description": "請求狀態" } }, "required": [ "instructions" ] } } } }
                      
                      {
  "openapi": "3.0.0",
  "servers": [
    {
      "url": "https://actions.zapier.com"
    }
  ],
  "paths": {
    "/api/v1/dynamic/exposed/<your_action_id>/execute/": {	//請將 <your_action_id> 替換為您的 Action ID。
      "post": {
        "operationId": "zpGmailSendEmail",	//自訂動作名稱。
        "description": "當用戶希望發送電子郵件時調用此 API。",	//動作描述,協助 LLM 理解用途。
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功發送郵件。",	//成功回應描述。
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                }
              }
            }
          },
          "400": {
            "description": "無效請求。"	//400 錯誤描述。
          }
        },
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "description": "Zapier AI Actions 的 API Key。",
            "schema": {
              "type": "string",
              "default": "<your_api_key>"	//請輸入您的 Zapier AI Actions API Key。
            }
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Request": {
        "type": "object",
        "properties": {
          "instructions": {
            "type": "string",
            "description": "Zapier AI Action 'zpGmailSendEmail' 的操作指令。"	//說明此指令用途。
          }
        },
        "required": [
          "instructions"
        ]
      },
      "Response": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "請求 ID"
          },
          "status": {
            "type": "string",
            "description": "請求狀態"
          }
        },
        "required": [
          "instructions"
        ]
      }
    }
  }
}

                    
此代碼塊在浮窗中顯示

在 Agent 中使用工具

image-20240221232739323

在 Agent 介面中,您可直接用自然語言描述想執行的操作,Agent 會自動判斷是否需調用工具。調用時,Zapier AI 會自動解析為合適的動作參數。

image-20240221232529843

此電子郵件已成功發送至指定信箱,主旨與內容皆由 Zapier AI 根據用戶輸入自動產生。