门户网站建设和检务公开自查,手机网站格局,加强学校网站建设的必要性,自己注册公司有什么弊端如何创建带有Actions接口调用的GPTs
在本篇博客中#xff0c;我们将介绍如何创建一个带有Actions接口调用的GPTs #xff0c;以及如何进行配置和使用。我们将以 https://chat.openai.com/g/g-GMrQhe7ka-gptssearch 为例#xff0c;演示整个过程。
Ps: 数据来源#xff1a…如何创建带有Actions接口调用的GPTs
在本篇博客中我们将介绍如何创建一个带有Actions接口调用的GPTs 以及如何进行配置和使用。我们将以 https://chat.openai.com/g/g-GMrQhe7ka-gptssearch 为例演示整个过程。
Ps: 数据来源https://gpt-stores.com/
标题基本信息定义
首先让我们为这个GPTs定义基本信息 Name GptsSearch Description 一个用于通过向量数据库查询匹配的GPTs的GPT。 Instructions
通过API调用根据用户提供的关键词来执行查询以找到所需的GPTs。在处理用户的问题之前必要时优化用户的输入以确保意图清晰明了。通过接口检索与用户意图相关的GPTs列表并将结果呈现给用户。回复开头语 在回复中始于以下陈述“数据来源于 https://gpt-stores.com。”
标题添加 Actions
接下来让我们讨论如何配置Actions。在这里我们采用了调用第三方API的方法与这个GPTs类似它调用一个API来查询向量化后的GPTs信息。以下是具体的配置细节 server
URL 指向接口的域名地址前缀例如 https://api-py.gpt-stores.com。 路径extra_data_get 这是接口地址的名称与URL结合后形成完整的地址例如 https://api-py.gpt-stores.com/extra_data_get。
请求方式 get 表示接口的请求方式是GET。
Parameter 配置 根据你的接口的需求配置相应数量的参数。例如这里我们配置了以下参数 pageSize 一次返回的项目数量最多20个。 pageNum 一次返回的页数最小为1。 title 用户搜索GPTs的关键词。
Response Definition 主要定义了接口响应的格式。
Component Definition 为Response 定义了一个对象。 通过上述配置我们基本完成了Actions接口调用的配置。在使用过程中GPTs将根据情况调用接口并传递相关参数。
以下是一个示例OpenAPI配置用于描述GPTs Store Search API
# Taken from https://github.com/OAI/OpenAPI-Specification/blob/main/examples/v3.0/petstore.yamlopenapi: 3.0.0
info:version: 1.0.0title: GPTs Store Search APIlicense:name: MIT
servers:- url: https://api-py.gpt-stores.com
paths:/extra_data_get:get:summary: List all gptsoperationId: queryGPTstags:- gptsparameters:- name: pageSizein: querydescription: How many items to return at one time (max 20)required: trueschema:type: integermaximum: 20format: int32- name: pageNumin: querydescription: How many pageNum to return at one time (min 1)required: trueschema:type: integermaximum: 1format: int32- name: titlein: querydescription: The keyword for user search the gptsrequired: trueschema:type: stringresponses:200:description: A paged array of gptsheaders:x-next:description: A link to the next page of responsesschema:type: stringcontent:application/json: schema:$ref: #/components/schemas/GPTsdefault:description: unexpected errorcontent:application/json:schema:$ref: #/components/schemas/Error
components:schemas:GPTs:type: objectrequired:- id- nameproperties:id:type: stringtitle:type: stringpost_name:type: stringauthor:type: stringauthor_link:type: stringcontent:type: stringdownload_link:type: stringcdn_featured_image:type: stringError:type: objectrequired:- code- messageproperties:code:type: integerformat: int32message:type: string