429 Error code with gpt-4
This is an incredible concept! Awesome job!
I am trying this out, but even with the following code above the openai call here, https://github.com/eylonmiz/react-agent/blob/main/backend/main/react-agent/utils/ChatBot.ts#L156
const sleep = (ms: number) => new Promise(r => setTimeout(r, ms))
await sleep(5000);
I am getting this error 429 error from yarn backend:dev
generateComponents start
generateSkeletonCompositionFromStory: skipping - composition already exists
generateComponentsConfigurations: skipping - configuration already exists
generateComponent: generating Component DashboardNav
generateComponent: generating Component TotalRevenueCard
generateComponent: generating Component UserNav
generateComponent: generating Component TeamSwitcher
generateComponent: generating Component SubscriptionsCard
generateComponent: generating Component SalesCard
generateComponent: generating Component RecentSalesCard
generateComponent: generating Component UserNav
generateComponent: generating Component SubscriptionsCard
generateComponent: generating Component ActiveNowCard
generateComponent: generating Component SalesCard
generateComponent: generating Component OverviewCard
generateComponent: generating Component RecentSalesCard
Error: Request failed with status code 429
at createError (C:\Users\Cooper\Documents\GitHub\react-agent\node_modules\openai\node_modules\axios\lib\core\createError.js:16:15)
at settle (C:\Users\Cooper\Documents\GitHub\react-agent\node_modules\openai\node_modules\axios\lib\core\settle.js:17:12)
at IncomingMessage.handleStreamEnd (C:\Users\Cooper\Documents\GitHub\react-agent\node_modules\openai\node_modules\axios\lib\adapters\http.js:322:11)
at IncomingMessage.emit (node:events:525:35)
at endReadableNT (node:internal/streams/readable:1359:12)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
[ERROR] 19:16:48 Error: Request failed with status code 429
I was wondering if anyone else had encountered this.
Thanks
@RCSnyder Even i was facing the same issue but for me status is coming as 404. @eylonmiz First of all great work on the repo, could you help us in resolving the issue.
Thank you guys! These issues come from your API access and limitations by OpenAI. The project uses OpenAI GPT4, which is disabled or limited for most users. 429 -> too many requests, I'm generating independent components in parallel (Promise.all), maybe if you change it to one by one it will work better in your setup. 404 -> Make sure you have the right API key with access to GPT4, (if you do, please make sure you don't have necessary spaces or quotes in '.env' file. I will make sure to resolve these issues soon, please sign up for updates on reactagent.io or join the Discord. Currently, I'm working on designing the V1 Architecture, so no fixes/features for the next week, but after that, I'll be working on resolving issues and cooler features, possibly supporting GPT3.5 and possibly a free limited hosted version! @akshay-shrivastava @RCSnyder If you found a fix you are more than welcome to open a PR and I'll review!
Wrote a fix in #21. Basically, introduced retries with exponential backoff. Solves the problem nicely