OpenAIMessageParam
Polymorphic request message parameter for the OpenAI API.
Discriminated by the "role" field. Each variant corresponds to a message role:
User — Input from the user.
System — System prompt.
Developer — Developer instructions (replaces system prompts for
o1and newer models).Assistant — Model's previous response (for conversation history).
Tool — Tool execution result.
Inheritors
Types
Link copied to clipboard
@Serializable
@SerialName(value = "assistant")
An assistant message (for conversation history).
Link copied to clipboard
Link copied to clipboard
@Serializable
@SerialName(value = "developer")
Developer-provided instructions that the model follows regardless of user messages.
Link copied to clipboard
@Serializable
@SerialName(value = "system")
A system message.
Link copied to clipboard
@Serializable
@SerialName(value = "tool")
A tool result message.
Link copied to clipboard
@Serializable
@SerialName(value = "user")
A user message.