You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
output_stream = context.send(
model_id=self.model_id,
transcript=self.read_from_queue_generator(self.current_turn.metrics_context),
voice_id=self.voice_id,
output_format=self.output_format,
add_timestamps=True,
)
for chunk in output_stream:
The following error is thrown:
Traceback (most recent call last):
File "<omitted>/lib/python3.11/site-packages/cartesia/_websocket.py", line 141, in send
if response["data"]:
~~~~~~~~^^^^^^^^
KeyError: 'data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/<omitted>", in run
for chunk in output_stream:
File "<omitted>/lib/python3.11/site-packages/cartesia/_websocket.py", line 169, in send
raise RuntimeError(f"Failed to generate audio. {e}")
The code does not seem to be handling the case where "data" is not present. The culprit(s) are these lines of code in _websocket: if response["data"]
You can demonstrate the issue by running a simple example:
response = {}
if response["data"]:
print("Everything ok")
The "data" field is not meant to be present in word_timestamps responses.
The text was updated successfully, but these errors were encountered:
When invoking the streaming api via:
The following error is thrown:
The code does not seem to be handling the case where "data" is not present. The culprit(s) are these lines of code in _websocket:
if response["data"]
You can demonstrate the issue by running a simple example:
The "data" field is not meant to be present in word_timestamps responses.
The text was updated successfully, but these errors were encountered: