Module org.elasticsearch.xcore
Record Class StreamingUnifiedChatCompletionResults.ChatCompletionChunk
java.lang.Object
java.lang.Record
org.elasticsearch.xpack.core.inference.results.StreamingUnifiedChatCompletionResults.ChatCompletionChunk
- All Implemented Interfaces:
Writeable,ChunkedToXContent
- Enclosing class:
StreamingUnifiedChatCompletionResults
public static record StreamingUnifiedChatCompletionResults.ChatCompletionChunk(String id, List<StreamingUnifiedChatCompletionResults.ChatCompletionChunk.Choice> choices, String model, String object, StreamingUnifiedChatCompletionResults.ChatCompletionChunk.Usage usage)
extends Record
implements ChunkedToXContent, Writeable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionChatCompletionChunk(String id, List<StreamingUnifiedChatCompletionResults.ChatCompletionChunk.Choice> choices, String model, String object, StreamingUnifiedChatCompletionResults.ChatCompletionChunk.Usage usage) Creates an instance of aChatCompletionChunkrecord class. -
Method Summary
Modifier and TypeMethodDescriptionchoices()Returns the value of thechoicesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.model()Returns the value of themodelrecord component.object()Returns the value of theobjectrecord component.final StringtoString()Returns a string representation of this record class.Iterator<? extends org.elasticsearch.xcontent.ToXContent> toXContentChunked(org.elasticsearch.xcontent.ToXContent.Params params) usage()Returns the value of theusagerecord component.voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
isFragment, toXContentChunkedV7
-
Constructor Details
-
ChatCompletionChunk
public ChatCompletionChunk(String id, List<StreamingUnifiedChatCompletionResults.ChatCompletionChunk.Choice> choices, String model, String object, StreamingUnifiedChatCompletionResults.ChatCompletionChunk.Usage usage) Creates an instance of aChatCompletionChunkrecord class.- Parameters:
id- the value for theidrecord componentchoices- the value for thechoicesrecord componentmodel- the value for themodelrecord componentobject- the value for theobjectrecord componentusage- the value for theusagerecord component
-
-
Method Details
-
toXContentChunked
public Iterator<? extends org.elasticsearch.xcontent.ToXContent> toXContentChunked(org.elasticsearch.xcontent.ToXContent.Params params) - Specified by:
toXContentChunkedin interfaceChunkedToXContent
-
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
choices
Returns the value of thechoicesrecord component.- Returns:
- the value of the
choicesrecord component
-
model
Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord component
-
object
Returns the value of theobjectrecord component.- Returns:
- the value of the
objectrecord component
-
usage
Returns the value of theusagerecord component.- Returns:
- the value of the
usagerecord component
-