Skip to content

Instantly share code, notes, and snippets.

@timvw
Created May 14, 2024 08:38
Show Gist options
  • Save timvw/4419f55e4b52a719655b0ea8ce5cbd2e to your computer and use it in GitHub Desktop.
Save timvw/4419f55e4b52a719655b0ea8ce5cbd2e to your computer and use it in GitHub Desktop.
raise openai.RateLimitError
import httpx
request = httpx.request("GET", "https://google.com")
response = httpx.Response(429, request=request)
err = openai.RateLimitError(
"you are making too many requests...", response=response, body=None
)
raise err
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment