Refactor TextInputMessage class to replace realtimeInput with a text attribute.

This was sending a 1007 because it was wrapping RealtimeInput in the json.

- Updated the `TextInputMessage` class to directly store text input as a string.
- Modified the `from_text` class method to create an instance using the new `text` attribute.
This commit is contained in:
Pete
2025-08-02 14:34:00 -04:00
parent 2af3b6329d
commit cccd82a617

View File

@@ -195,7 +195,7 @@ class VideoInputMessage(BaseModel):
class TextInputMessage(BaseModel):
"""Message containing text input data."""
realtimeInput: RealtimeInput
text: str
@classmethod
def from_text(cls, text: str) -> "TextInputMessage":
@@ -207,7 +207,7 @@ class TextInputMessage(BaseModel):
Returns:
A TextInputMessage instance.
"""
return cls(realtimeInput=RealtimeInput(text=text))
return cls(text=text)
class ClientContentMessage(BaseModel):