【OpenAI】自定义GPTs应用(GPT助手应用) - Actions/Schema配置

@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"
          }
        }
      }
    }
  }
}

相关推荐

  1. WriteFlow写作流GPT应用,激发创意的写作助手

    2024-01-18 23:54:03       55 阅读
  2. Git 定义命令

    2024-01-18 23:54:03       30 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-18 23:54:03       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-18 23:54:03       106 阅读
  3. 在Django里面运行非项目文件

    2024-01-18 23:54:03       87 阅读
  4. Python语言-面向对象

    2024-01-18 23:54:03       96 阅读

热门阅读

  1. Go语言网络轮询器

    2024-01-18 23:54:03       55 阅读
  2. 24校招,阿里巴巴测试开发工程师二面

    2024-01-18 23:54:03       42 阅读
  3. vue3自定义指令

    2024-01-18 23:54:03       70 阅读
  4. 智慧校园大数据云平台介绍

    2024-01-18 23:54:03       56 阅读
  5. 支付功能的实现

    2024-01-18 23:54:03       58 阅读
  6. RPM命令详解2---查询&验证

    2024-01-18 23:54:03       52 阅读
  7. Android13系统长按power键关机弹框中添加截屏按钮

    2024-01-18 23:54:03       52 阅读
  8. SpringBoot缓存相关注解的使用

    2024-01-18 23:54:03       55 阅读