GPTs application development: Use GPT Builder to create your own GPTs application

Foreword:

GPTs is a new feature launched by OpenAI on November 6, 2023. It allows us to easily create our own GPTs applications in the form of natural language conversations. GPTs applications can leverage GPT-4’s powerful natural language processing and generation capabilities, as well as other multi-modal functions, such as online retrieval, image generation, data analysis, etc., to achieve various complex tasks. In this blog, I will introduce how to use the GPT Builder tool to customize and optimize the GPT model to adapt to specific application scenarios. Demonstrates the steps and methods of GPTs application development, as well as the various options and functions of GPT Builder. I will consider providing complete practical examples in subsequent articles.

2023/11/13 Supplementary concept distinction:

GPTs = concept of GPT app store
GPT Builder = Build tool for GPT applications
The ability to build GPT applications = multi-modality (GPT4 + DALL·E + Browsing + Analysis) + fine-tuning + Actions to call third-party APIs.
The above does not include Plugin plug-in development and calling.

GPT4 Chat = Multimodal (GPT4 + DALL·E + Browsing + Analysis)
GPT4 Plugin = supports up to 3 plug-ins to be used at the same time, and is independent.
GPT3.5 Chat = No need to explain this old thing.
GPT Plugin plug-in development is a separate permission and is not the same thing as GPTs.

1, GPTs application development steps:

  1. Log in to your OpenAI account:
    Visit the OpenAI website and log in to https://chat.openai.com/gpts/discovery. This feature requires GPT4 Plus.

  2. Build an app with GPT Builder:
    In the OpenAI console, look for the GPT Builder entry. Click to enter the GPT Builder interface.

  3. Define project requirements:
    Identify the specific task or problem you want the model to perform or solve. Be clear about goals and desired outputs. Different options and functions can be configured according to different needs, such as data upload, model training and testing, etc.

  4. Prepare training fine-tuning and knowledge data:
    If necessary, the data that will be used to train the model can be collected and organized. These data should be relevant to the project. The purpose is to professionally ensure the quality of the data.

  5. Upload data:
    In GPT Builder, follow the instructions to upload your training data. Following the format and size requirements, we are currently only testing PDF. The MD suffix is less effective (MD has a bug, you can change the MD suffix to TXT). There is no problem with TXT, DOC, etc.

  6. Configure training parameters:
    Configure various parameters for model training according to project requirements. You can start from the default settings and then adjust the settings as needed.

  7. Debug and Iterate:
    Based on the test results of the Preview program, you may need to go back to the preparation or parameter configuration stage in the Create or Configure options for adjustments and optimizations.

  8. App publishing:
    When the application is almost built and debugged, it can be deployed and released for use.

2, GPT Builder Concept:

GPT Builder is a tool that allows users to customize and optimize GPT models to fit specific use cases. It provides finer control over model training data, allowing models to be fine-tuned to specific needs.

OpenAI launched a very exciting new feature at the first OPENAI DEVDAY developer conference at 2 a.m. Beijing time on 2023/11/07: GPTs. It allows us to easily create our own GPTs applications in the form of natural language conversations.

GPTs applications can take advantage of ChatGPT’s powerful natural language processing and generation capabilities, and also integrate functions such as online retrieval/image generation/data analysis. In the past, each function existed independently, but now it means the original large language model function of GPT4 Basically, it integrates all the previously independent functions. To solve a complex problem, you don’t need to open many chat windows. Instead, you only need to have these 4 capabilities in one chat window, and automatically select large models according to needs.Abbreviation :Multimodal large language model.

Okay, we have paved the way for some conceptual content, so what exactly is GPT Builder? What is the difference from the previous GPT4 large language model?

My personal understanding:
GPTs can be simply understood as the mobile App store, which is the application store of OpenAI’s large language model. However, before GPTs was released, we could use complex prompts to affect GPT3.5/GPT4 a long time ago. To implement a certain function, such as document summary and code generation, complex functions will be completed based on the Prompt words we prefix. In fact, this can already be regarded as an application.

Difference:

  • GPT-4 Write Prompt:

    • Use the existing GPT-4 general model.
    • We guide the model to generate the required answers or content by writing specific prompts.
    • You cannot modify or adjust the model itself, you can only try to influence the output through carefully designed prompts.
  • GPT Builder:

    • Allows customization and optimization of GPT models to suit specific application scenarios.
    • You can upload your own training data to influence model learning and output.
    • Not limited to influencing output through prompts, users can directly influence model training and behavior.
    • Example: If you are running an online Feng Shui consulting service and want to create a GPT model specifically for Feng Shui consulting, you can use GPT Builder to upload Feng Shui-related conversations and information to train a specialized model that performs better at Feng Shui consulting.

However, the previous GPT4 “application” implemented by entering Prompt in a newly opened chat window had many limitations, such as inability to control precise permissions, personal use, only allowed to be used by people with link access, and open to GPTs for everyone. Use, and cannot set pre-guide words for Instructions and Conversation starters, cannot set Actions to access third-party APIs, and cannot upload Knowledge fine-tuning data.

GPT4=General large model, Prompt only affects the output content of the trained large model.
GPT4s = general large model + fool-like professional prompt guidance + fine-tuning of training data + access to third-party APIs.

If you don’t understand it, just understand the “application” implemented by GPT4 through Prompt as a Demo App created by yourself, which cannot be released to the application market and is not for commercial use. If you want to publish it to the application market, you need to meet many complex requirements and steps.

My rough understanding is that GPTs=App Store, GPT Builder=Xcode.

GPT Builder can upload your own documents to make the application more suitable for needs and scenarios. Third-party APIs can also be called through Actions, making the application more powerful and flexible.

The GPTs function is currently only open to all ChatGPT Plus users, and you can manage and view your GPTs applications in GPTs.

OpenAI has a grand vision (ambition) and wants to build GPTs Store into the Apple Store in the AI era.
For us ordinary users, this is a rare opportunity, and we should learn GPTs application development as soon as possible.

Looking back in a few years, what if this is an opportunity? If other times give you opportunities, you will fail!

3, GPT Builder detailed explanation:

  • Take the time to explore and understand GPT Builder’s interface.
  • Check out the different options and features like data upload, model training and testing, and more.

3.1, Detailed explanation of GPT Builder’s Create option


GPT Builder’s Create options:

  • The Create option allows the user to start a new model creation process.
  • In this section, you can configure various parameters and settings of the new model, including naming the model, setting training goals, etc.
  • This is the starting point for customizing and optimizing the model, entering our specific needs and data.
  • For example: Here is an example I have created. Enter the following content, and GPTs will guide you to improve the application step by step.

1. You need to create an application named “Online Article Summary Assistant”.
2. All interactions, prompts and instructions need to be conducted in Chinese.
3. You need to use Dalle3 to create an application logo. The logo is related to reading and requires a sense of technology.
4. When the user enters the URL link, the API needs to be requested through the actions configuration and the API result is returned.
5. When the user needs to enter non-url content and only provide text content, please summarize the article content into a paragraph and list the five key information contents of the text in a list.

File upload in GPT Builder:

  • File upload means you can upload your own data files, which will be used to train or fine-tune the model.
  • File types that can be uploaded: I have only tested the .txt or .json format so far.
  • File size limit: The specific size limit may vary due to OpenAI’s policies and technical restrictions, which change rapidly and are temporarily unclear.
  • File content format requirements:
    • The format needs to be neat and easy to parse.
    • It should contain data relevant to the task you want the model to learn.
    • Example: If we are creating a model for Feng Shui, we might upload a .txt file containing professional Feng Shui related knowledge.

The content on the left has been explained in detail and is very simple. The most complicated one is Configure on the right.

The difference between file upload in Create and knowledge update file in Configure:

  • File upload in Create: Usually used to upload training data when creating a new model or training a brand new model. These data will be used to build the knowledge base of the model from scratch. For example, I will upload some Feng Shui related information.
  • Knowledge update file in Configure: This usually involves fine-tuning or updating an existing model. Files uploaded here are usually used to extend or update the existing knowledge base of the model. If relevant content is not found, it will be looked up from the data uploaded by Knowledge instead of completely rebuilding it.
    • For example, if I have a trained model “Parallel World!” I’m surrounded by beautiful women! 》GPTs application, but want it to know the detailed data of the individual protagonist.

The concepts here are a bit complicated and require in-depth study and understanding:

  1. What is the significance of training goals?:

    • Training goals refer to the specific required results that you hope to achieve by training a customized model. These goals define the direction and focus of model training.
    • For example, if I were creating a chatbot for Feng Shui, training goals might include improving understanding of specific industry terminology, optimizing the accuracy of responses, or enhancing the ability to recognize customer emotions.
  2. Explanation of training and fine-tuning models:

    • Training model: Refers to building a new model from scratch, which usually requires a lot of data resources and costs. In this process, the model learns how to understand and generate text.
      • For example, OpenAI has trained GPT4, a general-purpose large model, with xxx parameters. How much does it cost to train once? This is why the previous GPT4 knowledge base stayed in 2021 and was only recently updated to 2023, because training once costs a lot.
    • Fine-tuning the model: Refers to further optimization based on an already trained model. Through fine-tuning, the model can be better adapted to specific application scenarios or needs.
      • For example, OpenAI provides a basic general large model of GPT4, which can be fine-tuned by adding industry-specific conversation examples to the model to make it more suitable for use within that industry.

What! Still don’t understand? Have you ever played with GitHub? Do you know how to copy code?
For example, there is a mature project on github. This project took a lot of time to build and improve. Only the author knows how complicated the process is.
This mature project = training model.

If 80% of the requirements of this project meet your needs, but not completely, you can clone the code locally, add your own business code, and fine-tune it. Do you understand?

To summarize briefly: Training goals are specific goals that guide the direction of model training, Training models is the process of building a model from scratch, and Fine-tuning the model It is based on the existing model. Uploading files in Create is to establish the basis of a new model, while uploading update files in Configure is to add new knowledge to the existing model.

  1. GPT Builder’s base model:

    • GPT Builder provides a basic GPT4 general large model.
    • This base model is a general, untrained GPT model that users can train or fine-tune to suit specific application scenarios by uploading their own data.
  2. Effects of uploading files in Create’:

    • Create a new model: Uploading files in Create’ is to train a new model. This process does not affect the original GPT-4 general model, but creates a new model trained on specific data.
    • Impact of uploading new files: If I upload one file for training first and then another file, these will be two separate training processes, producing two different models, unless in the second Explicitly choose to update or fine-tune the original model when uploading.
  3. The difference and priority between GPT-4, Create file upload training data and Configure’s Knowledge knowledge update file:

Project GPT-4 Model Create File Upload Configure Knowledge Update
Definition A general model without specific training Used to train new Model data upload Data upload for fine-tuning or updating based on existing models
Purpose Applicable to a wide range of general scenarios Create models customized for specific tasks or scenarios Improve or update specific knowledge or performance of existing models
Priority As a basic model, it is suitable for situations where there are no specific requirements. When it is necessary to create new Used when using models Used when new knowledge needs to be added or fine-tuned based on existing models

Example: If I was running a Feng Shui consulting platform and wanted to create a dedicated Feng Shui consulting chatbot, I would upload training data related to Feng Shui consulting via Create to train a new model.

If some new Feng Shui professional terms are added to my platform, how can I update it so that the existing Feng Shui chatbot can also handle these new industry terms? , I can upload the Knowledge update file containing these new professional terms in Configure’ to fine-tune the existing model.

Let’s start with the detailed explanation of Configure on the right

3.2, Detailed explanation of GPT Builder’s Configure option

Photo

  1. App icon settings:

    • Use Upload:

      • When you click on the icon, this function allows you to upload an image yourself. As the logo of the application, there should be some restrictions. Click on it to see the file formats that are supported for uploading.
    • Use DALL·E to generate app icon:

      • This can be done using DALL·E to generate application icons by describing the desired icon style. For example, you can enter the command: “Generate an application icon with a reading theme and a sense of technology.”
      • If you don’t like it, you can fine-tune the generated icon again through the description.
  2. Influence of the settings of Name, Description, Instructions, Conversation Starters:

    • Name: The name of the application, such as “Parallel World!” I’m surrounded by beautiful women! 》.
    • Description: A brief description of the application to help other users understand the main functions and uses of the application.
    • Instructions: These are instructions to other users on how to use the app.
    • Conversation Starters: These are default conversation starters that help other users start interacting with your app. It only exists the first time the app is used to guide the app’s functionality or to initiate a specific type of conversation.
  3. Capabilities of Web Browsing, DALL·E Image Generation, Code Interpreter selection:

    • Web Browsing: Allows the app to browse and retrieve information on the Internet.
    • DALL·E Image Generation: Allows the application to use DALL·E’s ability to generate images.
    • Code Interpreter: Allows the app to understand and execute programming code.
    • If these options are checked, the app will have this feature. If unchecked, the app will not have these features.
    • Compared with the GPT-4 general large model, GPT Builder allows us to select the capabilities we need based on the specific needs of the application. This allows for more precise control over the functionality of the application, rather than using a general model that has all these functions (previously it was the GPT4 general model, and later updates integrated All Tools into GPT4.).

It is very important that these options and settings can be used to create a fully functional application professionally, otherwise you have to write very complicated prompts to implement it. It affects the user’s initial impression and also determines the way and experience of application interaction. By precisely configuring these options, you can tailor your application to your specific needs.

Now it’s time to get to something very complicated. I spent a long time studying this stupid thing. After I figured it out, I can only say it’s awesome.

The “Actions” feature in GPT Builder is a great feature that allows our GPT application to perform functions beyond all the capabilities we have talked about before, such as retrieving information or performing specific URL requests. This feature is introduced in detail below:

3.3, Detailed explanation of the Actions option in Configure of GPT Builder

  1. What Actions do:

    • Extended functions: Actions allow our GPTs applications to interact with external services and third-party APIs to implement more complex operations, such as querying data, performing online searches, interacting with other applications, etc. The interaction here depends on the function of your API. For example, you can query the weather, summarize the article content, and almost all URL requests. .
  2. Impact of setting or not setting Actions:

    • Set Actions: When I configure Actions for the application, the GPT application will be able to perform more complex tasks, making it not just a ‘chatbot’, but a more versatile application In fact, this function is what amazes me the most. I can have unlimited imagination about how fun it is.
    • Not setting Actions: If we do not configure Actions, the application will be limited to the functions mentioned before and cannot interact with external server API interfaces or perform complex URL requests.
  3. Configuration elements for Actions:

    • Schema: This defines the types of actions my app can perform and the required parameters. This tells the GPT model how to understand and handle a specific request.
    • In the Actions configuration page of GPT Builder, Schema is usually defined based on the OpenAPI specification. The OpenAPI specification is a widely used interface description language for describing RESTful API. This specification supports both JSON and YAML formats. for example

Here is a complete configuration example. I use the weather request interface of the third-party aggregated data API to query the weather of a dynamically specified city using a fixed API key. This configuration is in YAML format.

openapi: 3.1.0
info:
  title: SimpleWeatherAPI
  description: API for querying weather information
  version: 1.0.0
servers:
  - url: https://apis.juhe.cn/simpleWeather
paths:
  /query:
    post:
      summary: Query Weather
      description: Query weather information for a specific city
      operationId: queryWeather
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            Schema:
              type: object
              properties:
                city:
                  type: string
                key:
                  type: string
                  default: '19ba4f0*************4a238a35c'
              required:
                - city
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              Schema:
                $ref: '#/components/schemas/WeatherResponse'
components:
  schemas:
    WeatherResponse:
      type: object
      properties:
        resultcode:
          type: string
        reason:
          type: string
        result:
          type: object
          #Add more details about the internal structure of the result object here

Here is a complete configuration example. I use the third-party OpenSum OpenSum’s get summary text request interface, using a fixed API key, based on the passed article link, to generate the summary content of the article and output it in the form of text. . This configuration is in JSON format. This API also uses Bearer token for authentication. You need to configure the Authentication Type accordingly in API Key and select the Auth Type as Bearer. If other types of authentication are used (such as API keys as request parameters), you need to adjust accordingly.

securitySchemes

{<!-- -->
    "openapi": "3.1.0",
    "info": {<!-- -->
      "title": "OpenSum",
      "description": "Get summaries for links",
      "version": "v1.0.0"
    },
    "servers": [
      {<!-- -->
        "url": "https://read.thinkwx.com/api"
      }
    ],
    "paths": {<!-- -->
      "/v1/article/summary": {<!-- -->
        "post": {<!-- -->
          "description": "Get article summary for given link.",
          "operationId": "GetArticleSummary",
          "parameters": [],
          "requestBody": {<!-- -->
            "content": {<!-- -->
              "application/json": {<!-- -->
                "schema": {<!-- -->
                  "$ref": "#/components/schemas/GetArticleSummaryRequestSchema"
                }
              }
            },
            "required": true
          },
          "deprecated": false,
          "security": [
            {<!-- -->
              "apiKey": []
            }
          ]
        }
      }
    },
    "components": {<!-- -->
      "schemas": {<!-- -->
        "GetArticleSummaryRequestSchema": {<!-- -->
          "properties": {<!-- -->
            "link": {<!-- -->
              "type": "string",
              "title": "link",
              "description": "link of an article"
            }
          },
          "type": "object",
          "required": [
            "link"
          ],
          "title": "GetArticleSummaryRequestSchema"
        }
      },
      "securitySchemes": {<!-- -->
        "apiKey": {<!-- -->
          "type": "apiKey"
        }
      }
    }
}
  • Authentication: Used to control and manage how applications securely access and interact with external services, and configure some security authentication KEYs.
    • None: Indicates that this actions request does not require authentication KEY.
    • API Key: Use API key for authentication, suitable for services that require API key access.
    • OAuth: A more complex authentication method, suitable for services that require user login or authorization. I don’t understand it yet and don’t use it.

  • Privacy Policy: This is the policy for how the app handles and protects user data. When publishing the application, you will be prompted to fill it out. I didn’t understand how to write this, so I just filled in an address.

In summary, by configuring and using Actions, the functionality of GPTs applications can be greatly enhanced, enabling it to perform more types of tasks and better meet specific needs.

3.4, GPT Builder Preview Detailed Explanation


GPT Builder’s Preview’ feature, which can test and preview GPTs applications before actual deployment. Provides a convenient environment for debugging and optimization. It has the same function as the preview of the idea tools we usually use, such as the Android Studio mobile system image that can run debugging applications.

  1. Live testing: ‘Preview’ provides a live environment in which you can enter text and see how your GPT application responds.

  2. Debug: By observing how your GPT application reacts to specific prompts, you can better understand your model’s behavior and make adjustments to it before production.

  3. Parameter tuning: You can try different configurations and parameter settings to see how they affect the model’s output. This includes adjusting prompts, changing the model’s behavior, etc.

Summary:

GPTs application development can create a variety of useful and interesting GPTs applications. GPT Builder makes it easier to configure and adjust GPT models to fit our specific needs. GPT Builder provides a fool-like interface that allows us to customize and optimize our GPTs applications through data upload, model training, parameter settings, function selection, etc. We can also use the Actions function to allow our GPTs applications to interact with external services and third-party APIs to achieve more functions. We can use the Preview function to test and preview our GPTs application, debug and optimize it until it meets actual needs. GPTs application development is an opportunity worth trying. It allows us to have our own GPTs application in the AI era.

It took 20+ hours to learn + practice + articles. Please give me a thumbs up. If you have any questions, please feel free to communicate~