diff --git a/.changeset/deepgram-redact-param.md b/.changeset/deepgram-redact-param.md new file mode 100644 index 000000000..a31091650 --- /dev/null +++ b/.changeset/deepgram-redact-param.md @@ -0,0 +1,5 @@ +--- +'@livekit/agents-plugin-deepgram': patch +--- + +Avoid serializing an unset Deepgram STT redact query parameter. diff --git a/plugins/deepgram/src/stt.ts b/plugins/deepgram/src/stt.ts index 3f2650b56..922e28b71 100644 --- a/plugins/deepgram/src/stt.ts +++ b/plugins/deepgram/src/stt.ts @@ -267,9 +267,9 @@ export class SpeechStream extends stt.SpeechStream { keywords: this.#opts.keywords.map((x) => x.join(':')), keyterm: this.#opts.keyterm, profanity_filter: this.#opts.profanityFilter, - redact: this.#opts.redact, language: this.#opts.language, mip_opt_out: this.#opts.mipOptOut, + ...(this.#opts.redact.length > 0 ? { redact: this.#opts.redact } : {}), }; Object.entries(params).forEach(([k, v]) => { if (v !== undefined) {