Skip to content

Added support for RTVI protocol 2.0.0 - #20

Merged
filipi87 merged 3 commits into
mainfrom
filipi/rtvi_2.0.0
Jun 25, 2026
Merged

Added support for RTVI protocol 2.0.0#20
filipi87 merged 3 commits into
mainfrom
filipi/rtvi_2.0.0

Conversation

@filipi87

Copy link
Copy Markdown
Contributor

BotOutputData.kt

  • spoken: Boolean → Boolean? = null (deprecated, now optional to match Protocol 2.0.0 where server sends null)
  • New BotOutputProgressData data class with accumulatedText / remainingText
  • New BotOutputData.SpokenStatus enum: New, InProgress ("in-progress"), Completed
  • Added willBeSpoken, spokenStatus, spokenProgress, segmentId: Int? — all optional, all defaulting to null

PipecatClient.kt

  • RTVI_PROTOCOL_VERSION bumped "1.0.0" → "2.0.0" and made public (was internal)
  • BotReady handler now logs a warning when the server's major version is behind the client's

@filipi87
filipi87 requested a review from marcus-daily June 19, 2026 21:37
@filipi87

Copy link
Copy Markdown
Contributor Author

@marcus-daily, I am leaving this as a draft since I still need to test it. For now, I've only applied the same changes I made on iOS.

@filipi87

Copy link
Copy Markdown
Contributor Author

@marcus-daily, it looks like it is working as expected:

2026-06-22 10:39:53.656 26011-26071 WebRTCClient            ai.pipecat.simple_chatbot_client     I  Got event from bot: {"label": "rtvi-ai", "type": "bot-tts-text", "data": {"text": "How"}}
2026-06-22 10:39:53.658 26011-26071 WebRTCClient            ai.pipecat.simple_chatbot_client     I  Got event from bot: {"label": "rtvi-ai", "type": "bot-output", "data": {"text": "How can I help you today?", "aggregated_by": "sentence", "segment_id": 237, "will_be_spoken": true, "spoken_status": "in-progress", "spoken_progress": {"accumulated_text": "How", "remaining_text": " can I help you today?"}}}
2026-06-22 10:39:53.661 26011-26011 VoiceClientManager      ai.pipecat.simple_chatbot_client     I  onBotOutput: text="How can I help you today?" aggregatedBy=sentence willBeSpoken=true spokenStatus=InProgress segmentId=237 progress=BotOutputProgressData(accumulatedText=How, remainingText= can I help you today?)
2026-06-22 10:39:53.917 26011-26071 WebRTCClient            ai.pipecat.simple_chatbot_client     I  Got event from bot: {"label": "rtvi-ai", "type": "bot-tts-text", "data": {"text": "can"}}
2026-06-22 10:39:53.920 26011-26071 WebRTCClient            ai.pipecat.simple_chatbot_client     I  Got event from bot: {"label": "rtvi-ai", "type": "bot-output", "data": {"text": "How can I help you today?", "aggregated_by": "sentence", "segment_id": 237, "will_be_spoken": true, "spoken_status": "in-progress", "spoken_progress": {"accumulated_text": "How can", "remaining_text": " I help you today?"}}}
2026-06-22 10:39:53.926 26011-26011 VoiceClientManager      ai.pipecat.simple_chatbot_client     I  onBotOutput: text="How can I help you today?" aggregatedBy=sentence willBeSpoken=true spokenStatus=InProgress segmentId=237 progress=BotOutputProgressData(accumulatedText=How can, remainingText= I help you today?)
2026-06-22 10:39:54.076 26011-26071 WebRTCClient            ai.pipecat.simple_chatbot_client     I  Got event from bot: {"label": "rtvi-ai", "type": "bot-tts-text", "data": {"text": "I"}}
2026-06-22 10:39:54.078 26011-26071 WebRTCClient            ai.pipecat.simple_chatbot_client     I  Got event from bot: {"label": "rtvi-ai", "type": "bot-output", "data": {"text": "How can I help you today?", "aggregated_by": "sentence", "segment_id": 237, "will_be_spoken": true, "spoken_status": "in-progress", "spoken_progress": {"accumulated_text": "How can I", "remaining_text": " help you today?"}}}
2026-06-22 10:39:54.081 26011-26011 VoiceClientManager      ai.pipecat.simple_chatbot_client     I  onBotOutput: text="How can I help you today?" aggregatedBy=sentence willBeSpoken=true spokenStatus=InProgress segmentId=237 progress=BotOutputProgressData(accumulatedText=How can I, remainingText= help you today?)
2026-06-22 10:39:54.151 26011-26071 WebRTCClient            ai.pipecat.simple_chatbot_client     I  Got event from bot: {"label": "rtvi-ai", "type": "bot-tts-text", "data": {"text": "help"}}
2026-06-22 10:39:54.152 26011-26071 WebRTCClient            ai.pipecat.simple_chatbot_client     I  Got event from bot: {"label": "rtvi-ai", "type": "bot-output", "data": {"text": "How can I help you today?", "aggregated_by": "sentence", "segment_id": 237, "will_be_spoken": true, "spoken_status": "in-progress", "spoken_progress": {"accumulated_text": "How can I help", "remaining_text": " you today?"}}}
2026-06-22 10:39:54.153 26011-26011 VoiceClientManager      ai.pipecat.simple_chatbot_client     I  onBotOutput: text="How can I help you today?" aggregatedBy=sentence willBeSpoken=true spokenStatus=InProgress segmentId=237 progress=BotOutputProgressData(accumulatedText=How can I help, remainingText= you today?)
2026-06-22 10:39:54.315 26011-26071 WebRTCClient            ai.pipecat.simple_chatbot_client     I  Got event from bot: {"label": "rtvi-ai", "type": "bot-tts-text", "data": {"text": "you"}}
2026-06-22 10:39:54.318 26011-26071 WebRTCClient            ai.pipecat.simple_chatbot_client     I  Got event from bot: {"label": "rtvi-ai", "type": "bot-output", "data": {"text": "How can I help you today?", "aggregated_by": "sentence", "segment_id": 237, "will_be_spoken": true, "spoken_status": "in-progress", "spoken_progress": {"accumulated_text": "How can I help you", "remaining_text": " today?"}}}
2026-06-22 10:39:54.320 26011-26011 VoiceClientManager      ai.pipecat.simple_chatbot_client     I  onBotOutput: text="How can I help you today?" aggregatedBy=sentence willBeSpoken=true spokenStatus=InProgress segmentId=237 progress=BotOutputProgressData(accumulatedText=How can I help you, remainingText= today?)
2026-06-22 10:39:54.476 26011-26071 WebRTCClient            ai.pipecat.simple_chatbot_client     I  Got event from bot: {"label": "rtvi-ai", "type": "bot-tts-text", "data": {"text": "today?"}}
2026-06-22 10:39:54.478 26011-26071 WebRTCClient            ai.pipecat.simple_chatbot_client     I  Got event from bot: {"label": "rtvi-ai", "type": "bot-output", "data": {"text": "How can I help you today?", "aggregated_by": "sentence", "segment_id": 237, "will_be_spoken": true, "spoken_status": "completed", "spoken_progress": {"accumulated_text": "How can I help you today?", "remaining_text": ""}}}
2026-06-22 10:39:54.481 26011-26011 VoiceClientManager      ai.pipecat.simple_chatbot_client     I  onBotOutput: text="How can I help you today?" aggregatedBy=sentence willBeSpoken=true spokenStatus=Completed segmentId=237 progress=BotOutputProgressData(accumulatedText=How can I help you today?, remainingText=)
2026-06-22 10:39:54.840 26011-26071 WebRTCClient            ai.pipecat.simple_chatbot_client     I  Got event from bot: {"label": "rtvi-ai", "type": "bot-stopped-speaking"}

@filipi87
filipi87 marked this pull request as ready for review June 22, 2026 13:43
@filipi87
filipi87 requested a review from mattieruth June 22, 2026 13:43
Comment thread CHANGELOG.md Outdated
# Unreleased

- Added support for RTVI protocol 2.0.0. `BotOutputData` now includes new fields: `willBeSpoken`, `spokenStatus`, `spokenProgress`, and `segmentId`, enabling word-level TTS progress tracking. The `spoken` field is deprecated in favour of `willBeSpoken`.
- Added `RTVI_PROTOCOL_VERSION` constant (`"2.0.0"`).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This constant already existed, also it's not public so should probably be left out of the changelog

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, fixed!

@marcus-daily marcus-daily left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Left a minor comment about the changelog.

@filipi87
filipi87 merged commit 49139ba into main Jun 25, 2026
1 check 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