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

from __future__ import annotations

import typing

from .generate_stream_end import GenerateStreamEnd
from .generate_stream_error import GenerateStreamError
from .generate_stream_text import GenerateStreamText


class GenerateStreamedResponse_TextGeneration(GenerateStreamText):
    event_type: typing.Literal["text-generation"]

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True


class GenerateStreamedResponse_StreamEnd(GenerateStreamEnd):
    event_type: typing.Literal["stream-end"]

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True


class GenerateStreamedResponse_StreamError(GenerateStreamError):
    event_type: typing.Literal["stream-error"]

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True


GenerateStreamedResponse = typing.Union[
    GenerateStreamedResponse_TextGeneration, GenerateStreamedResponse_StreamEnd, GenerateStreamedResponse_StreamError
]
