# This file was auto-generated by Fern from our API Definition.

from ...core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
from .transcription_request_info import TranscriptionRequestInfo


class TranscriptionRequest(UniversalBaseModel):
    audio_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    URL to a downloadable audio file. Must be a direct link to the file (not a streaming or preview link). If the URL is not directly downloadable, consider using our Link API to extract a downloadable link from supported sites. Either audio_url or audio_file must be provided, but not both.
    """

    audio_file: typing.Optional[str] = pydantic.Field(default=None)
    """
    Base64 encoded audio file content. Either audio_url or audio_file must be provided, but not both.
    
    ## Base64 Encoding Example
    
    **Python:**
    ```python
    import base64
    from soferai import SoferAI
    
    # Initialize client
    client = SoferAI(api_key="your_api_key_here")
    
    # Read and encode audio file
    with open("audio.mp3", "rb") as f:
        base64_audio = base64.b64encode(f.read()).decode('utf-8')
    
    # Create transcription request
    response = client.transcribe.create_transcription(
        audio_file=base64_audio,
        info={
            "model": "v1",
            "primary_language": "en",
            "hebrew_word_format": ["he"],
            "title": "My Shiur Transcription"
        }
    )
    
    print(f"Transcription ID: {response}")
    ```
    """

    info: TranscriptionRequestInfo = pydantic.Field()
    """
    Transcription parameters
    """

    model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
