Record Class LegacyTextEmbeddingResults

java.lang.Object
java.lang.Record
org.elasticsearch.xpack.core.inference.results.LegacyTextEmbeddingResults
All Implemented Interfaces:
NamedWriteable, Writeable, InferenceResults, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentFragment

@Deprecated public record LegacyTextEmbeddingResults(List<LegacyTextEmbeddingResults.Embedding> embeddings) extends Record implements InferenceResults
Deprecated.
Writes a text embedding result in the following json format { "text_embedding": [ { "embedding": [ 0.1 ] }, { "embedding": [ 0.2 ] } ] } Legacy text embedding results represents what was returned prior to the TransportVersions.V_8_12_0 version.
  • Field Details

  • Constructor Details

    • LegacyTextEmbeddingResults

      public LegacyTextEmbeddingResults(StreamInput in) throws IOException
      Deprecated.
      Throws:
      IOException
    • LegacyTextEmbeddingResults

      public LegacyTextEmbeddingResults(List<LegacyTextEmbeddingResults.Embedding> embeddings)
      Deprecated.
      Creates an instance of a LegacyTextEmbeddingResults record class.
      Parameters:
      embeddings - the value for the embeddings record component
  • Method Details

    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Deprecated.
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Deprecated.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • getWriteableName

      public String getWriteableName()
      Deprecated.
      Specified by:
      getWriteableName in interface NamedWriteable
    • getResultsField

      public String getResultsField()
      Deprecated.
      Specified by:
      getResultsField in interface InferenceResults
    • asMap

      public Map<String,Object> asMap()
      Deprecated.
      Specified by:
      asMap in interface InferenceResults
    • asMap

      public Map<String,Object> asMap(String outputField)
      Deprecated.
      Specified by:
      asMap in interface InferenceResults
    • predictedValue

      public Object predictedValue()
      Deprecated.
      Specified by:
      predictedValue in interface InferenceResults
    • equals

      public boolean equals(Object o)
      Deprecated.
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • hashCode

      public int hashCode()
      Deprecated.
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • transformToTextEmbeddingResults

      public TextEmbeddingFloatResults transformToTextEmbeddingResults()
      Deprecated.
    • toString

      public final String toString()
      Deprecated.
      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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • embeddings

      Deprecated.
      Returns the value of the embeddings record component.
      Returns:
      the value of the embeddings record component