From 0ce6c038eed5e4d90dceace41ca4f56f1b62a430 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Fri, 2 Aug 2024 10:37:53 -0700 Subject: [PATCH] fix(anthropic.py): fix linting error --- litellm/llms/anthropic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/llms/anthropic.py b/litellm/llms/anthropic.py index e3bc595dd4e..ab47c95372c 100644 --- a/litellm/llms/anthropic.py +++ b/litellm/llms/anthropic.py @@ -464,7 +464,8 @@ class AnthropicConfig: # extract usage usage: litellm.Usage = getattr(response, "usage") anthropic_usage = AnthropicResponseUsageBlock( - input_tokens=usage.prompt_tokens, output_tokens=usage.completion_tokens + input_tokens=usage.prompt_tokens or 0, + output_tokens=usage.completion_tokens or 0, ) translated_obj = AnthropicResponse( id=response.id,