Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/elevenlabs/src/stt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ describe('ElevenLabs STT', () => {
});

expect(request?.method).toBe('POST');
expect(request?.url).toBe('/speech-to-text');
expect(request?.url).toBe('/speech-to-text?enable_logging=true');
expect(request?.apiKey).toBe('test-key');
expect(request?.body).toContain('name="model_id"');
expect(request?.body).toContain('scribe_v2');
Expand Down
19 changes: 13 additions & 6 deletions plugins/elevenlabs/src/stt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export interface STTOptions {
modelId?: ElevenLabsSTTModels | string;
keyterms?: string[];
noVerbatim?: boolean;
enableLogging?: boolean;
}

interface ResolvedSTTOptions {
Expand All @@ -73,6 +74,7 @@ interface ResolvedSTTOptions {
serverVad?: VADOptions | null;
keyterms?: string[];
noVerbatim: boolean;
enableLogging: boolean;
}

export interface STTRecognizeOptions {
Expand Down Expand Up @@ -237,6 +239,7 @@ export class STT extends stt.STT {
modelId,
keyterms: opts.keyterms,
noVerbatim: opts.noVerbatim ?? false,
enableLogging: opts.enableLogging ?? true,
};
this.#session = opts.httpSession ?? {};
}
Expand Down Expand Up @@ -355,12 +358,15 @@ export class STT extends stt.STT {

try {
const fetchFn = this.#session.fetch ?? fetch;
const response = await fetchFn(`${this.#opts.baseURL}/speech-to-text`, {
method: 'POST',
headers: { [AUTHORIZATION_HEADER]: this.#opts.apiKey },
body: form,
signal: abortSignal ?? null,
});
const response = await fetchFn(
`${this.#opts.baseURL}/speech-to-text?enable_logging=${String(this.#opts.enableLogging).toLowerCase()}`,
Comment on lines +361 to +362

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.

🔍 Batch URL now always includes enable_logging query parameter — behavioral change for existing callers

Previously, the batch recognition URL was simply ${baseURL}/speech-to-text with no query parameters. Now it always appends ?enable_logging=true (or false). While true is almost certainly the ElevenLabs API's default when the parameter is omitted, this is a subtle behavioral change for all existing users — every batch request will now carry this query parameter. If the API treats the explicit presence of enable_logging=true identically to omitting it, this is harmless. Worth confirming with ElevenLabs API docs that the default is indeed true when unspecified.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

{
method: 'POST',
headers: { [AUTHORIZATION_HEADER]: this.#opts.apiKey },
body: form,
signal: abortSignal ?? null,
},
);
const responseJson = parseBatchResponse(await response.json());
if (response.status !== 200) {
throw new APIStatusError({
Expand Down Expand Up @@ -672,6 +678,7 @@ export class SpeechStream extends stt.SpeechStream {
`model_id=${this.#opts.modelId}`,
`audio_format=pcm_${this.#opts.sampleRate}`,
`commit_strategy=${commitStrategy}`,
`enable_logging=${String(this.#opts.enableLogging).toLowerCase()}`,
];

if (!this.#language) {
Expand Down
Loading