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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user