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

from ..core.pydantic_utilities import UniversalBaseModel
import typing
from .prompt_output import PromptOutput
from .ad_hoc_streaming_prompt_execution_meta import AdHocStreamingPromptExecutionMeta
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class StreamingAdHocExecutePromptEvent(UniversalBaseModel):
    """
    The data returned for each delta during the prompt execution stream.
    """

    state: typing.Literal["STREAMING"] = "STREAMING"
    output: PromptOutput
    output_index: int
    execution_id: str
    meta: typing.Optional[AdHocStreamingPromptExecutionMeta] = None
    raw: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    The subset of the raw response from the model that the request opted into with `expand_raw`.
    """

    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
