Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Togethercomputer Together python Translations Create

From Leeroopedia
Revision as of 13:56, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Togethercomputer_Together_python_Translations_Create.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Audio, Translation
Last Updated 2026-02-15 16:00 GMT

Overview

Concrete tool for translating audio content into English text provided by the Together Python SDK.

Description

The Translations class provides audio translation functionality, converting audio in any supported language to English text. It accepts the same file input types as Transcriptions (local paths, URLs, file objects) and supports response format, temperature, and timestamp granularity options.

Usage

Import this class when you need to translate non-English audio to English text. Access via client.audio.translations.create().

Code Reference

Source Location

Signature

class Translations:
    def create(
        self,
        *,
        file: Union[str, BinaryIO, Path],
        model: str = "openai/whisper-large-v3",
        language: Optional[str] = None,
        prompt: Optional[str] = None,
        response_format: Union[str, AudioTranscriptionResponseFormat] = "json",
        temperature: float = 0.0,
        timestamp_granularities: Optional[Union[str, AudioTimestampGranularities]] = None,
    ) -> Union[AudioTranslationResponse, AudioTranslationVerboseResponse]: ...

Import

from together import Together

client = Together()
# Access via client.audio.translations

I/O Contract

Inputs

Name Type Required Description
file Union[str, BinaryIO, Path] Yes Audio file path, URL, or file object
model str No Model ID (default: "openai/whisper-large-v3")
language str No Source audio language (ISO-639-1)
response_format str No "json" or "verbose_json"
temperature float No Sampling temperature 0-1 (default: 0.0)

Outputs

Name Type Description
returns (json) AudioTranslationResponse Translated English text
returns (verbose_json) AudioTranslationVerboseResponse Translated text with timestamps and segments

Usage Examples

from together import Together

client = Together()

# Translate French audio to English
result = client.audio.translations.create(
    file="french_speech.mp3",
    model="openai/whisper-large-v3",
    language="fr",
)
print(result.text)  # English translation

# Verbose with timestamps
result = client.audio.translations.create(
    file="german_meeting.wav",
    response_format="verbose_json",
)
print(result.text)
for seg in result.segments:
    print(f"[{seg.start:.1f}-{seg.end:.1f}] {seg.text}")

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment