From 88284c5ffaf9f90fd451783cc4cb2f91b02304ec Mon Sep 17 00:00:00 2001 From: D41910 <158550716+D41910@users.noreply.github.com> Date: Thu, 15 Oct 2026 01:22:12 +0800 Subject: [PATCH] fix: address review and validation findings for PR 44819 --- litellm/llms/anthropic/pass_through/adapters/handler.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/litellm/llms/anthropic/pass_through/adapters/handler.py b/litellm/llms/anthropic/pass_through/adapters/handler.py index d8975d85878..7fc0addae4e 100644 --- a/litellm/llms/anthropic/pass_through/adapters/handler.py +++ b/litellm/llms/anthropic/pass_through/adapters/handler.py @@ -82,9 +82,7 @@ def _store_response_cost_before_usage_flattening(completion_response: object, kw litellm_logging_obj = litellm_logging_obj_from_kwargs(kwargs) if litellm_logging_obj is None: return - # cast-ok: the adapter hands back an OpenAI-shaped ModelResponse; the calculator - # accepts it as-is and only the usage fields are read. - model_response: Final = cast(ModelResponse, completion_response) + model_response: Final = cast(ModelResponse, completion_response) # cast-ok: adapter returns ModelResponse usage: Final = getattr(model_response, "usage", None) if not isinstance(usage, Usage): return