diff --git a/litellm/cost_calculator.py b/litellm/cost_calculator.py index d6f9adb00..0fab08625 100644 --- a/litellm/cost_calculator.py +++ b/litellm/cost_calculator.py @@ -665,7 +665,7 @@ def completion_cost( if custom_llm_provider is not None and custom_llm_provider == "vertex_ai": # Calculate the prompt characters + response characters - if len("messages") > 0: + if len(messages) > 0: prompt_string = litellm.utils.get_formatted_prompt( data={"messages": messages}, call_type="completion" )