mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-04 02:31:27 +00:00
Fix failing tests
This commit is contained in:
parent
7ab66047a8
commit
565c42a936
5 changed files with 13 additions and 18 deletions
|
|
@ -319,12 +319,8 @@ class RubrikLogger(CustomGuardrail, CustomBatchLogger):
|
|||
"content": system_prompt_msg_list,
|
||||
}
|
||||
if isinstance(standard_logging_payload["messages"], list):
|
||||
standard_logging_payload["messages"].insert(
|
||||
0, system_scaffold
|
||||
)
|
||||
elif isinstance(
|
||||
standard_logging_payload["messages"], (dict, str)
|
||||
):
|
||||
standard_logging_payload["messages"].insert(0, system_scaffold)
|
||||
elif isinstance(standard_logging_payload["messages"], (dict, str)):
|
||||
standard_logging_payload["messages"] = [
|
||||
system_scaffold,
|
||||
standard_logging_payload["messages"],
|
||||
|
|
@ -354,14 +350,10 @@ class RubrikLogger(CustomGuardrail, CustomBatchLogger):
|
|||
exc_info=True,
|
||||
)
|
||||
|
||||
async def async_log_success_event(
|
||||
self, kwargs, response_obj, start_time, end_time
|
||||
):
|
||||
async def async_log_success_event(self, kwargs, response_obj, start_time, end_time):
|
||||
await self._enqueue_log_event(kwargs, "success")
|
||||
|
||||
async def async_log_failure_event(
|
||||
self, kwargs, response_obj, start_time, end_time
|
||||
):
|
||||
async def async_log_failure_event(self, kwargs, response_obj, start_time, end_time):
|
||||
await self._enqueue_log_event(kwargs, "failure")
|
||||
|
||||
# -- Batch logging ---------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -170,7 +170,9 @@ class AmazonAnthropicClaudeConfig(AmazonInvokeConfig, AnthropicConfig):
|
|||
anthropic_request.pop("model", None)
|
||||
anthropic_request.pop("stream", None)
|
||||
anthropic_request.pop("output_format", None)
|
||||
if not _supports_factory(model=model, custom_llm_provider=None, key="supports_output_config"):
|
||||
if not _supports_factory(
|
||||
model=model, custom_llm_provider=None, key="supports_output_config"
|
||||
):
|
||||
anthropic_request.pop("output_config", None)
|
||||
if "anthropic_version" not in anthropic_request:
|
||||
anthropic_request["anthropic_version"] = self.anthropic_version
|
||||
|
|
|
|||
|
|
@ -515,7 +515,9 @@ class AmazonAnthropicClaudeMessagesConfig(
|
|||
# 5b. Bedrock Invoke supports output_config (effort) for Claude 4.6+ models,
|
||||
# but older models do not — strip it to avoid request rejection.
|
||||
# Ref: https://github.com/BerriAI/litellm/issues/22797
|
||||
if not _supports_factory(model=model, custom_llm_provider=None, key="supports_output_config"):
|
||||
if not _supports_factory(
|
||||
model=model, custom_llm_provider=None, key="supports_output_config"
|
||||
):
|
||||
anthropic_messages_request.pop("output_config", None)
|
||||
|
||||
# 5a. Remove `custom` field from tools (Bedrock doesn't support it)
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ async def test_vertex_ai_gpt_oss_simple_request():
|
|||
"litellm.llms.custom_httpx.http_handler.AsyncHTTPHandler"
|
||||
) as mock_http_handler,
|
||||
patch(
|
||||
"litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini.VertexLLM._ensure_access_token",
|
||||
"litellm.llms.vertex_ai.vertex_ai_partner_models.main.VertexAIPartnerModels._ensure_access_token",
|
||||
return_value=("fake-token", "pathrise-convert-1606954137718"),
|
||||
),
|
||||
patch.dict(
|
||||
|
|
@ -217,7 +217,7 @@ async def test_vertex_ai_gpt_oss_reasoning_effort():
|
|||
"litellm.llms.custom_httpx.http_handler.AsyncHTTPHandler"
|
||||
) as mock_http_handler,
|
||||
patch(
|
||||
"litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini.VertexLLM._ensure_access_token",
|
||||
"litellm.llms.vertex_ai.vertex_ai_partner_models.main.VertexAIPartnerModels._ensure_access_token",
|
||||
return_value=("fake-token", "pathrise-convert-1606954137718"),
|
||||
),
|
||||
patch.dict(
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ These tests verify that:
|
|||
3. The completion() and responses() API work with Qwen models
|
||||
"""
|
||||
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
from unittest.mock import MagicMock, patch, AsyncMock
|
||||
|
|
@ -179,7 +178,7 @@ async def test_vertex_ai_qwen_global_endpoint_url():
|
|||
"litellm.llms.custom_httpx.http_handler.AsyncHTTPHandler"
|
||||
) as mock_http_handler,
|
||||
patch(
|
||||
"litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini.VertexLLM._ensure_access_token",
|
||||
"litellm.llms.vertex_ai.vertex_ai_partner_models.main.VertexAIPartnerModels._ensure_access_token",
|
||||
return_value=("fake-token", "test-project"),
|
||||
),
|
||||
patch.dict(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue