Skip to content

Add talk message stream#41

Merged
sebvanleuven merged 5 commits intomainfrom
fix/talk_message_stream
Feb 26, 2026
Merged

Add talk message stream#41
sebvanleuven merged 5 commits intomainfrom
fix/talk_message_stream

Conversation

@sebvanleuven
Copy link
Contributor

@sebvanleuven sebvanleuven commented Feb 26, 2026

send_talk_stream was preliminary implemented very basic and required the dev to manage the correlation_id, while it did not provide any hooks for the interrupt.
The new approach now clears talk_stream buffers (by deleting the object) and manages the correlation_id, while still allowing devs to use their own correlation_id for debugging purposes.


Summary by cubic

Adds a TalkMessageStream for TTS that manages a stable correlation_id per stream, tracks stream state, and wires interruption events to make streaming simpler and more reliable. Updates the client API, signaling, and docs to use create_talk_stream, with send_talk_stream for one-off messages.

  • New Features

    • Added TalkMessageStream with send(content, end_of_speech) and end(); correlation_id set at stream creation (optional override). Exports TalkMessageStream and TalkMessageStreamState.
    • New session.create_talk_stream(...) for grouped chunks; session.send_talk_stream(content) for single messages.
    • StreamingClient adds on_talk_stream_interrupted callback; client emits AnamEvent.TALK_STREAM_INTERRUPTED.
    • Signalling send_talk_stream_input now requires correlation_id (managed by the stream).
    • README/examples updated; version bumped to 0.3.0.
    • Unit tests added for TalkMessageStream (state transitions, interruptions, end behavior).
  • Migration

    • Replace session.send_talk_stream(content, start_of_speech, end_of_speech, correlation_id) with session.create_talk_stream().send(...).
    • For single messages, use session.send_talk_stream(content).
    • If using low-level signaling, pass correlation_id explicitly.

Written for commit 9b845c6. Summary will update on new commits.

@sebvanleuven sebvanleuven requested review from ao-anam, bnogas and robbie-anam and removed request for ao-anam February 26, 2026 15:08
@sebvanleuven sebvanleuven marked this pull request as ready for review February 26, 2026 15:09
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 9 files

@sebvanleuven sebvanleuven merged commit 82c6bdb into main Feb 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants