Repository navigation
Conversation
Disable AgentSession's AEC warmup in the direct and fallback Rime examples so Prism receives caller audio from the start of agent speech. Document how applications can retain an explicit warmup. Cover caller audio forwarding and opening-greeting interruption through both model paths, including the silence produced by an explicit warmup. Co-authored by Codex 6 and augustohalvarez
Retain the upstream Rime test cleanup and SDK limit fixture alongside the Prism settings and opening-greeting interruption regressions. Co-authored by Codex 6 and augustohalvarez
Remove the adapter's 4,000-character cap and its obsolete validation bypass. Retain role, content, and UTF-8 validation and preserve confirmed history when the server refuses an update. Cover long messages at startup, on update, across restarts, and through direct and fallback agent replies. Document the server's context limit. Co-authored by Codex 6 and augustohalvarez
tinalenguyen
left a comment
There was a problem hiding this comment.
hi, thanks for the PR! few notes:
- left a comment about checking
speedup front - could we update the remaining
a29mentions in the readme? the long-tasks section still says the realtime extra requires alpha29 - left a question about recommending
aec_warmup_duration=None
| if is_given(speed): | ||
| self._speed = speed | ||
| if is_given(turn_detection): | ||
| self._merge_turn_update(turn_detection) |
There was a problem hiding this comment.
could we validate speed (0.85 to 1.3) here and in the constructor? otherwise a bad value only fails at connect, which isn't retryable and ends the session
There was a problem hiding this comment.
Done in a9e0c07. Speed is now checked in the constructor and in update_options.
| self.emit("input_speech_stopped", stopped) | ||
| elif isinstance(payload, r.TranscriptDelta): | ||
| text = self._transcript_deltas.get(payload.item_id, "") + payload.delta | ||
| cumulative = getattr(payload, "transcript", None) |
There was a problem hiding this comment.
i don't think we need getattr here
| cumulative = getattr(payload, "transcript", None) | |
| cumulative = payload.transcript |
| It requests interruption on caller speech. Early speech hints do not change | ||
| playback volume. There is no custom per-response interruption policy. | ||
|
|
||
| Set `aec_warmup_duration=None` on `AgentSession` so Prism receives caller audio |
There was a problem hiding this comment.
should we keep the default warmup in the snippets? turning it off lets the greeting's echo reach prism on speakerphone or sip, maybe we could just mention the tradeoff here
There was a problem hiding this comment.
Done in a9e0c07. The snippets keep the default warmup, and the README explains the tradeoff.
- Validate realtime speed (0.85 to 1.3) in the constructor and both update_options paths, so a bad value fails immediately instead of at connect. - Read TranscriptDelta.transcript directly; the SDK minimum provides it. - Require rimelabs-sdk>=0.1.0a30 for the stt extra too, and update the README SDK and LiveKit minimums to match the declared dependencies. - Keep LiveKit's default AEC warmup in the README snippets and document the early-interruption versus echo tradeoff. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, all addressed in a9e0c07. I also raised the |
Resolve the rime pyproject.toml conflict by keeping main's livekit-agents>=1.8.12 floor alongside this branch's rimelabs-sdk>=0.1.0a30 requirement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Prism sends reply audio about 8.5x faster than real time, so a long reply read at playback pace exceeded the 256-chunk reply channel limit and closed the session. Reply text and audio channels now have no limit, like other realtime plugins. Truncated and interrupted replies drop their unread output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Also fixes a long-reply bug Tina raised on livekit/agents-js#2866: Prism sends reply audio about 8.5× faster than real time, so the 256-chunk reply channel limit closed the session during playback. Reply channels now have no limit, like other realtime plugins, and truncated or interrupted replies drop their unread output (7b6606b). |
Keep main's livekit-agents>=1.9.1 floor alongside the rimelabs-sdk>=0.1.0a30 requirement. Stop the Rime README from naming a LiveKit minimum that goes stale with each release; point to the declared requirement instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reply channels are unbounded since long replies arrive faster than playback, and the model keeps a reference to its closed session. Shutdown closed the channels of completed replies without draining them, so their unread audio and text stayed in memory. Shutdown now discards every reply's queued output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tinalenguyen
left a comment
There was a problem hiding this comment.
thanks for the updates! few more notes:
- left a comment about unread reply audio now that the channels are unbounded
- left a small one about
update_optionsapplying some settings before it raises - could we clean up the install/compat section in the readme? left a comment there
| text: utils.aio.Chan[str] = field(default_factory=utils.aio.Chan) | ||
| audio: utils.aio.Chan[rtc.AudioFrame] = field(default_factory=utils.aio.Chan) |
There was a problem hiding this comment.
with these unbounded, a long reply that finished generating but never plays (interrupted before playback, or a session with no audio output) keeps its audio until 128 newer replies evict it, since interrupt() only handles the active one. maybe we could discard unread output of earlier ended generations when a new response starts?
There was a problem hiding this comment.
Fixed in 15935f9. I didn't discard on new responses, since Prism sends audio about 8.5× faster than real time, so a finished reply can still be playing. Instead, the session drops its references when a reply ends, like the OpenAI plugin, and a reply LiveKit skips is freed with it. Against live Prism, unplayed audio went to 0 s and playing replies stayed intact.
| if is_given(speed): | ||
| _validate_speed(speed) |
There was a problem hiding this comment.
could we check the turn_detection type here too, next to _validate_speed? with no session, a full TurnDetection raises only after voice/speed/etc. are already stored
There was a problem hiding this comment.
Done in c2354d9. Both update_options methods now check the type next to _validate_speed, so a rejected call stores and queues nothing. This also stops a live session from sending a full TurnDetection to Prism before raising.
| ```sh | ||
| uv pip install --no-sources 'livekit-agents==1.7.1' \ | ||
| uv pip install --no-sources 'livekit-agents==<version>' \ | ||
| 'livekit-plugins-rime[realtime] @ git+https://github.com/naszzz/agents.git@<commit>#subdirectory=livekit-plugins/livekit-plugins-rime' |
There was a problem hiding this comment.
could we drop the install-from-fork snippet and the 1.7.1/1.8.x + a28 checks above (line 283)? the package now needs livekit-agents>=1.9.1 and rimelabs-sdk>=0.1.0a30, so those claims would ship stale
There was a problem hiding this comment.
Done in 07a316d. I removed the fork snippet, the 1.7.1/1.8.x and a28 checks, and the notes about versions below 1.9.1.
…ttings update_options checked the turn_detection type only while merging it. With no session, voice, speed, and other settings were already stored when a full TurnDetection raised. With a live session, the bad value was queued and failed later as an error event. Both update_options methods now check the type next to the speed check, so a rejected call changes and queues nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… README The package now requires livekit-agents>=1.9.1 and rimelabs-sdk>=0.1.0a30. Remove the install-from-fork snippet, the 1.7.1 and 1.8.x checks with a28, and the notes about versions below the floor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The session keeps up to 128 finished replies, and each one held its message channels, message stream, and created event. A reply that finished generating but never played, such as one interrupted before playback or in a session with no audio output, kept its unread audio until newer replies evicted it. The session now drops those references when a reply ends, as the OpenAI, Google, and AWS realtime sessions do. LiveKit's own reference keeps a reply it is still playing, so nothing is cut off, and a reply it skips is freed with it. A requested reply's event is held only until generate_reply returns it. Released channels stay weakly referenced, so truncation and shutdown still drop unread output right away, including after the reply ended. A requested reply whose request was cancelled before Prism acknowledged it is still held until eviction; the README notes this. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Add Prism speech speed, interruption settings, and speech review callbacks to the Rime realtime model. Apply stored settings only after server confirmation, and use cumulative transcripts to correct partial captions.
speedandreviewtoRealtimeModel, plus mutable speed and interruption settings throughupdate_options. Reject out-of-range speeds (0.85–1.3) immediately instead of failing the session at connect.Behavior changes
update_chat_ctx()and typed input no longer reject messages over 4,000 characters; Prism enforces its own context limit.Related SDK PR: rimelabs/rime-sdk#131
Validation
make checkpassed, including type checking of 813 source files. All 423 tests intests/test_plugin_rime.pypassed with the published SDK after merging currentmain.rimelabs-sdk>=0.1.0a30. The previous locked SDK lacked the new Prism types and behavior.20261111accepts the new settings. Full validation in a real LiveKit room remains pending.Before release
Complete full end-to-end validation before release. This PR does not change package versions or the LiveKit Agents minimum.
SERVE-273 remains excluded.