Skip to main content
This example demonstrates how to create an intelligent translation agent that goes beyond simple text translation. The agent:
  • Translates text from one language to another
  • Analyzes emotional content in the translated text
  • Selects appropriate voices based on language and emotion
  • Creates localized voices using Cartesia’s voice localization tools
  • Generates audio output with emotion-appropriate voice characteristics
The agent uses a step-by-step approach to ensure high-quality translation and voice generation, making it ideal for creating localized content that maintains the emotional tone of the original text.

Code

cookbook/examples/agents/translation_agent.py

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.
2

Set your API key

3

Install libraries

4

Run Agent