UBOS Community

Vika
Vika

Posted on

Creating Custom GPT with Complex Outside Actions Using API endpoints!

Introduction 🤖

To create and train your custom bot using API endpoints in the OpenAI console, you must have a paid Plus or Team account. 💳 This ensures that you have access to all necessary features and capabilities required for developing and fine-tuning your bot effectively. 🚀 In this guide, we will walk you through the steps needed to get started with your custom bot development journey. 🛠️

Image description

Getting Started

To begin, you need to log into your ChatGPT account and find the "Explore GPTs" tab in the left sidebar menu. 📂

Image description

Creating Your Custom Bot

The next step is to create your custom bot. 🤖

Image description

Configuring Your Bot

Now it's time to configure your bot:

  1. Name 🏷️
  2. Description 📝
  3. Instructions 📋 (this significantly affects the quality of the bot's responses)
  4. Conversation Starters 💬 (the message the user receives when initiating a conversation)
  5. Web browsing, DALL·E Image Generation are optional

And most importantly, create a new action, which we will configure in detail later. 🔧

Image description

Maximizing AI Capabilities with the New Action Feature

This new feature helps you utilize the potential of artificial intelligence to its fullest and saves you time if you already have knowledge bases from which you can retrieve information via API. 🌐 Additionally, there are many third-party services on the internet that can provide information about currencies, weather, parse LinkedIn, or your social media. 📊

Vector databases or PostgreSQL (those that support semantic search) have proven to be the most effective, but you can use any database. 💾 In this example, we will create an Action using MongoDB and Node-red. 🚀
In our example, we simply provided the code for our flow on UBOS platform . 💻

If you have a database or plan to create one and want to connect it to your chatbot, follow these steps:

  1. 📝 Create an Account on the UBOS Platform

  2. 🛠️ Set Up a Workspace and Launch Node-RED

  3. 💾 Install MongoDB and Connect Your Database

  4. 🔍 Create a GET Request to Your Database (if already created)

  5. 🛠️ Or Create Your Own Database

For example, we have a very simple database that contains the name of a city and a description for each.
🏙️ We've built the simplest flow in Node-red to retrieve data from this database based on the query parameter name. 📥

Image description

Creating the API Schema

The ChatGPT documentation requires adding a schema for using your API.

Image description

The simplest way to create this is through artificial intelligence. To do this, send a request with the following prompt and API usage schema (if you're using third-party services, you can find this information in their documentation).ʼ

  1. 🤖 Connect Your Database to Your Custom Chat GPT

For convenience in writing the schema as required by OpenAI documentation, it's best to utilize artificial intelligence.

Image description
Our prompt

I am creating a custom gpt that can search city information. Here is some code snippets. 
Write me  the correct openapi schema
Enter fullscreen mode Exit fullscreen mode

You will receive a schema that you need to insert into the input field. If there are no errors, your bot is ready for testing. ✅

Image description

Image description
Important

openapi: 3.1.0
servers:
  - url: _your server url_
Enter fullscreen mode Exit fullscreen mode

Testing the Bot
Let's test the bot! 🧪 As you can see, the bot successfully retrieves and uses data from our knowledge base. 🎉

Image description

Image description

Top comments (0)