I will do a video for this in the next few days, but had to share ๐ I was able to do a Post API call from my custom GPT into Xano for my test app that gets a recipe based on a protein you select.
It was a lot easier than I thought it would be.
I created a new table in Xano (recipes) and a POST API to add a recipe to the table. I got the new swagger documentation and updated it with the changes that need to be made for it to be compatible in a custom GPT action (see video below for specifics of how to do this -- only 2 simple changes).
I pasted the new swagger (openapi) documentation into the GPT action that was created in my first video, below. You will see the original GET api and the new POST api if you updated the openapi documentation correctly.
Then,
1. I simply tested the GET api (just click the "test" button) to get the list of proteins from my Xano database
2. My GPT asked what protein I wanted to use. I selected one.
3. The GPT shared a recipe based on that protein
4. As a quick test of its ability to "just call the POST API" I gave it these instructions...
"use the recipe information to call the postRecipeNew action. The name of the recipe should be populated in the name property, the ingredients and instructions should be populated in the instructions property and add the final sentences after the instructions as part of the description property"
5. It called the POST API in my Xano workspace based on the instructions above and the recipe was added to my new recipe table ("name", "description", and "instructions")!!
As a next step, I will add the instructions to my GPT to call the POST api to the configuration so it is a way to "favorite" a recipe.
[UPDATE] I was able to tell my GPT to "save the recipe" and it figured out how to do it without me having to do any specific configuration. It called the POST API and put the right data in the right fields for the API ๐ณ It may have "learned" from my instructions in #4 above? Also, I looked at the GPT Configuration info and there wasn't a reference to using the POST api in any fashion...I guess I have to figure out the edges of what it can do and what I don't have to teach it.
First video I did for GPT & Xano (get a list API)
https://youtu.be/wKusxgGZWWE
More GPT fun with Xano APIs
Connect Xano to...
4
4 replies