@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/README.md +1 -1
- package/dist/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/models.cjs +3 -0
- package/dist/models.cjs.map +1 -1
- package/dist/models.d.cts +17 -0
- package/dist/models.d.ts +17 -0
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +2 -0
- package/dist/models.js.map +1 -1
- package/dist/stt.cjs +409 -0
- package/dist/stt.cjs.map +1 -0
- package/dist/stt.d.cts +51 -0
- package/dist/stt.d.ts +51 -0
- package/dist/stt.d.ts.map +1 -0
- package/dist/stt.js +392 -0
- package/dist/stt.js.map +1 -0
- package/dist/stt.test.cjs +17 -0
- package/dist/stt.test.cjs.map +1 -0
- package/dist/stt.test.d.cts +2 -0
- package/dist/stt.test.d.ts +2 -0
- package/dist/stt.test.d.ts.map +1 -0
- package/dist/stt.test.js +16 -0
- package/dist/stt.test.js.map +1 -0
- package/dist/tts.cjs +31 -21
- package/dist/tts.cjs.map +1 -1
- package/dist/tts.d.ts.map +1 -1
- package/dist/tts.js +35 -22
- package/dist/tts.js.map +1 -1
- package/package.json +8 -7
- package/src/index.ts +1 -0
- package/src/models.ts +28 -6
- package/src/stt.test.ts +19 -0
- package/src/stt.ts +618 -0
- package/src/tts.ts +41 -24
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livekit/agents-plugin-cartesia",
|
|
3
|
-
"version": "1.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.
|
|
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.
|
|
34
|
-
"@livekit/agents-plugin-openai": "1.4.
|
|
35
|
-
"@livekit/agents-
|
|
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.
|
|
42
|
+
"@livekit/rtc-node": "^0.13.29",
|
|
42
43
|
"zod": "^3.25.76 || ^4.1.8",
|
|
43
|
-
"@livekit/agents": "1.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
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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';
|
package/src/stt.test.ts
ADDED
|
@@ -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
|
+
}
|