from typing import List, Optional

from pydantic import BaseModel, Field

from .function_models import ToolCall


class Message(BaseModel):
    content: str | None = Field(None, description="The contents of the message.")

    refusal: str | None = Field(
        None, description="The refusal message generated by the model."
    )

    tool_calls: list[ToolCall] | None = Field(
        None,
        description="The tool calls generated by the model, " "such as function calls.",
    )

    role: str | None = Field(
        None, description="The role of the author of this message."
    )
