Skip to content

Commit

Permalink
fix(oai): fixing a bug when not using the OpenAIWrapper by making rat…
Browse files Browse the repository at this point in the history
…e limiter config optional. (#4066)

Co-authored-by: Joel Klaverkamp <[email protected]>
  • Loading branch information
kampernet and joel-upfeat authored Nov 5, 2024
1 parent 9f42888 commit 23c14bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autogen/oai/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ def extract_text_or_completion_object(

def _throttle_api_calls(self, idx: int) -> None:
"""Rate limit api calls."""
if self._rate_limiters[idx]:
if idx < len(self._rate_limiters) and self._rate_limiters[idx]:
limiter = self._rate_limiters[idx]

assert limiter is not None
Expand Down

0 comments on commit 23c14bc

Please sign in to comment.