Skip to content

Commit f9b2a73

Browse files
author
aoife cassidy
authored
fix(deepgram): add keyterm for nova-3-general (#337)
1 parent d444459 commit f9b2a73

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/metal-keys-run.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@livekit/agents-plugin-deepgram": patch
3+
---
4+
5+
fix(deepgram): add keyterm for nova-3-general #337

plugins/deepgram/src/stt.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export interface STTOptions {
2222
sampleRate: number;
2323
numChannels: number;
2424
keywords: [string, number][];
25+
keyterm: string[];
2526
profanityFilter: boolean;
2627
dictation: boolean;
2728
diarize: boolean;
@@ -42,6 +43,7 @@ const defaultSTTOptions: STTOptions = {
4243
sampleRate: 16000,
4344
numChannels: 1,
4445
keywords: [],
46+
keyterm: [],
4547
profanityFilter: false,
4648
dictation: false,
4749
diarize: false,
@@ -138,6 +140,7 @@ export class SpeechStream extends stt.SpeechStream {
138140
endpointing: this.#opts.endpointing || false,
139141
filler_words: this.#opts.fillerWords,
140142
keywords: this.#opts.keywords.map((x) => x.join(':')),
143+
keyterm: this.#opts.keyterm,
141144
profanity_filter: this.#opts.profanityFilter,
142145
language: this.#opts.language,
143146
};
@@ -146,7 +149,7 @@ export class SpeechStream extends stt.SpeechStream {
146149
if (typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean') {
147150
streamURL.searchParams.append(k, encodeURIComponent(v));
148151
} else {
149-
v.forEach((x) => streamURL.searchParams.append('keywords', encodeURIComponent(x)));
152+
v.forEach((x) => streamURL.searchParams.append(k, encodeURIComponent(x)));
150153
}
151154
}
152155
});

0 commit comments

Comments
 (0)