Getting wrong answers after a DB query

There is a number of things required to make this work and unfortunalely, chatgpt wasn’t of much help to guide me though, it even told me this wasn’t supported.
Here is a summary of what I did.
1- you need a valid https server address to use Actions in the GPT config. I use nGrok (paid version 10$/month) to get one and redirect it to my home raspberry pi through a local tunnel. Don`t waste your time with the free version, it requires to click a button, someting the GPT won’t do.
2 - Using chatgpt, I created a python REST API server based on flask that exposed a route to get my client list in a json format. You will need to create a function in this program to access the DB.
3 - I provided chatgpt with the json file and asked to create an openapi 3…0.0 schema. I pasted it in the GPT config. Make sure to provide good descriptions of your fields in that schema.
That’s about it. The GPT automatically understands that it needs to connect to the rest api to retrieve the client list. That was pretty impressive.
Note that you will only be able to share your GPT with people using the paid version. I would have used the platform approach if I had know that in advance.

Search Google with “Building An OpenAI GPT with Your API: A Step-by-Step Guide” by Alexander Sniffin. That was my basis to start.

Hope this helps

1 Like