Skip to content

Commit

Permalink
fix: typing.
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-bot committed Nov 14, 2024
1 parent 3e6d096 commit 02664e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cartesia/tts/socket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def close(self):
def _convert_response(
self, response_obj: typing.Union[WebSocketResponse_Chunk, WebSocketResponse_Timestamp], include_context_id: bool
) -> WebSocketTtsOutput:
out: dict[str, typing.Any] = {}
out: typing.Dict[str, typing.Any] = {}
if isinstance(response_obj, WebSocketResponse_Chunk):
out["audio"] = base64.b64decode(response_obj.data)
elif isinstance(response_obj, WebSocketResponse_Timestamp):
Expand Down Expand Up @@ -302,7 +302,7 @@ def send(
Note: This is an experimental feature and may change rapidly in future releases.
Returns:
If `stream` is True, the method returns a generator that yields chunks. Each chunk is a dictionary.
If `stream` is True, the method returns a generator that yields chunks. Each chunk is a ionary.
If `stream` is False, the method returns a dictionary.
Both the generator and the dictionary contain the following key(s):
- audio: The audio as bytes.
Expand Down Expand Up @@ -337,7 +337,7 @@ def send(
if add_timestamps and "word_timestamps" in chunk:
for k, v in chunk["word_timestamps"].items():
word_timestamps[k].extend(v)
out: dict[str, typing.Any] = {"audio": b"".join(chunks), "context_id": context_id}
out: typing.Dict[str, typing.Any] = {"audio": b"".join(chunks), "context_id": context_id}
if add_timestamps:
out["word_timestamps"] = word_timestamps
return WebSocketTtsOutput(**out)
Expand Down

0 comments on commit 02664e4

Please sign in to comment.