Skip to main content
Inworld AI is a platform that provides high-quality Text-to-Speech (TTS) capabilities with streaming support. It offers realistic and expressive voices designed for real-time conversational AI agents, gaming characters, and interactive applications. The Inworld plugin for Vision Agents allows you to add TTS functionality to your project. Note, Inworld does have a 2,000 character limit per TTS request.

Installation

Install the Stream Inworld plugin with
uv add vision-agents[inworld]

Example

Check out our Inworld example to see a working code sample using the plugin, or read on for some key details.

Initialisation

The Inworld plugin for Stream exists in the form of the TTS class:
from vision_agents.plugins import inworld

tts = inworld.TTS()
To initialise without passing in the API key, make sure the INWORLD_API_KEY is available as an environment variable. You can do this either by defining it in a .env file or exporting it directly in your terminal.

Parameters

These are the parameters available in the Inworld TTS plugin for you to customise:
NameTypeDefaultDescription
api_keystr or NoneNoneYour Inworld AI API key. If not provided, the plugin will look for the INWORLD_API_KEY environment variable.
voice_idstr"Dennis"The voice ID to use for synthesis. Available voices can be found in the Inworld Portal.
model_idstr"inworld-tts-1"The model ID to use for synthesis. Options: "inworld-tts-1", "inworld-tts-1-max".
temperaturefloat1.1Determines the degree of randomness when sampling audio tokens. Accepts values between 0 and 2.

Functionality

Send text to convert to speech

The send() method sends the text passed in for the service to synthesize. The resulting audio is then played through the configured output track.
tts.send("Demo text you want AI voice to say")
The Inworld TTS API supports text inputs up to 2,000 characters per request.

Getting Started

  1. Get your Inworld AI API key from the Inworld Portal
  2. Set the INWORLD_API_KEY environment variable:
    export INWORLD_API_KEY="your_api_key_here"
    
  3. Use the plugin in your Vision Agents application