diff --git a/litellm/proxy/ocr_endpoints/endpoints.py b/litellm/proxy/ocr_endpoints/endpoints.py index dc7edba28c5..3c858f0a69d 100644 --- a/litellm/proxy/ocr_endpoints/endpoints.py +++ b/litellm/proxy/ocr_endpoints/endpoints.py @@ -37,7 +37,7 @@ def _build_document_from_upload( ) return convert_file_document_to_url_document( - { + { # mutable-ok: OCR file document TypedDict handed to the converter "type": "file", "file": file_content, "mime_type": mime_type or "application/octet-stream", diff --git a/litellm/rust_bridge/leaves.py b/litellm/rust_bridge/leaves.py index d10a348c306..e94f6bb65b6 100644 --- a/litellm/rust_bridge/leaves.py +++ b/litellm/rust_bridge/leaves.py @@ -880,7 +880,7 @@ def dispatch_named_failure( kwargs={ # mutable-ok: logfire receives a private mutable copy key: value for key, value in details.items() if key != "original_response" } - | {"exception": exception}, + | {"exception": exception}, # mutable-ok: merged into the private copy above response_obj=None, start_time=start_time, end_time=end_time, diff --git a/litellm/rust_bridge/ocr.py b/litellm/rust_bridge/ocr.py index 04f842c8dcc..069ec7a4ae6 100644 --- a/litellm/rust_bridge/ocr.py +++ b/litellm/rust_bridge/ocr.py @@ -24,7 +24,7 @@ class OcrLoggingProtocol(Protocol): def _redact(params: Mapping[str, object], secret_fields: Sequence[str]) -> dict[str, object]: - return { + return { # mutable-ok: update_from_kwargs takes dict name: "****" if name in secret_fields else value for name, value in params.items() if name != "proxy_server_request" @@ -44,11 +44,13 @@ def update_logging( kwargs=_redact(kwargs, secret_fields), model=model, optional_params=_redact(optional_params, secret_fields), - litellm_params={ + litellm_params={ # mutable-ok: update_from_kwargs takes dict "litellm_call_id": kwargs.get("litellm_call_id"), "api_base": url, - **{name: kwargs[name] for name in ("logger_fn", "litellm_request_debug") if name in kwargs}, **{ + name: kwargs[name] for name in ("logger_fn", "litellm_request_debug") if name in kwargs + }, # mutable-ok: splat into the dict above + **{ # mutable-ok: splat into the dict above name: kwargs[name] for name in CustomPricingLiteLLMParams.model_fields if name in kwargs and kwargs[name] is not None