Merge pull request #3720 from pipecat-ai/mb/fix-grok-realtime

Fix Grok Realtime voice type validation for server responses
This commit is contained in:
Mark Backman
2026-02-13 13:24:53 -05:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

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

@@ -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"`).

View File

@@ -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")
)