Class DeltaMessage
java.lang.Object
nl.dannyj.mistral.models.completion.message.DeltaMessage
Represents the delta content within a streamed chat completion choice.
Contains partial updates for role, content, or tool calls.
-
Constructor Summary
ConstructorsConstructorDescriptionDeltaMessage
(MessageRole role, List<ContentChunk> content, List<ToolCall> toolCalls) Creates a newDeltaMessage
instance. -
Method Summary
-
Constructor Details
-
DeltaMessage
public DeltaMessage(@Nullable MessageRole role, @Nullable List<ContentChunk> content, @Nullable List<ToolCall> toolCalls) Creates a newDeltaMessage
instance.- Parameters:
role
- The message role, or null if not present in this delta.content
- The partial content list or string, or null.toolCalls
- The partial list of tool calls, or null.
-
DeltaMessage
public DeltaMessage()
-
-
Method Details
-
getTextContent
Gets the text content of the delta message. This is a convenience method that extracts the text from all TextChunks, ignoring other types of content.- Returns:
- The concatenated text content of the message, or null if no text content is present.
-
getRole
The role of the message sender (e.g., assistant). Only sent if it changes or at the start.- Returns:
- The message role, or null.
-
getContent
A part of the message content. Can be null if this delta updates role or tool calls. Can be a string or a list of ContentChunks.- Returns:
- The partial content list or string, or null.
-
getToolCalls
A partial list of tool calls requested by the model. Can be null.- Returns:
- The partial list of tool calls, or null.
-
toString
-