diff --git a/litellm/utils.py b/litellm/utils.py index 178860094..a1ef3352b 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -4060,6 +4060,7 @@ def openai_token_counter( for c in value: if c["type"] == "text": text += c["text"] + num_tokens += len(encoding.encode(c["text"], disallowed_special=())) elif c["type"] == "image_url": if isinstance(c["image_url"], dict): image_url_dict = c["image_url"]