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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .annotation import Annotation
from .chat_completion_audio import ChatCompletionAudio
from .chat_completion_message_tool_calls_item import ChatCompletionMessageToolCallsItem
from .function_call_output import FunctionCallOutput


class ChatCompletionMessage(UncheckedBaseModel):
    content: typing.Optional[str] = None
    refusal: typing.Optional[str] = None
    role: typing.Literal["assistant"] = "assistant"
    annotations: typing.Optional[typing.List[Annotation]] = None
    audio: typing.Optional[ChatCompletionAudio] = None
    function_call: typing.Optional[FunctionCallOutput] = None
    tool_calls: typing.Optional[typing.List[ChatCompletionMessageToolCallsItem]] = 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
