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

from ...core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing
from .confidence import Confidence


class OutlineTopic(UniversalBaseModel):
    title: str = pydantic.Field()
    """
    Title of the topic
    """

    starting_phrase: str = pydantic.Field()
    """
    Starting phrase that was searched for
    """

    start_time_sec: typing.Optional[float] = pydantic.Field(default=None)
    """
    Start time in seconds for the best-aligned phrase (if found)
    """

    matched_text: str = pydantic.Field()
    """
    The transcript text segment best matching the starting phrase
    """

    score_norm: float = pydantic.Field()
    """
    Normalized alignment score in [0,1]
    """

    confidence: Confidence = pydantic.Field()
    """
    Confidence bucket derived from the normalized score
    """

    token_span: typing.Optional[typing.List[int]] = pydantic.Field(default=None)
    """
    Optional span of token indices [start, end) for the best match
    """

    matched_content: typing.Optional[int] = pydantic.Field(default=None)
    """
    Number of matched content tokens (excludes stopwords/fillers)
    """

    content_coverage: typing.Optional[float] = pydantic.Field(default=None)
    """
    Fraction of content tokens in the phrase that were matched
    """

    longest_content_run_soft: typing.Optional[int] = pydantic.Field(default=None)
    """
    Longest soft contiguous run of content-token matches
    """

    longest_content_run_strict: typing.Optional[int] = pydantic.Field(default=None)
    """
    Longest strict contiguous run of content-token matches
    """

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