Update rate limit error detection criteria for Azure OpenAI API (#1254)

This commit is contained in:
Xingjian (Jimmy) Zhang 2024-07-08 03:16:25 +08:00 committed by GitHub
parent ffa9ad20eb
commit e9d4211e55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -322,7 +322,7 @@ class APIRequest:
)
status_tracker.num_api_errors += 1
error = response
if "Rate limit" in response["error"].get("message", ""):
if "rate limit" in response["error"].get("message", "").lower():
status_tracker.time_of_last_rate_limit_error = time.time()
status_tracker.num_rate_limit_errors += 1
status_tracker.num_api_errors -= (