feat(assemblyai): surface end-of-turn confidence metadata - #2418
Open
rosetta-livekit-bot[bot] wants to merge 1 commit into
Open
feat(assemblyai): surface end-of-turn confidence metadata#2418rosetta-livekit-bot[bot] wants to merge 1 commit into
rosetta-livekit-bot[bot] wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 286683f The changes in this PR will be included in the next version bump. This PR includes changesets to release 38 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Summary
SpeechData.metadatafor interim, preflight, and final transcripts.0as a meaningful confidence value while leaving metadata unset when the server omits the field.@livekit/agents-plugin-assemblyai.Port of livekit/agents#7107.
Source diff coverage
livekit-plugins/livekit-plugins-assemblyai/livekit/plugins/assemblyai/stt.py→plugins/assemblyai/src/stt.ts. Extended the existing target metadata mapper soend_of_turn_confidenceis exposed asmetadata.assemblyai.endOfTurnConfidence, following target provider namespacing and camelCase conventions. Existing event construction already applies this mapper to interim, preflight, and final transcripts.tests/test_plugin_assemblyai_stt.py→plugins/assemblyai/src/stt-metadata.test.ts. Ported all four source cases through the target local WebSocket harness: interim confidence, final confidence, zero confidence, and absent confidence.Testing
pnpm exec vitest run plugins/assemblyai(10 passed, 1 credential-gated test skipped)pnpm exec turbo run build --filter=@livekit/agents-plugin-assemblyaipnpm --filter @livekit/agents-plugin-assemblyai lintpnpm exec prettier --check plugins/assemblyai/src/stt.ts plugins/assemblyai/src/stt-metadata.test.ts .changeset/surface-assemblyai-turn-confidence.mdgit diff --checkPorted from livekit/agents#7107
Original PR description
Summary
Surfaces the AssemblyAI streaming
end_of_turn_confidenceonSpeechData.metadataso callers can read it off theSpeechEvent(e.g. in anstt_nodeoverride) and threshold it for preemptive / eager LLM generation. The plugin already parsed the field from eachTurnmessage but only logged it, so it never reachedSpeechData. It's now attached to the interim, preflight, and final events, guarded onis not None(an early-partial0.0still surfaces; models that don't emit the field are unaffected).Value semantics are model-defined:
universal-3-5-pro/universal-3-6-pro/u3-rt-pro— rises from0toward1across the partials held betweenmin_turn_silenceandmax_turn_silence, and is1.0on the final.universal-streaming-english/universal-streaming-multilingual— a per-partial end-of-turn probability on every partial, with the model's own score on the final.Testing
tests/test_plugin_assemblyai_stt.py: 4 new tests (interim, final, the0.0-still-surfaces case, and the absent-field case). Full file: 115 passed; ruff and strict mypy clean.universal-3-5-proanduniversal-3-6-prosurface the held-turn ramp (0.0 → 0.4 → 0.75 → 1.0), anduniversal-streaming-english/universal-streaming-multilingualsurface their per-partial EOT probability — all readable offSpeechData.metadata.