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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .audio_format_enum import AudioFormatEnum
from .session_started_payload_config_commit_strategy import SessionStartedPayloadConfigCommitStrategy


class SessionStartedPayloadConfig(UncheckedBaseModel):
    """
    Configuration for the transcription session.
    """

    sample_rate: typing.Optional[int] = pydantic.Field(default=None)
    """
    Sample rate of the audio in Hz.
    """

    audio_format: typing.Optional[AudioFormatEnum] = None
    language_code: typing.Optional[str] = pydantic.Field(default=None)
    """
    Language code in ISO 639-1 or ISO 639-3 format.
    """

    commit_strategy: typing.Optional[SessionStartedPayloadConfigCommitStrategy] = pydantic.Field(default=None)
    """
    Strategy for committing transcriptions.
    """

    vad_silence_threshold_secs: typing.Optional[float] = pydantic.Field(default=None)
    """
    Silence threshold in seconds.
    """

    vad_threshold: typing.Optional[float] = pydantic.Field(default=None)
    """
    Threshold for voice activity detection.
    """

    min_speech_duration_ms: typing.Optional[int] = pydantic.Field(default=None)
    """
    Minimum speech duration in milliseconds.
    """

    min_silence_duration_ms: typing.Optional[int] = pydantic.Field(default=None)
    """
    Minimum silence duration in milliseconds.
    """

    model_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    ID of the model to use for transcription.
    """

    enable_logging: typing.Optional[bool] = pydantic.Field(default=None)
    """
    When enable_logging is set to false zero retention mode will be used for the request. This will mean history features are unavailable for this request. Zero retention mode may only be used by enterprise customers.
    """

    include_timestamps: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the session will include word-level timestamps in the committed transcript.
    """

    include_language_detection: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the session will include language detection in the committed transcript.
    """

    keyterms: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    List of keyterms the model is biased towards.
    """

    no_verbatim: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether filler words and disfluencies are removed from the transcript.
    """

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

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
