feat(agents): allow updating recording options mid-session via update_options#6208
Draft
chenghao-mou wants to merge 2 commits into
Draft
Conversation
Add AgentSession.update_recording_options() and a read-only recording_options property so recording, traces, logs, and transcript collection can be toggled during an active session (e.g. after consent is obtained), replacing the private session._recording_options.update(). Generated with [Linear](https://linear.app/livekit/issue/AGT-3041/make-agentsession-recording-options-publicly-updatable#agent-session-5420ba6f) Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
Use the canonical AgentSession.update_options(record=...) keyword instead of a dedicated update_recording_options() method. Generated with [Linear](https://linear.app/livekit/issue/AGT-3041/make-agentsession-recording-options-publicly-updatable#agent-session-5420ba6f) Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a public way to change Agent Insights recording options during an active session, replacing the private
session._recording_options.update(...).AgentSession.update_options(record=...)— follows the canonical sessionupdate_optionspattern. AcceptsTrue/Falseto toggle every feature, or a partialRecordingOptionsmapping that updates only the given keys (audio, traces, logs, transcript) and leaves the rest unchanged.AgentSession.recording_options— read-only property returning a copy of the current options.This makes it easy to toggle recording, traces, logs, or transcript collection mid-session, e.g. after recording consent is obtained.
Note: session audio is only captured when audio recording was enabled at
start(), so enablingaudioafterwards does not retroactively start the recorder; disabling always takes effect.