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

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


class StreamGenerationChunk(UniversalBaseModel):
    """
    The chunk response from the generation, possibly a partial generation.
    """

    type: typing.Literal["generation_chunk"] = "generation_chunk"
    generation_chunk: typing.Optional[str] = pydantic.Field(default=None)
    """
    Part of the message from the generator. All summary chunks must be appended together in order
    to get the full summary.
    """

    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
