Implementation:Groq Groq python TranslationCreateParams
| Knowledge Sources | |
|---|---|
| Domains | Audio, Translation, Type_System |
| Last Updated | 2026-02-15 16:00 GMT |
Overview
Concrete tool for defining typed parameters for audio translation requests provided by the Groq Python SDK's type system.
Description
TranslationCreateParams is a TypedDict that defines the structure and types of parameters accepted by the audio translation API. It is used internally by the SDK for request body transformation and validation. The model field is the only required parameter; all others (file, url, prompt, response_format, temperature) are optional.
Usage
Reference this type when building typed wrappers or extensions around the Groq audio translation API. In normal SDK usage, you pass these parameters directly to client.audio.translations.create() without importing this type.
Code Reference
Source Location
- Repository: Groq Python SDK
- File: src/groq/types/audio/translation_create_params.py
- Lines: 1-53
Signature
class TranslationCreateParams(TypedDict, total=False):
model: Required[Union[str, Literal["whisper-large-v3", "whisper-large-v3-turbo"]]]
"""ID of the model to use."""
file: FileTypes
"""Audio file object in flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm."""
prompt: str
"""Optional English text to guide model style."""
response_format: Literal["json", "text", "verbose_json"]
"""Output format: json, text, or verbose_json."""
temperature: float
"""Sampling temperature between 0 and 1."""
url: str
"""Audio URL (supports Base64URL). Either file or url must be provided."""
Import
from groq.types.audio import TranslationCreateParams
I/O Contract
Fields
| Name | Type | Required | Description |
|---|---|---|---|
| model | Union[str, Literal["whisper-large-v3", "whisper-large-v3-turbo"]] | Yes | Whisper model ID for translation |
| file | FileTypes | No | Audio file content (flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm) |
| prompt | str | No | English prompt for style guidance or continuation |
| response_format | Literal["json", "text", "verbose_json"] | No | Desired output format |
| temperature | float | No | Sampling temperature (0-1); 0 uses log-prob auto-increase |
| url | str | No | Audio URL (supports Base64URL); either file or url must be provided |
Usage Examples
Type-Checked Parameter Construction
from groq.types.audio import TranslationCreateParams
# Type-safe parameter construction
params: TranslationCreateParams = {
"model": "whisper-large-v3-turbo",
"response_format": "json",
"temperature": 0.2,
"url": "https://example.com/audio.mp3",
}