mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +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
|
@ -1,6 +1,6 @@
|
|||
# What is this?
|
||||
## Handler file for calling claude-3 on vertex ai
|
||||
from typing import List, Optional
|
||||
from typing import List
|
||||
|
||||
import httpx
|
||||
|
||||
|
@ -65,13 +65,16 @@ class VertexAIAnthropicConfig(AnthropicConfig):
|
|||
return data
|
||||
|
||||
@classmethod
|
||||
def is_supported_model(
|
||||
cls, model: str, custom_llm_provider: Optional[str] = None
|
||||
) -> bool:
|
||||
def is_supported_model(cls, model: str, custom_llm_provider: str) -> bool:
|
||||
"""
|
||||
Check if the model is supported by the VertexAI Anthropic API.
|
||||
"""
|
||||
if custom_llm_provider == "vertex_ai" and "claude" in model.lower():
|
||||
if (
|
||||
custom_llm_provider != "vertex_ai"
|
||||
and custom_llm_provider != "vertex_ai_beta"
|
||||
):
|
||||
return False
|
||||
if "claude" in model.lower():
|
||||
return True
|
||||
elif model in litellm.vertex_anthropic_models:
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue