# 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 .stream_tts_response_message_data import StreamTtsResponseMessageData
from .stream_tts_response_message_error import StreamTtsResponseMessageError
from .stream_tts_response_message_status import StreamTtsResponseMessageStatus


class StreamTtsResponseMessage(UncheckedBaseModel):
    request_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Unique identifier for the streaming TTS request
    """

    status: typing.Optional[StreamTtsResponseMessageStatus] = pydantic.Field(default=None)
    """
    Status of the streaming TTS request: 'chunk' for audio data, 'complete' for end of stream, 'error' for failures
    """

    data: typing.Optional[StreamTtsResponseMessageData] = None
    error: typing.Optional[StreamTtsResponseMessageError] = 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
