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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .confidence_bucket import ConfidenceBucket
from .speaker_stat import SpeakerStat


class TranscriptionStatsResponse(UniversalBaseModel):
    """
    Transcription metrics.
    """

    total_transcript_segments: int
    total_word_count: int
    avg_confidence: float
    confidence_distribution: typing.Optional[typing.List[ConfidenceBucket]] = None
    language_distribution: typing.Optional[typing.Dict[str, int]] = pydantic.Field(default=None)
    """
    Segment counts by language code
    """

    avg_segments_per_session: float
    sessions_with_transcripts: int
    speaker_distribution: typing.Optional[typing.List[SpeakerStat]] = None

    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
