Module org.elasticsearch.xcore
Record Class StreamingChatCompletionResults
java.lang.Object
java.lang.Record
org.elasticsearch.xpack.core.inference.results.StreamingChatCompletionResults
- All Implemented Interfaces:
NamedWriteable,Writeable,ChunkedToXContent,InferenceServiceResults
public record StreamingChatCompletionResults(Flow.Publisher<? extends InferenceServiceResults.Result> publisher)
extends Record
implements InferenceServiceResults
Chat Completion results that only contain a Flow.Publisher.
-
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
ConstructorsConstructorDescriptionStreamingChatCompletionResults(Flow.Publisher<? extends InferenceServiceResults.Result> publisher) Creates an instance of aStreamingChatCompletionResultsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanFlow.Publisher<? extends InferenceServiceResults.Result> Returns the value of thepublisherrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
isFragment, toXContentChunked, toXContentChunkedV8Methods inherited from interface org.elasticsearch.inference.InferenceServiceResults
asMap, getWriteableName, toXContentChunked, transformToCoordinationFormat, writeTo
-
Constructor Details
-
StreamingChatCompletionResults
public StreamingChatCompletionResults(Flow.Publisher<? extends InferenceServiceResults.Result> publisher) Creates an instance of aStreamingChatCompletionResultsrecord class.- Parameters:
publisher- the value for thepublisherrecord component
-
-
Method Details
-
isStreaming
public boolean isStreaming()- Specified by:
isStreamingin interfaceInferenceServiceResults
-
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). -
publisher
Returns the value of thepublisherrecord component.- Specified by:
publisherin interfaceInferenceServiceResults- Returns:
- the value of the
publisherrecord component
-