-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugins(cartesia): init with TTS (#217)
Co-authored-by: Théo Monnom <[email protected]>
- Loading branch information
1 parent
ba39f03
commit 9f31ba0
Showing
26 changed files
with
492 additions
and
67 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@livekit/agents-plugin-cartesia": minor | ||
--- | ||
|
||
plugins(cartesia): init with TTS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: 2024 LiveKit, Inc. | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
# Cartesia plugin for LiveKit Agents | ||
|
||
The Agents Framework is designed for building realtime, programmable | ||
participants that run on servers. Use it to create conversational, multi-modal | ||
voice agents that can see, hear, and understand. | ||
|
||
This package contains the Cartesia plugin, which allows for voice synthesis. | ||
Refer to the [documentation](https://docs.livekit.io/agents/overview/) for | ||
information on how to use it, or browse the [API | ||
reference](https://docs.livekit.io/agents-js/modules/plugins_agents_plugin_cartesia.html). | ||
See the [repository](https://github.com/livekit/agents-js) for more information | ||
about the framework as a whole. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Config file for API Extractor. For more info, please visit: https://api-extractor.com | ||
*/ | ||
{ | ||
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
|
||
/** | ||
* Optionally specifies another JSON config file that this file extends from. This provides a way for | ||
* standard settings to be shared across multiple projects. | ||
* | ||
* If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains | ||
* the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be | ||
* resolved using NodeJS require(). | ||
* | ||
* SUPPORTED TOKENS: none | ||
* DEFAULT VALUE: "" | ||
*/ | ||
"extends": "../../api-extractor-shared.json", | ||
"mainEntryPointFilePath": "./dist/index.d.ts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"name": "@livekit/agents-plugin-cartesia", | ||
"version": "0.0.0", | ||
"description": "Cartesia plugin for LiveKit Node Agents", | ||
"main": "dist/index.js", | ||
"require": "dist/index.cjs", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.cjs" | ||
} | ||
}, | ||
"author": "LiveKit", | ||
"type": "module", | ||
"repository": "[email protected]:livekit/agents-js.git", | ||
"license": "Apache-2.0", | ||
"files": [ | ||
"dist", | ||
"src", | ||
"README.md" | ||
], | ||
"scripts": { | ||
"build": "tsup --onSuccess \"tsc --declaration --emitDeclarationOnly\"", | ||
"clean": "rm -rf dist", | ||
"clean:build": "pnpm clean && pnpm build", | ||
"lint": "eslint -f unix \"src/**/*.{ts,js}\"", | ||
"api:check": "api-extractor run --typescript-compiler-folder ../../node_modules/typescript", | ||
"api:update": "api-extractor run --local --typescript-compiler-folder ../../node_modules/typescript --verbose" | ||
}, | ||
"devDependencies": { | ||
"@livekit/agents": "workspace:^x", | ||
"@livekit/agents-plugin-openai": "workspace:^x", | ||
"@livekit/agents-plugins-test": "workspace:^x", | ||
"@livekit/rtc-node": "^0.12.1", | ||
"@microsoft/api-extractor": "^7.35.0", | ||
"@types/ws": "^8.5.10", | ||
"tsup": "^8.3.5", | ||
"typescript": "^5.0.0" | ||
}, | ||
"dependencies": { | ||
"ws": "^8.16.0" | ||
}, | ||
"peerDependencies": { | ||
"@livekit/agents": "workspace:^x", | ||
"@livekit/rtc-node": "^0.12.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// SPDX-FileCopyrightText: 2024 LiveKit, Inc. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export * from './tts.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// SPDX-FileCopyrightText: 2024 LiveKit, Inc. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export type TTSModels = 'sonic-english' | 'sonic-multilingual'; | ||
|
||
export type TTSLanguages = 'en' | 'es' | 'fr' | 'de' | 'pt' | 'zh' | 'ja'; | ||
|
||
export const TTSDefaultVoiceId = 'c2ac25f9-ecc4-4f56-9095-651354df60c0'; | ||
|
||
export type TTSVoiceSpeed = 'fastest' | 'fast' | 'normal' | 'slow' | 'slowest'; | ||
|
||
export type TTSVoiceEmotion = | ||
| 'anger:lowest' | ||
| 'anger:low' | ||
| 'anger' | ||
| 'anger:high' | ||
| 'anger:highest' | ||
| 'positivity:lowest' | ||
| 'positivity:low' | ||
| 'positivity' | ||
| 'positivity:high' | ||
| 'positivity:highest' | ||
| 'surprise:lowest' | ||
| 'surprise:low' | ||
| 'surprise' | ||
| 'surprise:high' | ||
| 'surprise:highest' | ||
| 'sadness:lowest' | ||
| 'sadness:low' | ||
| 'sadness' | ||
| 'sadness:high' | ||
| 'sadness:highest' | ||
| 'curiosity:lowest' | ||
| 'curiosity:low' | ||
| 'curiosity' | ||
| 'curiosity:high' | ||
| 'curiosity:highest'; | ||
|
||
export type TTSEncoding = | ||
// XXX(nbsp): not yet supported | ||
// | 'pcm_f32le' | ||
// | 'pcm_mulaw' | ||
// | 'pcm_alaw' | ||
'pcm_s16le'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// SPDX-FileCopyrightText: 2024 LiveKit, Inc. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { STT } from '@livekit/agents-plugin-openai'; | ||
import { tts } from '@livekit/agents-plugins-test'; | ||
import { describe } from 'vitest'; | ||
import { TTS } from './tts.js'; | ||
|
||
describe('Cartesia', async () => { | ||
await tts(new TTS(), new STT()); | ||
}); |
Oops, something went wrong.