@livekit/agents-plugin-cartesia 1.4.4 → 1.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livekit/agents-plugin-cartesia",
3
- "version": "1.4.4",
3
+ "version": "1.4.6",
4
4
  "description": "Cartesia plugin for LiveKit Node Agents",
5
5
  "main": "dist/index.js",
6
6
  "require": "dist/index.cjs",
@@ -25,22 +25,23 @@
25
25
  "README.md"
26
26
  ],
27
27
  "devDependencies": {
28
- "@livekit/rtc-node": "^0.13.27",
28
+ "@livekit/rtc-node": "^0.13.29",
29
29
  "@microsoft/api-extractor": "^7.35.0",
30
30
  "@types/ws": "^8.5.10",
31
31
  "tsup": "^8.3.5",
32
32
  "typescript": "^5.0.0",
33
- "@livekit/agents": "1.4.4",
34
- "@livekit/agents-plugin-openai": "1.4.4",
35
- "@livekit/agents-plugins-test": "1.4.4"
33
+ "@livekit/agents": "1.4.6",
34
+ "@livekit/agents-plugin-openai": "1.4.6",
35
+ "@livekit/agents-plugin-silero": "1.4.6",
36
+ "@livekit/agents-plugins-test": "1.4.6"
36
37
  },
37
38
  "dependencies": {
38
39
  "ws": "^8.18.0"
39
40
  },
40
41
  "peerDependencies": {
41
- "@livekit/rtc-node": "^0.13.27",
42
+ "@livekit/rtc-node": "^0.13.29",
42
43
  "zod": "^3.25.76 || ^4.1.8",
43
- "@livekit/agents": "1.4.4"
44
+ "@livekit/agents": "1.4.6"
44
45
  },
45
46
  "scripts": {
46
47
  "build": "tsup --onSuccess \"pnpm build:types\"",
package/src/index.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  import { Plugin } from '@livekit/agents';
5
5
 
6
+ export * from './stt.js';
6
7
  export * from './tts.js';
7
8
 
8
9
  class CartesiaPlugin extends Plugin {
package/src/models.ts CHANGED
@@ -2,6 +2,18 @@
2
2
  //
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
 
5
+ /**
6
+ * LiveKit uses this encoding for all audio
7
+ */
8
+ export const AUDIO_ENCODING = 'pcm_s16le';
9
+
10
+ // ============================================================================
11
+ // TTS
12
+ // ============================================================================
13
+
14
+ /**
15
+ * See [the docs](https://docs.cartesia.ai/build-with-cartesia/tts-models/latest) for all options.
16
+ */
5
17
  export type TTSModels =
6
18
  | 'sonic'
7
19
  | 'sonic-2'
@@ -10,6 +22,9 @@ export type TTSModels =
10
22
  | 'sonic-preview'
11
23
  | 'sonic-turbo';
12
24
 
25
+ /**
26
+ * See [the docs](https://docs.cartesia.ai/build-with-cartesia/tts-models/latest) for all options.
27
+ */
13
28
  export type TTSLanguages = 'en' | 'es' | 'fr' | 'de' | 'pt' | 'zh' | 'ja';
14
29
 
15
30
  export const TTSDefaultVoiceId = 'f786b574-daa5-4673-aa0c-cbe3e8534c02';
@@ -45,9 +60,16 @@ export type TTSVoiceEmotion =
45
60
  | 'curiosity:high'
46
61
  | 'curiosity:highest';
47
62
 
48
- export type TTSEncoding =
49
- // XXX(nbsp): not yet supported
50
- // | 'pcm_f32le'
51
- // | 'pcm_mulaw'
52
- // | 'pcm_alaw'
53
- 'pcm_s16le';
63
+ /**
64
+ * @deprecated Encoding should not be parameterized. Only `pcm_s16le`is allowed. Prefer using {@link AUDIO_ENCODING}.
65
+ */
66
+ export type TTSEncoding = 'pcm_s16le';
67
+
68
+ // ============================================================================
69
+ // STT
70
+ // ============================================================================
71
+
72
+ /**
73
+ * See [the docs](https://docs.cartesia.ai/build-with-cartesia/stt-models/latest) for all options.
74
+ */
75
+ export type STTModel = 'ink-2';
@@ -0,0 +1,19 @@
1
+ // SPDX-FileCopyrightText: 2026 LiveKit, Inc.
2
+ //
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ import { VAD } from '@livekit/agents-plugin-silero';
5
+ import { stt } from '@livekit/agents-plugins-test';
6
+ import { describe, it } from 'vitest';
7
+ import { STT } from './stt.js';
8
+
9
+ const hasCartesiaApiKey = Boolean(process.env.CARTESIA_API_KEY);
10
+
11
+ if (hasCartesiaApiKey) {
12
+ describe('Cartesia STT', async () => {
13
+ await stt(new STT(), await VAD.load(), { nonStreaming: false });
14
+ });
15
+ } else {
16
+ describe('Cartesia STT', () => {
17
+ it.skip('requires CARTESIA_API_KEY', () => {});
18
+ });
19
+ }