mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
Litellm dev 01 21 2025 p1 (#7898)
* fix(utils.py): don't pass 'anthropic-beta' header to vertex - will cause request to fail * fix(utils.py): add flag to allow user to disable filtering invalid headers ensure user can control behaviour * style(utils.py): cleanup message * test(test_utils.py): add unit test to cover invalid header filtering * fix(proxy_server.py): fix custom openapi schema generation * fix(utils.py): pass extra headers if set * fix(main.py): fix image variation to use 'client' param
This commit is contained in:
parent
dd385410df
commit
866fffb50d
9 changed files with 161 additions and 21 deletions
|
@ -1494,3 +1494,26 @@ def test_get_num_retries(num_retries):
|
|||
"num_retries": num_retries,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("filter_invalid_headers", [True, False])
|
||||
@pytest.mark.parametrize(
|
||||
"custom_llm_provider, expected_result",
|
||||
[("anthropic", {"anthropic-beta": "123"}), ("bedrock", {}), ("vertex_ai", {})],
|
||||
)
|
||||
def test_get_clean_extra_headers(
|
||||
filter_invalid_headers, custom_llm_provider, expected_result, monkeypatch
|
||||
):
|
||||
from litellm.utils import get_clean_extra_headers
|
||||
|
||||
monkeypatch.setattr(litellm, "filter_invalid_headers", filter_invalid_headers)
|
||||
|
||||
if filter_invalid_headers:
|
||||
assert (
|
||||
get_clean_extra_headers({"anthropic-beta": "123"}, custom_llm_provider)
|
||||
== expected_result
|
||||
)
|
||||
else:
|
||||
assert get_clean_extra_headers(
|
||||
{"anthropic-beta": "123"}, custom_llm_provider
|
||||
) == {"anthropic-beta": "123"}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue