Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _carbonsteel.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "1.1",
"generated_at": "2026-05-09T12:18:20Z",
"spec_sha": "4c822a78c44f68ac:53f7f73325c83be4",
"generated_at": "2026-05-09T14:25:01Z",
"spec_sha": "4c822a78c44f68ac:cc7f4554e955f4fe",
"files": [
"api.md",
"src/lmnt/__init__.py",
Expand Down
6 changes: 3 additions & 3 deletions src/lmnt/resources/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,17 @@ async def connect(self) -> None:
await self.websocket.send(json.dumps(init_msg))

async def send_text(self, text: str) -> None:
"""The text you send can be split at any point."""
"""Send text to the server to append into the text stream."""
await self._send_message({"type": "text", "text": text})

async def send_flush(self) -> int:
"""Each `flush` carries a client-chosen `nonce`. The server replies with a `flush_complete` carrying the matching nonce once it has finished streaming the flushed audio."""
"""Force the server to generate speech for all buffered text in the stream."""
self.nonce += 1
await self._send_message({"type": "flush", "nonce": self.nonce})
return self.nonce

async def send_reset(self) -> int:
"""Each `reset` carries a client-chosen `nonce`. The server replies with a `reset_complete` carrying the matching nonce once the buffer has been cleared."""
"""Drop the server's buffered text without generating speech for it."""
self.nonce += 1
await self._send_message({"type": "reset", "nonce": self.nonce})
return self.nonce
Expand Down
5 changes: 4 additions & 1 deletion src/lmnt/types/speech_session_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ class SpeechSessionError(BaseModel):
error: ErrorBody

request_id: str # pyright: ignore[reportIncompatibleVariableOverride, reportGeneralTypeIssues]
"""Per-session request ID for log correlation."""
"""Per-session request ID.

If you're reporting an issue, include this if possible to make debugging easier.
"""

type: Literal["error"] = "error"
"""Discriminator identifying this message type."""
6 changes: 3 additions & 3 deletions src/lmnt/types/speech_session_ready.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

class SpeechSessionReady(BaseModel):
request_id: str # pyright: ignore[reportIncompatibleVariableOverride, reportGeneralTypeIssues]
"""
Per-session request ID — same value as the `request-id` HTTP header on the WS
upgrade response. Use it to correlate session activity with server-side logs.
"""Per-session request ID.

If you're reporting an issue, include this if possible to make debugging easier.
"""

type: Literal["ready"] = "ready"
Expand Down
Loading