GPTs创建及action使用

发布时间 2023-12-21 08:52:39作者: 梅丹隆

一、新建GPTs

New GPT:https://chat.openai.com/gpts/editor

二、创建GPT的选项

1、Create

image.png
进入创建GPT页面,在CreateTab下,点击左下角曲别针符号,可以向GPT上传知识库文档。GPT可以根据这些文档进行回答。

2、Configure

image.png

2.1、Action

创建Action官方文档
Actions与Plugins类似,不同的是Actions允许GPT调用自定义API。所以我们可以参考Plugins的参数:https://platform.openai.com/docs/plugins/getting-started

{
  "openapi": "3.1.0",
  "info": {
    "title": "Get weather data",
    "description": "Retrieves current weather data for a location.",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://weather.example.com"
    }
  ],
  "paths": {
    "/location": {
      "get": {
        "description": "Get temperature for a specific location",
        "operationId": "GetCurrentWeather",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "description": "The city and state to retrieve the weather for",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "deprecated": false
      }
    }
  },
  "components": {
    "schemas": {}
  }
}