# 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 ChatCompletionRequestMessage(UniversalBaseModel):
    """
    A message in the chat completion request, representing part of the conversation.
    """

    role: str = pydantic.Field()
    """
    The role of the author of this message. Common values include 'system', 'user', 'assistant', 'function', and 'tool'.
    """

    content: str = pydantic.Field()
    """
    The contents of the message.
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the author of this message, used to connect messages in a conversation.
    """

    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
