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

Throttle API Calls #2283

Merged
merged 20 commits into from
Sep 25, 2024
Merged

Throttle API Calls #2283

merged 20 commits into from
Sep 25, 2024

Conversation

WaelKarkoub
Copy link
Contributor

@WaelKarkoub WaelKarkoub commented Apr 5, 2024

Why are these changes needed?

This PR introduces a naive time-based rate limiter to throttle API calls more effectively. While the existing FAQ suggests using max_retries for rate limit errors, this approach can be unreliable and requires fine-tuning. The new rate limiter provides a direct solution to control the flow of API requests, improving the overall reliability.

The user can now specify the api_rate_limit in the config list.

Related issue number

Checks

@codecov-commenter
Copy link

codecov-commenter commented Apr 5, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 20 lines in your changes missing coverage. Please review.

Project coverage is 12.60%. Comparing base (f9d3fda) to head (896f6ea).
Report is 11 commits behind head on main.

Files Patch % Lines
autogen/oai/client.py 18.75% 13 Missing ⚠️
autogen/oai/rate_limiters.py 50.00% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2283       +/-   ##
===========================================
- Coverage   33.88%   12.60%   -21.29%     
===========================================
  Files          87       89        +2     
  Lines        9422     9547      +125     
  Branches     2011     2194      +183     
===========================================
- Hits         3193     1203     -1990     
- Misses       5961     8327     +2366     
+ Partials      268       17      -251     
Flag Coverage Δ
unittest 12.60% <33.33%> (?)
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jackgerrits jackgerrits added this pull request to the merge queue Sep 25, 2024
Merged via the queue into main with commit feef9d4 Sep 25, 2024
145 of 158 checks passed
@jackgerrits jackgerrits deleted the rate-limiter branch September 25, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants