mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
Litellm dev 01 01 2025 p2 (#7615)
* fix(utils.py): prevent double logging when passing 'fallbacks=' to .completion() Fixes https://github.com/BerriAI/litellm/issues/7477 * fix(utils.py): fix vertex anthropic check * fix(utils.py): ensure supported params is always set Fixes https://github.com/BerriAI/litellm/issues/7470 * test(test_optional_params.py): add unit testing to prevent mistranslation Fixes https://github.com/BerriAI/litellm/issues/7470 * fix: fix linting error * test: cleanup
This commit is contained in:
parent
081826a5d6
commit
e8ed40a27b
5 changed files with 115 additions and 206 deletions
|
@ -1021,6 +1021,48 @@ def test_gemini_frequency_penalty():
|
|||
assert "frequency_penalty" in optional_params
|
||||
|
||||
|
||||
def test_litellm_proxy_claude_3_5_sonnet():
|
||||
tools = [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "get_current_weather",
|
||||
"description": "Get the current weather in a given location",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"location": {
|
||||
"type": "string",
|
||||
"description": "The city and state, e.g. San Francisco, CA",
|
||||
},
|
||||
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
|
||||
},
|
||||
"required": ["location"],
|
||||
},
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
tool_choice = "auto"
|
||||
|
||||
optional_params = get_optional_params(
|
||||
model="claude-3-5-sonnet",
|
||||
custom_llm_provider="litellm_proxy",
|
||||
tools=tools,
|
||||
tool_choice=tool_choice,
|
||||
)
|
||||
assert optional_params["tools"] == tools
|
||||
assert optional_params["tool_choice"] == tool_choice
|
||||
|
||||
|
||||
def test_is_vertex_anthropic_model():
|
||||
assert (
|
||||
litellm.VertexAIAnthropicConfig().is_supported_model(
|
||||
model="claude-3-5-sonnet", custom_llm_provider="litellm_proxy"
|
||||
)
|
||||
is False
|
||||
)
|
||||
|
||||
def test_groq_response_format_json_schema():
|
||||
optional_params = get_optional_params(
|
||||
model="llama-3.1-70b-versatile",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue