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 ChunkedToXContent> 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 ChunkedToXContent> publisher) Creates an instance of aStreamingChatCompletionResultsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionasMap()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanFlow.Publisher<? extends ChunkedToXContent> Returns the value of thepublisherrecord component.final StringtoString()Returns a string representation of this record class.Iterator<? extends org.elasticsearch.xcontent.ToXContent> toXContentChunked(org.elasticsearch.xcontent.ToXContent.Params params) List<? extends InferenceResults> List<? extends InferenceResults> 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, toXContentChunked, toXContentChunkedV8
-
Constructor Details
-
StreamingChatCompletionResults
Creates an instance of aStreamingChatCompletionResultsrecord class.- Parameters:
publisher- the value for thepublisherrecord component
-
-
Method Details
-
isStreaming
public boolean isStreaming()- Specified by:
isStreamingin interfaceInferenceServiceResults
-
transformToCoordinationFormat
- Specified by:
transformToCoordinationFormatin interfaceInferenceServiceResults
-
transformToLegacyFormat
- Specified by:
transformToLegacyFormatin interfaceInferenceServiceResults
-
asMap
- Specified by:
asMapin interfaceInferenceServiceResults
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContentChunked
public Iterator<? extends org.elasticsearch.xcontent.ToXContent> toXContentChunked(org.elasticsearch.xcontent.ToXContent.Params params) - Specified by:
toXContentChunkedin interfaceChunkedToXContent
-
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
-