mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
test_embedding_response_ratelimit_headers
This commit is contained in:
parent
91c0a794b9
commit
311c70698f
1 changed files with 8 additions and 3 deletions
|
@ -1075,9 +1075,14 @@ def test_embedding_response_ratelimit_headers(model):
|
|||
hidden_params = response._hidden_params
|
||||
additional_headers = hidden_params.get("additional_headers", {})
|
||||
|
||||
print(additional_headers)
|
||||
assert "x-ratelimit-remaining-requests" in additional_headers
|
||||
assert int(additional_headers["x-ratelimit-remaining-requests"]) > 0
|
||||
print("additional_headers", additional_headers)
|
||||
|
||||
# Azure is flaky with returning x-ratelimit-remaining-requests, we need to verify the upstream api returns this header
|
||||
# if upstream api returns this header, we need to verify the header is transformed by litellm
|
||||
if "llm_provider-x-ratelimit-limit-requests" in additional_headers or "x-ratelimit-limit-requests" in additional_headers:
|
||||
assert "x-ratelimit-remaining-requests" in additional_headers
|
||||
assert int(additional_headers["x-ratelimit-remaining-requests"]) > 0
|
||||
|
||||
assert "x-ratelimit-remaining-tokens" in additional_headers
|
||||
assert int(additional_headers["x-ratelimit-remaining-tokens"]) > 0
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue