The Upstreet Agents SDK is now in public beta 🎉 Get started →
bg-pattern
📚 API ReferenceGenerative AI

<TTS>

Add text-to-speech support to your agent.

Import

import { TTS } from 'react-agents';

Usage

The TTS component adds text-to-speech capabilities to your agent, allowing it to speak messages using a specified voice endpoint.

  1. Add the component to your agent:

    return (
      <Agent>
        {/* ... */}
        <TTS voiceEndpoint="elevenlabs:scillia:kNBPK9DILaezWWUSHpF9" />
        {/* ... */}
      </Agent>
    );
  2. Use the say action in your agent's responses:

    agent.say({ text: "Hello, I can speak!" });

    Or, simply chat with the agent to get them to speak.

Props

PropTypeDefault
voiceEndpoint
string
null (uses default voice)

Custom voices

You can create and use custom voices with the USDK CLI. Learn how to do that here.

Using Custom Voices with <TTS>

Once created, use your custom voice in the TTS component by setting the voiceEndpoint prop:

<TTS voiceEndpoint="elevenlabs:scillia:kNBPK9DILaezWWUSHpF9" />

On this page

Facing an issue? Add a ticket.