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

import typing

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


class LogStreamLogEvent(UniversalBaseModel):
    """
    A log entry in the SSE stream.

    Wraps LogQueryEntry fields with a type discriminator for SDK parsing.
    """

    agent_id: str
    branch_id: typing.Optional[str] = None
    environment: typing.Optional[str] = None
    level: str
    log_id: str
    logger: typing.Optional[str] = None
    message: str
    source: str
    task_id: typing.Optional[str] = None
    timestamp: str
    version: typing.Optional[str] = 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
