OpenAIMessage
@Serializable
OpenAI response message from a chat completion.
Example:
{
"role": "assistant",
"content": "Hello! How can I help you today?"
}Content copied to clipboard
Constructors
Link copied to clipboard
constructor(role: Role, content: OpenAIChatCompletionContent? = null, reasoningContent: String? = null, reasoning: String? = null, refusal: String? = null, audio: OpenAIChatCompletionAudioResponse? = null, functionCall: OpenAIFunctionCall? = null, toolCalls: List<OpenAIToolCall>? = null)
Properties
Link copied to clipboard
Audio data when the audio output modality is requested. null when the response contains no audio.
Link copied to clipboard
The message content. null when the model only returns tool calls.
Link copied to clipboard
Returns the effective reasoning content, preferring reasoningContent over reasoning.
Link copied to clipboard
Deprecated function call, replaced by toolCalls. null when the model did not use legacy function calling.
Link copied to clipboard
Reasoning content (primary field). null if not present.
Link copied to clipboard
Tool calls requested by the model. null if none.