Merge pull request #3428 from pipecat-ai/mb/fix-tracing-none-values

Fix TTS, realtime LLM services could return unknown for model_name
This commit is contained in:
Mark Backman
2026-01-13 15:40:10 -05:00
committed by GitHub
4 changed files with 12 additions and 6 deletions

1
changelog/3351.fixed.md Normal file
View File

@@ -0,0 +1 @@
- Fixed an issue in `traced_stt` where `model_name` in OpenTelemetry appears as `unknown`.

View File

@@ -1 +1 @@
- Fixed a bug in `traced_llm` where the model name in opentelemetry is shown unknown even though it is defined.
- Fixed an issue in `traced_llm` where `model_name` in OpenTelemetry appears as `unknown`.

1
changelog/3428.fixed.md Normal file
View File

@@ -0,0 +1 @@
- Fixed an issue in `traced_tts`, `traced_gemini_live`, and `traced_openai_realtime` where `model_name` in OpenTelemetry appears as `unknown`.

View File

@@ -186,7 +186,7 @@ def traced_tts(func: Optional[Callable] = None, *, name: Optional[str] = None) -
add_tts_span_attributes(
span=span,
service_name=service_class_name,
model=getattr(self, "model_name", "unknown"),
model=getattr(self, "model_name") or "unknown",
voice_id=getattr(self, "_voice_id", "unknown"),
text=text,
settings=getattr(self, "_settings", {}),
@@ -585,8 +585,10 @@ def traced_gemini_live(operation: str) -> Callable:
) as current_span:
try:
# Base service attributes
model_name = getattr(
self, "model_name", getattr(self, "_model_name", "unknown")
model_name = (
getattr(self, "model_name", None)
or getattr(self, "_model_name", None)
or "unknown"
)
voice_id = getattr(self, "_voice_id", None)
language_code = getattr(self, "_language_code", None)
@@ -890,8 +892,10 @@ def traced_openai_realtime(operation: str) -> Callable:
) as current_span:
try:
# Base service attributes
model_name = getattr(
self, "model_name", getattr(self, "_model_name", "unknown")
model_name = (
getattr(self, "model_name", None)
or getattr(self, "_model_name", None)
or "unknown"
)
# Operation-specific attribute collection