fix(oai): fixing a bug when not using the OpenAIWrapper by making rate limiter config optional. (#4066)

Co-authored-by: Joel Klaverkamp <joel.klaverkamp@upfeat.com>
This commit is contained in:
Joel Klaverkamp 2024-11-05 13:19:28 -06:00 committed by GitHub
parent 9f428880b3
commit 23c14bc937
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -1069,7 +1069,7 @@ class OpenAIWrapper:
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