Implementation:Togethercomputer Together python Translations Create
Appearance
| 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
- Repository: Together Python
- File: src/together/resources/audio/translations.py
- Lines: 1-276
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