Class EmbeddingResult

java.lang.Object
com.sap.ai.sdk.orchestration.model.EmbeddingResult

public class EmbeddingResult extends Object
Represents an embedding vector returned by embedding endpoint.
  • Constructor Details

    • EmbeddingResult

      protected EmbeddingResult()
      Default constructor for EmbeddingResult.
  • Method Details

    • _object

      @Nonnull public EmbeddingResult _object(@Nonnull EmbeddingResult.ObjectEnum _object)
      Set the _object of this EmbeddingResult instance and return the same instance.
      Parameters:
      _object - The object type, which is always \"embedding\".
      Returns:
      The same instance of this EmbeddingResult class
    • getObject

      @Nonnull public EmbeddingResult.ObjectEnum getObject()
      The object type, which is always \"embedding\".
      Returns:
      _object The _object of this EmbeddingResult instance.
    • setObject

      public void setObject(@Nonnull EmbeddingResult.ObjectEnum _object)
      Set the _object of this EmbeddingResult instance.
      Parameters:
      _object - The object type, which is always \"embedding\".
    • embedding

      @Nonnull public EmbeddingResult embedding(@Nonnull Embedding embedding)
      Set the embedding of this EmbeddingResult instance and return the same instance.
      Parameters:
      embedding - The embedding of this EmbeddingResult
      Returns:
      The same instance of this EmbeddingResult class
    • getEmbedding

      @Nonnull public Embedding getEmbedding()
      Get embedding
      Returns:
      embedding The embedding of this EmbeddingResult instance.
    • setEmbedding

      public void setEmbedding(@Nonnull Embedding embedding)
      Set the embedding of this EmbeddingResult instance.
      Parameters:
      embedding - The embedding of this EmbeddingResult
    • index

      @Nonnull public EmbeddingResult index(@Nonnull Integer index)
      Set the index of this EmbeddingResult instance and return the same instance.
      Parameters:
      index - The index of the embedding in the list of embeddings.
      Returns:
      The same instance of this EmbeddingResult class
    • getIndex

      @Nonnull public Integer getIndex()
      The index of the embedding in the list of embeddings.
      Returns:
      index The index of this EmbeddingResult instance.
    • setIndex

      public void setIndex(@Nonnull Integer index)
      Set the index of this EmbeddingResult instance.
      Parameters:
      index - The index of the embedding in the list of embeddings.
    • getCustomFieldNames

      @Nonnull public Set<String> getCustomFieldNames()
      Get the names of the unrecognizable properties of the EmbeddingResult.
      Returns:
      The set of properties names
    • getCustomField

      @Nullable @Deprecated public Object getCustomField(@Nonnull String name) throws NoSuchElementException
      Deprecated.
      Use toMap() instead.
      Get the value of an unrecognizable property of this EmbeddingResult instance.
      Parameters:
      name - The name of the property
      Returns:
      The value of the property
      Throws:
      NoSuchElementException - If no property with the given name could be found.
    • toMap

      @Nonnull public Map<String,Object> toMap()
      Get the value of all properties of this EmbeddingResult instance including unrecognized properties.
      Returns:
      The map of all properties
    • setCustomField

      public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue)
      Set an unrecognizable property of this EmbeddingResult instance. If the map previously contained a mapping for the key, the old value is replaced by the specified value.
      Parameters:
      customFieldName - The name of the property
      customFieldValue - The value of the property
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object
    • create

      public static EmbeddingResult.Builder create()
      Create a type-safe, fluent-api builder object to construct a new EmbeddingResult instance with all required arguments.