Module org.elasticsearch.xcore
Record Class StreamingUnifiedChatCompletionResults.ChatCompletionChunk.Choice.Delta
java.lang.Object
java.lang.Record
org.elasticsearch.xpack.core.inference.results.StreamingUnifiedChatCompletionResults.ChatCompletionChunk.Choice.Delta
- All Implemented Interfaces:
Writeable
- Enclosing class:
StreamingUnifiedChatCompletionResults.ChatCompletionChunk.Choice
public static record StreamingUnifiedChatCompletionResults.ChatCompletionChunk.Choice.Delta(String content, String refusal, String role, List<StreamingUnifiedChatCompletionResults.ChatCompletionChunk.Choice.Delta.ToolCall> toolCalls, String reasoning, List<ReasoningDetail> reasoningDetails)
extends Record
implements Writeable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Constructor Summary
ConstructorsConstructorDescriptionDelta(String content, String refusal, String role, List<StreamingUnifiedChatCompletionResults.ChatCompletionChunk.Choice.Delta.ToolCall> toolCalls) Delta(String content, String refusal, String role, List<StreamingUnifiedChatCompletionResults.ChatCompletionChunk.Choice.Delta.ToolCall> toolCalls, String reasoning, List<ReasoningDetail> reasoningDetails) Creates an instance of aDeltarecord class. -
Method Summary
Modifier and TypeMethodDescriptioncontent()Returns the value of thecontentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thereasoningrecord component.Returns the value of thereasoningDetailsrecord component.refusal()Returns the value of therefusalrecord component.role()Returns the value of therolerecord component.Returns the value of thetoolCallsrecord component.final StringtoString()Returns a string representation of this record class.Iterator<? extends org.elasticsearch.xcontent.ToXContent> toXContentChunked(org.elasticsearch.xcontent.ToXContent.Params params) voidwriteTo(StreamOutput out)
-
Constructor Details
-
Delta
public Delta(@Nullable String content, @Nullable String refusal, @Nullable String role, @Nullable List<StreamingUnifiedChatCompletionResults.ChatCompletionChunk.Choice.Delta.ToolCall> toolCalls) -
Delta
public Delta(@Nullable String content, @Nullable String refusal, @Nullable String role, @Nullable List<StreamingUnifiedChatCompletionResults.ChatCompletionChunk.Choice.Delta.ToolCall> toolCalls, @Nullable String reasoning, @Nullable List<ReasoningDetail> reasoningDetails) Creates an instance of aDeltarecord class.- Parameters:
content- the value for thecontentrecord componentrefusal- the value for therefusalrecord componentrole- the value for therolerecord componenttoolCalls- the value for thetoolCallsrecord componentreasoning- the value for thereasoningrecord componentreasoningDetails- the value for thereasoningDetailsrecord component
-
-
Method Details
-
toXContentChunked
public Iterator<? extends org.elasticsearch.xcontent.ToXContent> toXContentChunked(org.elasticsearch.xcontent.ToXContent.Params params) -
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
refusal
Returns the value of therefusalrecord component.- Returns:
- the value of the
refusalrecord component
-
role
Returns the value of therolerecord component.- Returns:
- the value of the
rolerecord component
-
toolCalls
@Nullable public List<StreamingUnifiedChatCompletionResults.ChatCompletionChunk.Choice.Delta.ToolCall> toolCalls()Returns the value of thetoolCallsrecord component.- Returns:
- the value of the
toolCallsrecord component
-
reasoning
Returns the value of thereasoningrecord component.- Returns:
- the value of the
reasoningrecord component
-
reasoningDetails
Returns the value of thereasoningDetailsrecord component.- Returns:
- the value of the
reasoningDetailsrecord component
-