Skip to content

Commit f2105e8

Browse files
authored
feat(cartesia): add updateOptions (#375)
1 parent c06c84f commit f2105e8

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.changeset/tall-crews-tickle.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@livekit/agents-plugin-cartesia": patch
3+
---
4+
5+
add updateOptions

plugins/cartesia/src/tts.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,15 @@ export class TTS extends tts.TTS {
6161
}
6262
}
6363

64-
// TODO(nbsp): updateOptions
64+
updateOptions(opts: Partial<TTSOptions>) {
65+
this.#opts = { ...this.#opts, ...opts };
66+
}
6567

6668
synthesize(text: string): tts.ChunkedStream {
6769
return new ChunkedStream(this, text, this.#opts);
6870
}
6971

70-
stream(): tts.SynthesizeStream {
72+
stream(): SynthesizeStream {
7173
return new SynthesizeStream(this, this.#opts);
7274
}
7375
}
@@ -144,6 +146,10 @@ export class SynthesizeStream extends tts.SynthesizeStream {
144146
this.#run();
145147
}
146148

149+
updateOptions(opts: Partial<TTSOptions>) {
150+
this.#opts = { ...this.#opts, ...opts };
151+
}
152+
147153
async #run() {
148154
const requestId = randomUUID();
149155
let closing = false;

0 commit comments

Comments
 (0)