From 16b060d9e956f391bdbefd5261377fba77baee98 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Wed, 11 Feb 2026 18:04:20 -0500 Subject: [PATCH 1/2] Fix Grok Realtime voice type validation for server responses The Grok API now returns prefixed voice names (e.g. "human_Ara") in session.updated events, causing Pydantic validation errors. Widen the voice field type from GrokVoice to GrokVoice | str to accept both user-facing names and server-returned values. --- src/pipecat/services/grok/realtime/events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pipecat/services/grok/realtime/events.py b/src/pipecat/services/grok/realtime/events.py index 4069ff927..1f89a92f7 100644 --- a/src/pipecat/services/grok/realtime/events.py +++ b/src/pipecat/services/grok/realtime/events.py @@ -216,7 +216,7 @@ class SessionProperties(BaseModel): model_config = ConfigDict(arbitrary_types_allowed=True) instructions: Optional[str] = None - voice: Optional[GrokVoice] = "Ara" + voice: Optional[GrokVoice | str] = "Ara" turn_detection: Optional[TurnDetection] = Field( default_factory=lambda: TurnDetection(type="server_vad") ) From a9669472202c789232d3170ca37f723ec9b5acd3 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Wed, 11 Feb 2026 18:04:58 -0500 Subject: [PATCH 2/2] Add changelog for #3720 --- changelog/3720.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/3720.fixed.md diff --git a/changelog/3720.fixed.md b/changelog/3720.fixed.md new file mode 100644 index 000000000..c3cb69d34 --- /dev/null +++ b/changelog/3720.fixed.md @@ -0,0 +1 @@ +- Fixed Grok Realtime `session.updated` event parsing failure caused by the API returning prefixed voice names (e.g. `"human_Ara"` instead of `"Ara"`).