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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .partial_tool_call import PartialToolCall


class PartialContext(UniversalBaseModel):
    """
    Partial state from an interrupted stream, sent by the frontend to enable recovery.
    """

    partial_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    Partial assistant text generated before the stream dropped
    """

    partial_tool_calls: typing.Optional[typing.List[PartialToolCall]] = pydantic.Field(default=None)
    """
    Tool calls that completed before the drop
    """

    user_answers: typing.Optional[str] = pydantic.Field(default=None)
    """
    User answers to follow-up questions asked before the drop
    """

    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
