"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
import io
import pydantic
from r9s.types import BaseModel
from r9s.utils import FieldMetadata, MultipartFormMetadata
from typing import IO, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypedDict


class AudioTranslationRequestFileTypedDict(TypedDict):
    file_name: str
    content: Union[bytes, IO[bytes], io.BufferedReader]
    content_type: NotRequired[str]


class AudioTranslationRequestFile(BaseModel):
    file_name: Annotated[
        str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True)
    ]

    content: Annotated[
        Union[bytes, IO[bytes], io.BufferedReader],
        pydantic.Field(alias=""),
        FieldMetadata(multipart=MultipartFormMetadata(content=True)),
    ]

    content_type: Annotated[
        Optional[str],
        pydantic.Field(alias="Content-Type"),
        FieldMetadata(multipart=True),
    ] = None


AudioTranslationRequestResponseFormat = Literal[
    "json",
    "text",
    "srt",
    "verbose_json",
    "vtt",
]
r"""Output format for the translated text"""


class AudioTranslationRequestTypedDict(TypedDict):
    file: AudioTranslationRequestFileTypedDict
    r"""Audio file to translate to English"""
    model: str
    r"""Model name (whisper-1 is primary, gpt-4o-transcribe has extended support)"""
    prompt: NotRequired[str]
    r"""Optional text prompt to guide the model's style.
    The source language can be specified in the prompt if needed, though the model will auto-detect it.

    """
    response_format: NotRequired[AudioTranslationRequestResponseFormat]
    r"""Output format for the translated text"""
    temperature: NotRequired[float]
    r"""Sampling temperature between 0 and 1"""


class AudioTranslationRequest(BaseModel):
    file: Annotated[
        AudioTranslationRequestFile,
        FieldMetadata(multipart=MultipartFormMetadata(file=True)),
    ]
    r"""Audio file to translate to English"""

    model: Annotated[str, FieldMetadata(multipart=True)]
    r"""Model name (whisper-1 is primary, gpt-4o-transcribe has extended support)"""

    prompt: Annotated[Optional[str], FieldMetadata(multipart=True)] = None
    r"""Optional text prompt to guide the model's style.
    The source language can be specified in the prompt if needed, though the model will auto-detect it.

    """

    response_format: Annotated[
        Optional[AudioTranslationRequestResponseFormat], FieldMetadata(multipart=True)
    ] = "json"
    r"""Output format for the translated text"""

    temperature: Annotated[Optional[float], FieldMetadata(multipart=True)] = 0
    r"""Sampling temperature between 0 and 1"""
