You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/cartesia/README.md
+30-7Lines changed: 30 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
[Cartesia](https://cartesia.ai) is a service that provides Speech-to-Text (STT) and Text-to-Speech (TTS) capabilities. It's designed for real-time voice applications, making it ideal for voice AI agents, transcription pipelines, and conversational interfaces.
4
4
5
-
The Cartesia plugin for the Stream Python AI SDK allows you to add TTS functionality to your project.
5
+
The Cartesia plugin for the Stream Python AI SDK allows you to add STT and TTS functionality to your project.
Read on for some key details and check out our [Cartesia examples](https://github.com/GetStream/vision-agents/tree/main/examples/other_examples/plugins_examples/tts_cartesia) to see working code samples:
19
+
Read on for some key details and check out our [Cartesia examples](https://github.com/GetStream/Vision-Agents/tree/main/plugins/cartesia/example) to see working code samples:
20
20
21
-
- in [tts.py](https://github.com/GetStream/vision-agents/tree/main/examples/other_examples/plugins_examples/tts_cartesia/tts.py) we see a simple bot greeting users upon joining a call
22
-
- in [narrator-example.py](https://github.com/GetStream/vision-agents/tree/main/examples/other_examples/plugins_examples/tts_cartesia/narrator-example.py) we see a well-prompted combination of a STT -> LLM -> TTS flow that leverages the powers of Cartesia's Sonic 3 model to narrate a creative story from the user's input
21
+
- in [main.py](https://github.com/GetStream/Vision-Agents/blob/main/plugins/cartesia/example/main.py) we see a voice bot that uses Cartesia STT and TTS in a Stream call
22
+
- in [narrator-example.py](https://github.com/GetStream/Vision-Agents/blob/main/plugins/cartesia/example/narrator-example.py) we see a well-prompted combination of an STT -> LLM -> TTS flow that leverages Cartesia's Ink and Sonic models to narrate a creative story from the user's input
23
23
24
24
## Initialisation
25
25
26
-
The Cartesia plugin for Stream exists in the form of the `TTS`class:
26
+
The Cartesia plugin for Stream exposes `STT` and `TTS`classes:
27
27
28
28
```python
29
29
30
30
from vision_agents.plugins import cartesia
31
31
32
+
stt = cartesia.STT()
32
33
tts = cartesia.TTS()
33
34
```
34
35
@@ -39,17 +40,39 @@ tts = cartesia.TTS()
39
40
40
41
## Parameters
41
42
42
-
These are the parameters available in the CartesiaTTS plugin for you to customise:
43
+
These are the parameters available in the Cartesia STT plugin for you to customise:
Copy file name to clipboardExpand all lines: plugins/cartesia/example/README.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,20 @@
1
-
# Stream + Cartesia TTS Bot Example
1
+
# Stream + Cartesia Voice Bot Example
2
2
3
-
This example demonstrates how to build a text-to-speech bot that joins a Stream video call and greets participants
4
-
using [Cartesia's](https://cartesia.ai/?utm_medium=partner&utm_source=getstream) Sonic voices.
3
+
This example demonstrates how to build a voice bot that joins a Stream video call, transcribes participants with Cartesia STT, and speaks responses with Cartesia TTS.
5
4
6
5
## What it does
7
6
8
-
-🤖 Creates a TTS bot that joins a Stream video call
9
-
-🌐 Opens a browser interface for users to join the call
10
-
-🔊 Greets users when they join using Cartesia TTS
11
-
-🎙️ Sends audio directly to the call in real-time
7
+
- Creates a voice bot that joins a Stream video call
8
+
-Uses Cartesia Ink for realtime STT and turn detection
9
+
-Uses Cartesia Sonic for TTS responses
10
+
-Uses OpenAI for the LLM response
12
11
13
12
## Prerequisites
14
13
15
14
1.**Stream Account**: Get your API credentials from [Stream Dashboard](https://getstream.io/try-for-free/?utm_source=github.com&utm_medium=referral&utm_campaign=vision_agents)
16
15
2.**Cartesia Account**: Get your API key from [Cartesia](https://cartesia.ai/?utm_medium=partner&utm_source=getstream)
17
-
3.**Python 3.10+**: Required for running the example
16
+
3.**OpenAI Account**: Set an `OPENAI_API_KEY` for the example LLM.
17
+
4.**Python 3.10+**: Required for running the example
18
18
19
19
## Installation
20
20
@@ -31,7 +31,7 @@ You can use your preferred package manager, but we recommend [`uv`](https://docs
31
31
```
32
32
33
33
3.**Set up environment variables:**
34
-
Rename `env.example` to `.env`and fill in your actual credentials.
34
+
Create a `.env`file with `STREAM_API_KEY`, `STREAM_API_SECRET`, `CARTESIA_API_KEY`, and `OPENAI_API_KEY`.
35
35
36
36
## Usage
37
37
@@ -40,3 +40,5 @@ Run the example:
40
40
```bash
41
41
uv run main.py run
42
42
```
43
+
44
+
Join the generated call, speak into your microphone, and the bot should answer out loud.
instructions="You're the narrator of a story. When you're given a topic start narrating a story and make heavy use of the audio markup tags to customize the speech output that are described in @sonic3-info.md.",
0 commit comments