How to create a GPTs with actions
In this blog post, we will explain how to create a GPTs with Actions interface calls and how to configure and use it.
We’ll use the example of https://chat.openai.com/g/g-GMrQhe7ka-gptssearch to demonstrate the process.
Basic Information Definition
First, let’s define the basic information for this GPTs:
- Name: GptsSearch
- Description: A GPT designed for querying matching GPTs using a vector database.
- Instructions:
- Execute queries based on keywords provided by the user through API calls to find the desired GPTs.
- Optimize user input as necessary before processing the user’s query to ensure clarity of intent.
- Retrieve a list of GPTs relevant to the user’s intent through the interface and present the results to the user.
- Response Start: Begin your response with the statement “Data sourced from https://gpt-stores.com.”
Adding Actions
Next, let’s discuss how to configure Actions. Here, we use a third-party API call approach, similar to this GPTs, which calls an API to query vectorized GPTs information. Here are the specific configuration details:
- Servers:
- URL: Points to the domain address prefix of the interface, for example, https://api-py.gpt-stores.com.
- Paths:
- extra_data_get: This is the name of the interface address, and when combined with the URL, it forms the complete address, for example, https://api-py.gpt-stores.com/extra_data_get.
- Request Method:
- GET: Indicates that the interface’s request method is GET.
- Parameter Configuration:
- Configure as many parameters as your interface requires. For example, here we configure the following parameters:
- pageSize: Number of items to return at one time, with a maximum of 20.
- pageNum: Number of pages to return at one time, with a minimum of 1.
- title: The keyword for user searching GPTs.
- Configure as many parameters as your interface requires. For example, here we configure the following parameters:
- Response Definition:
- Primarily defines the format of the interface’s response.
- Component Definition:
- Defines an object for use in responses.
With the above configuration, we have essentially completed the configuration of Actions interface calls. During usage, GPTs will call the interface and pass in the relevant parameters.
Here is an example OpenAPI configuration to describe the GPTs Store Search API:
# Taken from https://github.com/OAI/OpenAPI-Specification/blob/main/examples/v3.0/petstore.yaml
openapi: "3.0.0"
info:
version: 1.0.0
title: GPTs Store Search API
license:
name: MIT
servers:
- url: https://api-py.gpt-stores.com
paths:
/extra_data_get:
get:
summary: List all gpts
operationId: queryGPTs
tags:
- gpts
parameters:
- name: pageSize
in: query
description: How many items to return at one time (max 20)
required: true
schema:
type: integer
maximum: 20
format: int32
- name: pageNum
in: query
description: How many pageNum to return at one time (min 1)
required: true
schema:
type: integer
maximum: 1
format: int32
- name: title
in: query
description: The keyword for user search the gpts
required: true
schema:
type: string
responses:
'200':
description: A paged array of gpts
headers:
x-next:
description: A link to the next page of responses
schema:
type: string
content:
application/json:
schema:
$ref: "#/components/schemas/GPTs"
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
components:
schemas:
GPTs:
type: object
required:
- id
- name
properties:
id:
type: string
title:
type: string
post_name:
type: string
author:
type: string
author_link:
type: string
content:
type: string
download_link:
type: string
cdn_featured_image:
type: string
Error:
type: object
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string