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

from ..core.pydantic_utilities import UniversalBaseModel
from .array_vellum_value import ArrayVellumValue
import typing
import datetime as dt
from .workflow_node_result_data import WorkflowNodeResultData
from .node_output_compiled_value import NodeOutputCompiledValue
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class StreamingWorkflowNodeResultEvent(UniversalBaseModel):
    """
    An event that indicates that the node has execution is in progress.
    """

    id: str
    node_id: str
    node_result_id: str
    state: typing.Literal["STREAMING"] = "STREAMING"
    ts: typing.Optional[dt.datetime] = None
    data: typing.Optional[WorkflowNodeResultData] = None
    source_execution_id: typing.Optional[str] = None
    output: typing.Optional[NodeOutputCompiledValue] = None
    output_index: typing.Optional[int] = 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
