(fix) get_response_headers for Azure OpenAI (#6344)

* fix get_response_headers

* unit testing for get headers

* unit testing for anthropic / azure openai headers

* increase test coverage for test_completion_response_ratelimit_headers

* fix test rate limit headers
This commit is contained in:
Ishaan Jaff 2024-10-21 20:41:35 +05:30 committed by GitHub
parent fb523b79e9
commit 274bf3e48d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 316 additions and 30 deletions

View file

@ -4569,6 +4569,13 @@ def test_completion_response_ratelimit_headers(model, stream):
assert "x-ratelimit-remaining-requests" in additional_headers
assert "x-ratelimit-remaining-tokens" in additional_headers
if model == "azure/chatgpt-v-2":
# Azure OpenAI header
assert "llm_provider-azureml-model-session" in additional_headers
if model == "claude-3-sonnet-20240229":
# anthropic header
assert "llm_provider-anthropic-ratelimit-requests-reset" in additional_headers
def _openai_hallucinated_tool_call_mock_response(
*args, **kwargs