Skip to content

OpenAI Rate Limit Error #32

@stoltzmaniac

Description

@stoltzmaniac

For those with limited OpenAI access, the rate limit is hit in the "stock_analysis" example at: https://github.com/joaomdmoura/crewAI-examples?tab=readme-ov-file

*Error: *

Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised RateLimitError: Rate limit reached for gpt-4 in organization org-XXXX on tokens_usage_based per min: Limit 10000, Used 7760, Requested 2270. Please try again in 180ms. Visit https://platform.openai.com/account/rate-limits to learn more..
Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised RateLimitError: Rate limit reached for gpt-4 in organization org-XXXX on tokens_usage_based per min: Limit 10000, Used 8208, Requested 2276. Please try again in 2.904s. Visit https://platform.openai.com/account/rate-limits to learn more..
Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised RateLimitError: Rate limit reached for gpt-4 in organization org-XXXX on tokens_usage_based per min: Limit 10000, Used 8137, Requested 2500. Please try again in 3.822s. Visit https://platform.openai.com/account/rate-limits to learn more..
Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised RateLimitError: Rate limit reached for gpt-4 in organization org-XXXX on tokens_usage_based per min: Limit 10000, Used 8440, Requested 2281. Please try again in 4.326s. Visit https://platform.openai.com/account/rate-limits to learn more..

Is there a good place within crewAI to add handling for this? If so, please link to the class/function and I will give it a shot. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions