Help with openai

Options
Anthony Mastrangelo
Anthony Mastrangelo Member
edited March 2023 in ? Working with APIs

Hello,

Im trying to work with the new chat API from Openai. here is the cURL request example from their documentation:

the “messages” param is an array that must be formatted like so…

I've set up written the code in my api call and I have confirmed on webhook.site that im sending the messages array in the right format. here is my output to webhook.site:



my question is how can I set this up in xano api. Im getting stuck at what input I should use and how to map this correctly. here is my api:

I used a json object as the input, and set the value of the “messages” path to my input which is the json ob

Best Answer

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Answer ✓
    Options

    Looks to me like you just have messages correct from the outset, so I would remove both “push” calls from the “messages” set call.

    Beyond that, I can't quite see enough to share more insight. If you have more issues, share a little more!

    We work on OpenAI and generative AI questions more generally as part of our “hardest 5%” in our daily office hours at State Change. These APIs can be a bit tricky, and the interactive format lets us crack through the issues faster.

Answers