diff --git a/litellm/integrations/opentelemetry.py b/litellm/integrations/opentelemetry.py index 449f524eec9..5b82ac3b3c9 100644 --- a/litellm/integrations/opentelemetry.py +++ b/litellm/integrations/opentelemetry.py @@ -302,6 +302,8 @@ class OpenTelemetry(CustomLogger): ) if prompt.get("content"): + if not isinstance(prompt.get("content"), str): + prompt["content"] = str(prompt.get("content")) span.set_attribute( f"{SpanAttributes.LLM_PROMPTS}.{idx}.content", prompt.get("content"),