Class EmbeddingsUsage

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

public class EmbeddingsUsage extends Object
The usage information for the request.
  • Constructor Details

    • EmbeddingsUsage

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

    • promptTokens

      @Nonnull public EmbeddingsUsage promptTokens(@Nonnull Integer promptTokens)
      Set the promptTokens of this EmbeddingsUsage instance and return the same instance.
      Parameters:
      promptTokens - The number of tokens used by the prompt.
      Returns:
      The same instance of this EmbeddingsUsage class
    • getPromptTokens

      @Nonnull public Integer getPromptTokens()
      The number of tokens used by the prompt.
      Returns:
      promptTokens The promptTokens of this EmbeddingsUsage instance.
    • setPromptTokens

      public void setPromptTokens(@Nonnull Integer promptTokens)
      Set the promptTokens of this EmbeddingsUsage instance.
      Parameters:
      promptTokens - The number of tokens used by the prompt.
    • totalTokens

      @Nonnull public EmbeddingsUsage totalTokens(@Nonnull Integer totalTokens)
      Set the totalTokens of this EmbeddingsUsage instance and return the same instance.
      Parameters:
      totalTokens - The total number of tokens used by the request.
      Returns:
      The same instance of this EmbeddingsUsage class
    • getTotalTokens

      @Nonnull public Integer getTotalTokens()
      The total number of tokens used by the request.
      Returns:
      totalTokens The totalTokens of this EmbeddingsUsage instance.
    • setTotalTokens

      public void setTotalTokens(@Nonnull Integer totalTokens)
      Set the totalTokens of this EmbeddingsUsage instance.
      Parameters:
      totalTokens - The total number of tokens used by the request.
    • getCustomFieldNames

      @Nonnull public Set<String> getCustomFieldNames()
      Get the names of the unrecognizable properties of the EmbeddingsUsage.
      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 EmbeddingsUsage 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 EmbeddingsUsage 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 EmbeddingsUsage 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 EmbeddingsUsage.Builder create()
      Create a type-safe, fluent-api builder object to construct a new EmbeddingsUsage instance with all required arguments.