The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Merge branch 'main' into litellm_8864-feature-vertex-anyOf-support
NickGrabb72fbdde7497
diff --cc tests/litellm/llms/vertex_ai/test_vertex_ai_common_utils.pyindex 1c6ff65ce6c,b94d7495cb1..0dc4a533fe0--- a/tests/litellm/llms/vertex_ai/test_vertex_ai_common_utils.py+++ b/tests/litellm/llms/vertex_ai/test_vertex_ai_common_utils.py@@@ -43,71 -42,20 +43,88 @@@ async def test_get_vertex_location_fromlocation = get_vertex_location_from_url(url)assert location is None+def test_basic_anyof_conversion():+ """Test basic conversion of anyOf with 'null'."""+ schema = {+ "type": "object",+ "properties": {+ "example": {+ "anyOf": [+ {"type": "string"},+ {"type": "null"}+ ]+ }+ }+ }++ convert_anyof_null_to_nullable(schema)++ expected = {+ "type": "object",+ "properties": {+ "example": {+ "anyOf": [+ {"type": "string", "nullable": True}+ ]+ }+ }+ }+ assert schema == expected+++def test_nested_anyof_conversion():+ """Test nested conversion with 'anyOf' inside properties."""+ schema = {+ "type": "object",+ "properties": {+ "outer": {+ "type": "object",+ "properties": {+ "inner": {+ "anyOf": [+ {"type": "array", "items": {"type": "string"}},+ {"type": "string"},+ {"type": "null"}+ ]+ }+ }+ }+ }+ }++ convert_anyof_null_to_nullable(schema)++ expected = {+ "type": "object",+ "properties": {+ "outer": {+ "type": "object",+ "properties": {+ "inner": {+ "anyOf": [+ {"type": "array", "items": {"type": "string"}, "nullable": True},+ {"type": "string", "nullable": True}+ ]+ }+ }+ }+ }+ }- assert schema == expected++ assert schema == expected++ @pytest.mark.asyncio+ async def test_get_supports_system_message():+ """Test get_supports_system_message with different models"""+ from litellm.llms.vertex_ai.common_utils import get_supports_system_message++ # fine-tuned vertex gemini models will specifiy they are in the /gemini spec format+ result = get_supports_system_message(+ model="gemini/1234567890", custom_llm_provider="vertex_ai"+ )+ assert result == True++ # non-fine-tuned vertex gemini models will not specifiy they are in the /gemini spec format+ result = get_supports_system_message(+ model="random-model-name", custom_llm_provider="vertex_ai"+ )+ assert result == False