简介
本页面为开发者构建特定应用的 GPT Action 提供指导和指南。在继续之前,请务必先熟悉以下信息
这个特定的 GPT Action 概述了如何连接到 Retool Workflow。此 Action 接收用户输入,并使用 webhook 触发器将其发送到 Retool 中的工作流。然后,Retool 执行配置的工作流,并将 JSON 对象形式的响应发回 ChatGPT。
价值 + 示例业务用例
价值:用户现在可以利用 ChatGPT 的自然语言能力直接连接到 Retool 中的任何工作流。
示例用例:
- 您在 Retool 工作流中运行自定义代码,并且希望将其整合到 GPT 中。
- 数据科学家维护一个外部 VectorDB(使用 Retool Vector 或另一个向量数据库),并希望将向量搜索的结果发送回 ChatGPT。
- Retool 被用作连接内部服务的中间件,并且您希望使用 Retool 的 Webhook 为 ChatGPT 提供对这些服务的访问权限。
应用信息
应用关键链接
在开始之前,请查看来自应用的以下链接
- 应用网站: https://retool.com/products/workflows
- 应用 API 文档: https://docs.retool.com/workflows
应用先决条件
在开始之前,请确保在您的 Retool 环境中完成以下步骤
- 设置 Retool 账户
- 创建一个简单的工作流
应用工作流步骤
以下是一个基本 Retool Workflow 的示例。此工作流接收 2 个值并将它们相加,然后将结果响应回 webhook 触发器。
注意: 您的工作流必须先部署,然后才能从您的 GPT 访问。
ChatGPT 步骤
自定义 GPT 指令
创建自定义 GPT 后,您应该向 GPT 添加指令,提供有关 GPT 角色及其能够执行的操作的上下文。 有疑问? 查看入门示例,了解此步骤的详细工作原理。
OpenAPI Schema
创建自定义 GPT 后,将以下文本复制到 Actions 面板中。 有疑问? 查看入门示例,了解此步骤的详细工作原理。
注意: 您需要将以下 OpenAPI 规范中的 <WORKFLOW_ID> 值替换为您工作流的 ID。
openapi: 3.1.0
info:
title: Retool Workflow API
description: API for interacting with Retool workflows.
version: 1.0.0
servers:
- url: https://api.retool.com/v1
description: Main (production) server
paths:
/workflows/<WORKFLOW_ID>/startTrigger:
post:
operationId: add_numbers
summary: Takes 2 numbers and adds them.
description: Initiates a workflow in Retool by triggering a specific workflow ID.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
first:
type: integer
description: First parameter for the workflow.
second:
type: integer
description: Second parameter for the workflow.
responses:
"200":
description: Workflow triggered successfully.
"400":
description: Bad Request - Invalid parameters or missing data.
"401":
description: Unauthorized - Invalid or missing API key.
security:
- apiKeyAuth: []
身份验证说明
以下是关于如何使用此第三方应用程序设置身份验证的说明。 有疑问? 查看入门示例,了解此步骤的详细工作原理。
预操作步骤
在 ChatGPT 中设置身份验证之前,请在应用程序中执行以下步骤。
- 从 Webhook 配置面板获取您的 API 密钥
在 ChatGPT 中
在 ChatGPT 中,点击 “Authentication(身份验证)”,然后选择 “API Key(API 密钥)”。 输入以下信息。
- API 密钥: (粘贴 Retool Workflow Webhook Trigger 提供的 API 密钥)
- Auth Type(身份验证类型): Custom(自定义)
- Custom Header Name(自定义标头名称): X-Workflow-Api-Key
FAQ & 故障排除
- Auth Error(身份验证错误): 确保您已正确设置自定义标头名称。
- Invalid Workflow Error(无效工作流错误): 确保您已在 Retool 中部署了您的工作流。
您是否有希望我们优先考虑的集成? 我们的集成中是否存在错误? 在我们的 github 中提交 PR 或 issue,我们会查看。