Skip to content

OpenAIMessage

Base classes

Name Children Inherits
Schema
schemez.schema
Base class for configuration models.

⋔ Inheritance diagram

graph TD
  673120616["models.OpenAIMessage"]
  330168112["schema.Schema"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  330168112 --> 673120616
  3879467795 --> 330168112
  2751680898 --> 3879467795

🛈 DocStrings

Bases: Schema

OpenAI chat message format.

Source code in src/llmling_models/openai_server/models.py
class OpenAIMessage(Schema):
    """OpenAI chat message format."""

    role: Literal["system", "user", "assistant", "tool", "function"]
    content: str | None  # Content can be null in function calls
    name: str | None = None
    function_call: FunctionCall | None = None
    tool_calls: list[ToolCall] | None = None
    tool_call_id: str | None = None  # For tool responses

:fa-brands-github: Show source on GitHub