Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

Update litellm/llms/openai/responses/count_tokens/transformation.py

Cesar Garcia91928d9d674d
diff --git a/litellm/llms/openai/responses/count_tokens/transformation.py b/litellm/llms/openai/responses/count_tokens/transformation.py
index 3ee0f7eaa61..ca9526bc187 100644
--- a/litellm/llms/openai/responses/count_tokens/transformation.py
+++ b/litellm/llms/openai/responses/count_tokens/transformation.py
@@ -102,7 +102,7 @@ class OpenAICountTokensConfig:
for msg in messages:
role = msg.get("role", "")
- content = msg.get("content", "")
+ content = msg.get("content") or ""
if role in ("system", "developer"):
# Extract system/developer messages as instructions