"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from r9s.types import BaseModel
from typing import List, Optional
from typing_extensions import NotRequired, TypedDict


class WordsTypedDict(TypedDict):
    word: NotRequired[str]
    start: NotRequired[float]
    end: NotRequired[float]


class Words(BaseModel):
    word: Optional[str] = None

    start: Optional[float] = None

    end: Optional[float] = None


class SegmentsTypedDict(TypedDict):
    id: NotRequired[int]
    seek: NotRequired[int]
    start: NotRequired[float]
    end: NotRequired[float]
    text: NotRequired[str]
    tokens: NotRequired[List[int]]
    temperature: NotRequired[float]
    avg_logprob: NotRequired[float]
    compression_ratio: NotRequired[float]
    no_speech_prob: NotRequired[float]


class Segments(BaseModel):
    id: Optional[int] = None

    seek: Optional[int] = None

    start: Optional[float] = None

    end: Optional[float] = None

    text: Optional[str] = None

    tokens: Optional[List[int]] = None

    temperature: Optional[float] = None

    avg_logprob: Optional[float] = None

    compression_ratio: Optional[float] = None

    no_speech_prob: Optional[float] = None


class AudioTranscriptionResponseTypedDict(TypedDict):
    text: str
    r"""Transcribed text"""
    language: NotRequired[str]
    r"""Detected language"""
    duration: NotRequired[float]
    r"""Audio duration (seconds)"""
    words: NotRequired[List[WordsTypedDict]]
    segments: NotRequired[List[SegmentsTypedDict]]


class AudioTranscriptionResponse(BaseModel):
    text: str
    r"""Transcribed text"""

    language: Optional[str] = None
    r"""Detected language"""

    duration: Optional[float] = None
    r"""Audio duration (seconds)"""

    words: Optional[List[Words]] = None

    segments: Optional[List[Segments]] = None
