# 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 .message_author import MessageAuthor


class ClaudeMessageContent(UniversalBaseModel):
    """
    Content type for storing raw Claude SDK messages.
    """

    author: MessageAuthor = pydantic.Field()
    """
    The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`.
    """

    message_type: str = pydantic.Field()
    """
    The type of Claude SDK message this represents
    """

    raw_message: typing.Dict[str, typing.Any] = pydantic.Field()
    """
    The complete serialized Claude SDK message
    """

    session_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The Claude session ID
    """

    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
