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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class SpeakerIdentifyResponse(UniversalBaseModel):
    """
    Response from the speaker identification endpoint.
    """

    embedding: typing.List[float] = pydantic.Field()
    """
    Speaker embedding vector
    """

    embedding_dim: int = pydantic.Field()
    """
    Dimensionality of the embedding
    """

    best_match: typing.Optional[str] = pydantic.Field(default=None)
    """
    Name of the best-matching known speaker (null if no known speakers provided)
    """

    best_score: typing.Optional[float] = pydantic.Field(default=None)
    """
    Cosine similarity score of the best match (null if no known speakers)
    """

    scores: typing.Optional[typing.Dict[str, typing.Optional[float]]] = pydantic.Field(default=None)
    """
    Cosine similarity scores for all known speakers
    """

    duration_seconds: typing.Optional[float] = pydantic.Field(default=None)
    """
    Audio duration in seconds
    """

    model: str = pydantic.Field()
    """
    Model used for speaker identification
    """

    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
