Guys wayy too often API calls with OpenAI get timed out. Whatâs the best way to handle it?
There is currently no way to increase timeout for OpenAI API. I contacted the support for the same reason and they told me âwe are exploring options related to increasing the timeout and other workarounds for APIs that have longer response times.
As many of our users want to integrate their Bubble apps with AI, this is certainly on our teams radar and weâre watching this feature request closely.â
Does the API have some other endpoint that you can call upon to check the status of a request you made previously?
I use a completely unrelated API in my app that can officially take up to 2.5 minutes to provide a response which is beyond the 60 second limit from Bubble. Fortunately Iâm able to store a unique transaction ID and make inquiries about the status of the request with an âinquireâ endpoint as much as I want until the original call has been answered.
Would something like that be a workaround for you or is this a totally different situation?
Yeah not in this case. But Iâve done similar thing with Rev.ai. Itâs got both options either use a webhook or check the status every X seconds⌠OpenAI starts responding right away but it types the answer, Itâs sort of like a live communication. API offers âstreamingâ option but Bubble doesnât support real-time connectionsâŚ
Good to know! Sorry to hear that itâs not an option in this case. It sure would make my life easier if the Bubble API timeout limitations could be extended out just a wee bit longer.
Yeaah today Iâve swapped my app from GPT4 to 3.5Turbo. It was waaaay faster but the results canât even come close to what GPT4 returnsâŚ
Holler at me boi! I wanna create a solution
Itâs a wide spread issue with GTP itself unfortunately @jared.gibb
I am having an issue with workflows terminating when an API call times out.
Is there anything we could do in Bubble to be aware of the API call time out so we could still continue to run the rest of the workflow so we could create some kind of workaround like running another workflow that would re-try or at least store some data to know it was a timeout issue.
I have my API calls set to know if there was an error response, and a workflow to save the error responses, but they donât run with a time out since Bubble seems to just terminate the workflow.
Same here. What you can do is somehow add a time conditional. If API doesnât return a response within 50 seconds re-schedule it. Thatâs a response I got from Bubble.
However this solution completely ignores the fact of API response may be needing to take more than 50 seconds⌠So for now I think our hands are tied.
If youâre familiar with Xano or maybe Zapier you could outsource API handling to themâŚ
Thank you for the ideas. I wish Bubble would have added the workflow error trigger to the backend workflows (seems logical and needed) as that would make it so simple to handle these types of issues since the workflow error is logged, which if a trigger was available in the backend, would work.
Iâm thinking that for my particular issue, I might need to redo things and use the API providers webhook, which is what I didnât want to do, but seems necessary at this stage.
2 things I wish Bubble had done
- Make it so a API timeout results in an API response error
- Make workflow error triggers available in the backend
Either of those two would make it possible to do something as the developer to resolve for such issues.