Skip to content

Conversation

@sebvanleuven
Copy link
Contributor

@sebvanleuven sebvanleuven commented Jan 28, 2026

Fixing message type for Message_Stream_Event. Fixing message processing, fixing message history

Expand interactive example using MESSAGE_STREAM_EVENTS for live caption and printing the whole message history at the end of a session.


Summary by cubic

Adds real-time message streaming support using speechText events and builds automatic conversation history. Fixes message parsing and improves the interactive example with live captions and transcript printing.

  • New Features

    • Emit MESSAGE_STREAM_EVENT_RECEIVED with MessageStreamEvent chunks (role, content_index, end_of_speech, interrupted).
    • Track conversation history and emit MESSAGE_HISTORY_UPDATED on completion; added client.get_message_history().
    • MESSAGE_RECEIVED now fires after end_of_speech for backward compatibility.
    • Message now includes id and interrupted; new types exported (MessageStreamEvent).
    • README updated with stream events and talk/talkstream usage; example adds caption toggle (c) and history toggle (h) with full transcript on close.
  • Bug Fixes

    • Corrected messageType to speechText and proper role mapping (user/persona).
    • Fixed data channel open-state handling to prevent missed messages.
    • Resolved session close ordering and live caption print order.
    • Minor logging adjustments for clearer output.

Written for commit 8229024. Summary will update on new commits.

Copy link
Contributor

@ao-anam ao-anam left a comment

Choose a reason for hiding this comment

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

LGTM.

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.

2 issues found across 7 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="README.md">

<violation number="1" location="README.md:135">
P2: The example now references `Message` but the import was removed. This makes the snippet invalid when copied. Add `Message` to the import list.</violation>
</file>

<file name="examples/persona_interactive_video.py">

<violation number="1" location="examples/persona_interactive_video.py:41">
P3: The comment says the log level was reduced to WARNING, but the code now sets INFO. This mismatch makes the logging intent unclear for maintainers.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

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.

2 issues found across 7 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="src/anam/_streaming.py">

<violation number="1" location="src/anam/_streaming.py:345">
P2: Reset _data_channel_open to False when creating a new data channel; otherwise stale True values from a previous session can cause sends while the new channel is still connecting.</violation>
</file>

<file name="examples/persona_interactive_video.py">

<violation number="1" location="examples/persona_interactive_video.py:41">
P3: The comment on the logging level no longer matches the code (INFO vs “reduced to WARNING”), which is misleading for maintenance.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@sebvanleuven sebvanleuven merged commit c374879 into main Jan 28, 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.

3 participants