How to Build and Use ChatGPT Plugins for Your Software

(2024/01/06) - 8 minute read

 

ChatGPT is a powerful and versatile chat platform that allows you to create customized chats using natural language or images. You can use ChatGPT to interact with your customers, users, or audience in a natural and engaging way.

 

But ChatGPT is not just a chat platform. It is also a plugin platform that enables you to enrich your chat with custom and automatic calls to your service (API). This way, you can provide more value and information to your chat users without leaving the chat interface.

 

In this blog post, I will show you how to build and use ChatGPT plugins for your software and what are the benefits and challenges of doing so.

 

What are ChatGpt plugins and why use them?

 

ChatGPT plugins are extensions that allow you to integrate your service (API) with the chat. They are based on the LLM (Large Language Model) which understands your natural language (or images) and can trigger your service (API) to enrich the result of the chat.

 

For example, if you have a software that provides weather information, you can create a ChatGPT plugin that calls your service (API) and returns the weather data for a given location. Then, you can integrate the weather data into the chat answer that the LLM generates.

 

This way, you can offer more value and information to your chat users without leaving the chat interface.

 

Some of the benefits of using ChatGPT plugins are:

 

  • You can reach more customers and users by leveraging the popularity and convenience of ChatGPT.
  • You can enhance the user experience and satisfaction by providing more relevant and useful information in the chat.
  • You can showcase your software and its features in a natural and interactive way.
  • You can save time and resources by relying on the pre-trained and optimized LLMs provided by the ChatGPT platform.

 

Some of the challenges of using ChatGPT plugins are:

 

  • You have to deal with the rights and data protection issues that may arise from sharing your service (API) and data with the ChatGPT platform.
  • You have to ensure that your service (API) is reliable, secure, and scalable to handle the potential traffic and requests from the ChatGPT platform.
  • You have to compete with other plugins and services that may offer similar or better functionalities and value to the chat users.

 

How to build and use ChatGpt plugins?

 

Building and using ChatGPT plugins is quite easy and straightforward. You only need a couple of files, a JSON that describes your service and its parameters, and a manifest for the AI to know what to pass to your API and how to handle the response.

 

The JSON file contains the following information:

 

  • The name and description of your plugin
  • The endpoint names and URLs of your service (API)
  • The input and output parameters of your service (API)
  • The examples and keywords that can trigger your plugin in the chat

 

The manifest file contains the following information:

 

  • The name and version of your plugin
  • The name and version of the ChatGPT platform
  • The name and version of the LLM that your plugin uses
  • The permissions and requirements that your plugin needs

 

The API itself is just a REST service that can be hosted and accessed from the internet, so ChatGPT can call it whenever needed.

 

Here is an example of a JSON file and a manifest file for a weather plugin:

 

JSON

{
  "name": "Weather Plugin",
  "description": "A plugin that provides weather information for a given location",
  "endpoints": [
    {
      "name": "get_weather",
      "url": "https://example.com/api/weather",
      "input": [
        {
          "name": "location",
          "type": "string",
          "description": "The name of the location to get the weather for"
        }
      ],
      "output": [
        {
          "name": "temperature",
          "type": "number",
          "description": "The current temperature in Celsius"
        },
        {
          "name": "condition",
          "type": "string",
          "description": "The current weather condition"
        }
      ]
    }
  ],
  "examples": [
    {
      "query": "What is the weather in Berlin?",
      "response": "The weather in Berlin is 15°C and sunny."
    },
    {
      "query": "How about Paris?",
      "response": "The weather in Paris is 18°C and cloudy."
    }
  ],
  "keywords": [
    "weather",
    "temperature",
    "condition",
    "forecast"
  ]
}

manifest

{
  "name": "Weather Plugin",
  "version": "1.0.0",
  "platform": {
    "name": "ChatGPT",
    "version": "1.2.3"
  },
  "model": {
    "name": "ChatGPT-4",
    "version": "1.0.0"
  },
  "permissions": [
    "internet",
    "location"
  ],
  "requirements": [
    "api_key"
  ]
}

 

Once you have created your JSON file and your manifest file, you can upload them to the ChatGPT store and wait for approval. Once approved, your plugin will be available for the chat users to select and activate.

 

To use your plugin, the chat users simply have to type a query that matches one of your examples or keywords, and the LLM will call your service (API) and integrate the result into the chat answer.

 

For example, if a chat user types "What is the weather in Berlin?", the LLM will call your service (API) with the input parameter "location" set to "Berlin", and your service (API) will return the output parameters "temperature" and "condition". Then, the LLM will generate a chat answer that includes the weather data, such as "The weather in Berlin is 15°C and sunny."

 

Conclusion

 

ChatGPT plugins are a great way to enhance your chat with custom and automatic calls to your service (API). They allow you to provide more value and information to your chat users without leaving the chat interface.

 

Building and using ChatGPT plugins is easy and straightforward. You only need a couple of files, a JSON that describes your service and its parameters, and a manifest for the AI to know what to pass to your API and how to handle the response.

 

However, you also have to consider the rights and data protection issues, the reliability and security of your service (API), and the competition with other plugins and services.

 

If you are interested in creating your own ChatGPT plugin, you can check out the documentation and tutorials on the ChatGPT website.

 

Thank you for reading and happy chatting!

Renier Roth