Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

429 Error code with gpt-4 #8

Open
RCSnyder opened this issue May 18, 2023 · 3 comments
Open

429 Error code with gpt-4 #8

RCSnyder opened this issue May 18, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@RCSnyder
Copy link

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

@akshay-shrivastava
Copy link

@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.

@eylonmiz
Copy link
Owner

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!

@eylonmiz eylonmiz self-assigned this May 18, 2023
@eylonmiz eylonmiz added the bug Something isn't working label May 18, 2023
@areibman
Copy link
Contributor

Wrote a fix in #21. Basically, introduced retries with exponential backoff. Solves the problem nicely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants