OpenAIDelta

@Serializable
data class OpenAIDelta(val role: Role? = null, val content: String? = null, val reasoningContent: String? = null, val reasoning: String? = null, val refusal: String? = null, val functionCall: OpenAIFunctionCall? = null, val toolCalls: List<OpenAIToolCall>? = null)

Incremental delta content within a streaming chunk.

Only one content kind is typically present per delta: text (content), reasoning (reasoningContent or legacy reasoning), refusal (refusal), or tool calls (toolCalls).

Constructors

Link copied to clipboard
constructor(role: Role? = null, content: String? = null, reasoningContent: String? = null, reasoning: String? = null, refusal: String? = null, functionCall: OpenAIFunctionCall? = null, toolCalls: List<OpenAIToolCall>? = null)

Properties

Link copied to clipboard

Text content fragment. null if not a text delta.

Link copied to clipboard

Returns the effective reasoning content, preferring reasoningContent over reasoning.

Link copied to clipboard
@SerialName(value = "function_call")
val functionCall: OpenAIFunctionCall?

Deprecated function call fragment, replaced by toolCalls. null if not a legacy function call delta.

Link copied to clipboard

Reasoning content fragment (legacy field).

Link copied to clipboard
@SerialName(value = "reasoning_content")
val reasoningContent: String?

Reasoning content fragment (primary field).

Link copied to clipboard

Refusal message fragment generated by the model. null if not a refusal delta.

Link copied to clipboard
val role: Role?

The message role (present in the first chunk).

Link copied to clipboard
@SerialName(value = "tool_calls")
val toolCalls: List<OpenAIToolCall>?

Tool call deltas. null if not a tool call delta.