-
Notifications
You must be signed in to change notification settings - Fork 312
feat(assemblyai): add streaming inactivity timeout option #1888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@livekit/agents-plugin-assemblyai': patch | ||
| --- | ||
|
|
||
| Add AssemblyAI streaming `inactivityTimeout` support. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,6 +65,11 @@ export interface STTOptions { | |
| encoding: STTEncoding; | ||
| speechModel: STTModels; | ||
| languageDetection?: boolean; | ||
| /** | ||
| * Session inactivity timeout in seconds. AssemblyAI accepts integer values | ||
| * from 5 to 3600; when unset, no inactivity timeout is applied. | ||
| */ | ||
| inactivityTimeout?: number; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚩 ElevenLabs uses same naming pattern, suggesting an established (if incorrect) precedent The ElevenLabs plugin ( Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| endOfTurnConfidenceThreshold?: number; | ||
| /** Minimum silence (ms) before a confident end-of-turn is finalized. */ | ||
| minTurnSilence?: number; | ||
|
|
@@ -322,6 +327,7 @@ export class SpeechStream extends stt.SpeechStream { | |
| ? JSON.stringify(this.#opts.keytermsPrompt) | ||
| : undefined, | ||
| language_detection: languageDetection, | ||
| inactivity_timeout: this.#opts.inactivityTimeout, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Useful? React with 👍 / 👎. |
||
| prompt: this.#opts.prompt, | ||
| agent_context: this.#opts.agentContext, | ||
| previous_context_n_turns: this.#opts.previousContextNTurns, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Inactivity timeout uses seconds but the plain-form name implies milliseconds per repo convention
The timeout field is named without the
InSsuffix (inactivityTimeoutatplugins/assemblyai/src/stt.ts:72) yet documented as accepting seconds, so users familiar with the codebase convention will misinterpret the expected unit.Impact: Users may pass a value like
45000(thinking milliseconds) when the API actually expects45(seconds), causing the session to never time out or to receive an API validation error.Repository time-unit convention and within-file inconsistency
CLAUDE.md line 155 states: "Time units: Use milliseconds for all time-based values by default. Only use seconds when the name explicitly ends with
InS."Line 182 reiterates: "Only use seconds as the unit if the variable name explicitly ends with
InS(e.g.delayInS)"Within the same
STTOptionsinterface, other time fields follow the convention correctly:bufferSizeMsatplugins/assemblyai/src/stt.ts:64— explicitMssuffixminTurnSilenceatplugins/assemblyai/src/stt.ts:75— plain name, documented as "(ms)"maxTurnSilenceatplugins/assemblyai/src/stt.ts:77— plain name, documented as "(ms)"#speechDurationInSatplugins/assemblyai/src/stt.ts:209— explicitInSsuffix for secondsThe new
inactivityTimeoutat line 72 uses a plain name (implying ms) but the JSDoc at lines 69–71 says "in seconds" and the value is passed directly to the API at line 330 without conversion. To comply with the convention, the field should either be renamed toinactivityTimeoutInSor accept milliseconds and convert before sending.Prompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.