Skip to content

Commit 23c14bc

Browse files
fix(oai): fixing a bug when not using the OpenAIWrapper by making rate limiter config optional. (#4066)
Co-authored-by: Joel Klaverkamp <[email protected]>
1 parent 9f42888 commit 23c14bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autogen/oai/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ def extract_text_or_completion_object(
10691069

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

10751075
assert limiter is not None

0 commit comments

Comments
 (0)