Explorer API and chatGPT error

I’m trying to use chatgpt with intuiface, and I’m using explorer API.

Inside the API Explorer everything works normally, but when I try to use it inside composer, clicking a button in the composer logs always returns 404.

I cannot understand why. Inside the API explorer it works and inside the app, it doesn’t work.

Any idea?

Errors:

01/05/2023 13:43:39-04:00 : 22144 : Error : Error calling web service ‘POST https://api.openai.com/v1/chat/completions’ - inner exception level 1

01/05/2023 13:43:39-04:00 : 22144 : Error : O servidor remoto retornou um erro: (400) Solicitação Incorreta. in ‘Google.Apis’: em Google.Apis.Requests.Request.AsyncRequestResult.GetResponse()
em IntuiLab.Assets.ExternalAssets.Protocols.RestV2.IFWExternalAssetRestResourceWrapper.<>c__DisplayClass26_0.b__0(IAsyncRequestResult asyncRequestResult)
01/05/2023 13:43:39-04:00 : 22144 : Error : Error calling web service ‘POST https://api.openai.com/v1/chat/completions’ - inner exception level 2

01/05/2023 13:43:39-04:00 : 22144 : Error : O servidor remoto retornou um erro: (400) Solicitação Incorreta. in ‘System’: em System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
em Google.Apis.Requests.Request.InternalEndExecuteRequest(IAsyncResult asyncResult)

Grateful!

Hi Carlos and welcome to the Intuiface community.

First of all, I’d like to say that for such questions, I’d recommend contacting our support team here so they can ask for some private information, such as sharing the experience you’ve started to build, so it’s easier for them to analyze your issue.

That being said, without seeing the exact parameters you set in API Explorer, I’ll take a guess and say that you encountered a known limitation that we have at the moment: parameters given in a JSON body will only be sent as a string value by our Player for Windows.
If you have a numeric parameter sent in API Explorer, it works there, but once imported into Composer, that parameter will be sent as a string instead of a number and OpenAI APIs don’t support that.
This is why we created a custom Interface Asset in this sample you can find in our Marketplace. Feel free to re-use this Interface Asset as explained in this article.

If I guessed wrong and you think you have a different issue, then going through our support channel will be the most efficient way to assist you.