Class DeltaChoice
java.lang.Object
nl.dannyj.mistral.models.completion.DeltaChoice
Represents a delta update within a choice during a streamed chat completion.
Contains partial information about the message delta.
-
Constructor Summary
ConstructorsConstructorDescriptionDeltaChoice(int index, DeltaMessage delta, FinishReason finishReason) Creates a newDeltaChoiceinstance. -
Method Summary
-
Constructor Details
-
DeltaChoice
Creates a newDeltaChoiceinstance.- Parameters:
index- The index of the choice. Starts at 0.delta- The delta message object.finishReason- Reason for the completion to finish. Can be null if the stream is not finished.
-
DeltaChoice
public DeltaChoice()
-
-
Method Details
-
getTextContent
Gets the text content of the delta. 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 from the delta, or null if the delta is null.
-
getIndex
public int getIndex()The index of the choice. Starts at 0.- Returns:
- the index of the choice
-
getDelta
The delta containing partial message updates.- Returns:
- The delta message object.
-
getFinishReason
Reason for the completion to finish. Can be null if the stream is not finished.- Returns:
- the reason for the completion to finish, or null.
-
toString
-