Skip to content

Commit

Permalink
Fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
eyw520 committed Jan 24, 2025
1 parent ff872d1 commit 7ec0159
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/cartesia/tts/socket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,11 @@ def send(
return {"status": "cancelled", "context_id": request.context_id}

if isinstance(request, GenerationRequest):
if not request.context_id:
request.context_id = str(uuid.uuid4())

request_body = request.dict(by_alias=True)

if not request_body.get("context_id"):
request_body["context_id"] = str(uuid.uuid4())

generator = self._websocket_generator(request_body)

if stream:
Expand Down Expand Up @@ -678,11 +678,11 @@ async def send(
return {"status": "cancelled", "context_id": request.context_id}

if isinstance(request, GenerationRequest):
if not request.context_id:
request.context_id = str(uuid.uuid4())

request_body = request.dict(by_alias=True)

if not request_body.get("context_id"):
request_body["context_id"] = str(uuid.uuid4())

generator = self._async_websocket_generator(request_body)

if stream:
Expand Down

0 comments on commit 7ec0159

Please sign in to comment.