Fix all 130126 tests

This commit is contained in:
Sameer Kankute 2026-01-14 17:42:52 +05:30
parent 8b987db26f
commit d03548b064
6 changed files with 14 additions and 12 deletions

View file

@ -1533,6 +1533,7 @@ class AWSEventStreamDecoder:
)
],
id=self.response_id,
model=self.model,
usage=usage,
provider_specific_fields=model_response_provider_specific_fields,
)

View file

@ -236,6 +236,7 @@ class BedrockPassthroughConfig(
if len(all_translated_chunks) > 0:
model_response = stream_chunk_builder(
chunks=all_translated_chunks,
logging_obj=litellm_logging_obj,
)
return model_response
return None

View file

@ -362,7 +362,7 @@ class OpenAIChatCompletionsHandler(BaseTranslation):
if has_stream_ended:
# convert to model response
model_response = cast(
ModelResponse, stream_chunk_builder(chunks=responses_so_far)
ModelResponse, stream_chunk_builder(chunks=responses_so_far, logging_obj=litellm_logging_obj)
)
# run process_output_response
await self.process_output_response(

View file

@ -98,16 +98,16 @@ class IBMWatsonXAudioTranscriptionConfig(
"""
# Use common utility to process the audio file
processed_audio = process_audio_file(audio_file)
# Get API params to extract project_id or space_id
api_params = _get_api_params(params=optional_params.copy(), model=model)
project_id = optional_params.get("project_id") or optional_params.get(
"watsonx_project"
)
space_id = optional_params.get("space_id")
api_params = _get_api_params(params=optional_params, model=model)
# Initialize form data with required fields
form_data: WatsonXAudioTranscriptionRequestBody = {"model": model}
project_id = api_params.get("project_id")
space_id = api_params.get("space_id")
# Only add project_id or space_id if they were explicitly provided by the user
if project_id:
form_data["project_id"] = project_id
elif space_id:

View file

@ -7094,8 +7094,8 @@ async def token_counter(request: TokenCountRequest, call_endpoint: bool = False)
f"Provider token counting failed ({result.status_code}): {result.error_message}. "
"Falling back to local tokenizer."
)
else:
# Success - return the result
elif result is not None:
# Success - return the result (only if not None)
return result
# Check if token counter is disabled before fallback

View file

@ -1514,7 +1514,7 @@ class Router:
return FallbackStreamWrapper(stream_with_fallbacks())
async def _acompletion(
async def _acompletion( # noqa: PLR0915
self, model: str, messages: List[Dict[str, str]], **kwargs
) -> Union[ModelResponse, CustomStreamWrapper,]:
"""
@ -1699,13 +1699,13 @@ class Router:
per-deployment retry settings instead of the global setting.
"""
# Only set if exception doesn't already have num_retries
if hasattr(exception, "num_retries") and exception.num_retries is not None:
if hasattr(exception, "num_retries") and exception.num_retries is not None: # type: ignore
return
litellm_params = deployment.get("litellm_params", {})
dep_num_retries = litellm_params.get("num_retries")
if dep_num_retries is not None and isinstance(dep_num_retries, int):
exception.num_retries = dep_num_retries
exception.num_retries = dep_num_retries # type: ignore
def _update_kwargs_with_default_litellm_params(
self, kwargs: dict, metadata_variable_name: Optional[str] = "metadata"