本文介绍: 自定义GPTs应用(GPT助手应用)的Actions配置说明

@link https://chat.openai.com/gpts

在这里插入图片描述


【Configure】Create/Edit actions

  • Schema配置范例及说明

在这里插入图片描述

{
  // openapi规范版本
  "openapi": "3.1.0",
  // 操作基础信息介绍
  "info": {
    "title": "Get Product data",
    "description": "Retrieve Product Information.",
    "version": "v1.0.0"
  },
  // 服务接口基础信息配置
  "servers": [
    {
      // 公开外网可访问的API接口主域名URI地址
      "url": "https://xxx.xxx.xxx"
    }
  ],
  // 服务接口配置(即支持的“动作”)
  // paths中的description字段,影响GPT中对话时调用接口的决策
  "paths": {
    // 接口URI地址
    "/api/review": {
      // 接口请求方式:get、post
      "get": {
        // 接口作用描述
        "description": "Get Product Information",
        // 操作接口ID名称
        "operationId": "GetCurrentProduct",
        // 请求参数配置
        "parameters": [
          // 第一个参数配置信息
          {
            // 参数名称
            "name": "goods_title",
            "in": "query",
            // 参数描述(影响GPT中对话时调用接口的决策)
            "description": "Get specific product information",
            // 是否必填
            "required": true,
            // Schema配置
            "schema": {
              // 数据类型,即:goods_title参数值是字符串类型
              "type": "string"
            }
          }
        ],
        "deprecated": false,
        // 响应内容结构配置
        "responses": {
          // HTTP状态对应的响应内容
          "200": {
            // 响应内容描述
            "description": "Response content description",
            "content": {
              // 响应数据类型,对应Response Headers中的content-type
              "application/json": {
                // 响应数据结构Schema
                "schema": {
                  "$ref": "#/components/schemas/product_informationRequestSchema"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    // 不同结构Schema配置信息,在paths配置项中可以基于别名调用
    // description字段,影响GPT对接口传参/响应数据时的决策
    "schemas": {
      "product_informationRequestSchema": {
        "title": "product_informationRequestSchema",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "title": "title",
            "description": "Product title"
          },
          "img": {
            "type": "array",
            "title": "img",
            "description": "Product side-by-side images",
            "items": {
              "type": "object",
              "properties": {
                "src": {"type": "string", "title": "title", "description": "Product Image"},
                "width": {"type": "string", "title": "title", "description": "Product image display width"},
                "height": {"type": "string", "title": "title", "description": "Product image display Height"}
              }
            }
          },
          "hot": {
            "type": "boolean",
            "title": "hot",
            "description": "Is it a hot-selling item"
          },
          "link": {
            "type": "string",
            "title": "link",
            "description": "Product Link"
          }
        }
      }
    }
  }
}

原文地址:https://blog.csdn.net/u011159821/article/details/135654556

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。

如若转载,请注明出处:http://www.7code.cn/show_57946.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注