Class LLMModuleResult

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

public class LLMModuleResult extends Object
Output from LLM. Follows the OpenAI spec.
  • Constructor Details

    • LLMModuleResult

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

    • id

      @Nonnull public LLMModuleResult id(@Nonnull String id)
      Set the id of this LLMModuleResult instance and return the same instance.
      Parameters:
      id - ID of the response
      Returns:
      The same instance of this LLMModuleResult class
    • getId

      @Nonnull public String getId()
      ID of the response
      Returns:
      id The id of this LLMModuleResult instance.
    • setId

      public void setId(@Nonnull String id)
      Set the id of this LLMModuleResult instance.
      Parameters:
      id - ID of the response
    • _object

      @Nonnull public LLMModuleResult _object(@Nonnull String _object)
      Set the _object of this LLMModuleResult instance and return the same instance.
      Parameters:
      _object - Object type
      Returns:
      The same instance of this LLMModuleResult class
    • getObject

      @Nonnull public String getObject()
      Object type
      Returns:
      _object The _object of this LLMModuleResult instance.
    • setObject

      public void setObject(@Nonnull String _object)
      Set the _object of this LLMModuleResult instance.
      Parameters:
      _object - Object type
    • created

      @Nonnull public LLMModuleResult created(@Nonnull Integer created)
      Set the created of this LLMModuleResult instance and return the same instance.
      Parameters:
      created - Unix timestamp
      Returns:
      The same instance of this LLMModuleResult class
    • getCreated

      @Nonnull public Integer getCreated()
      Unix timestamp
      Returns:
      created The created of this LLMModuleResult instance.
    • setCreated

      public void setCreated(@Nonnull Integer created)
      Set the created of this LLMModuleResult instance.
      Parameters:
      created - Unix timestamp
    • model

      @Nonnull public LLMModuleResult model(@Nonnull String model)
      Set the model of this LLMModuleResult instance and return the same instance.
      Parameters:
      model - Model name
      Returns:
      The same instance of this LLMModuleResult class
    • getModel

      @Nonnull public String getModel()
      Model name
      Returns:
      model The model of this LLMModuleResult instance.
    • setModel

      public void setModel(@Nonnull String model)
      Set the model of this LLMModuleResult instance.
      Parameters:
      model - Model name
    • systemFingerprint

      @Nonnull public LLMModuleResult systemFingerprint(@Nullable String systemFingerprint)
      Set the systemFingerprint of this LLMModuleResult instance and return the same instance.
      Parameters:
      systemFingerprint - System fingerprint
      Returns:
      The same instance of this LLMModuleResult class
    • getSystemFingerprint

      @Nonnull public String getSystemFingerprint()
      System fingerprint
      Returns:
      systemFingerprint The systemFingerprint of this LLMModuleResult instance.
    • setSystemFingerprint

      public void setSystemFingerprint(@Nullable String systemFingerprint)
      Set the systemFingerprint of this LLMModuleResult instance.
      Parameters:
      systemFingerprint - System fingerprint
    • choices

      @Nonnull public LLMModuleResult choices(@Nonnull List<LLMChoice> choices)
      Set the choices of this LLMModuleResult instance and return the same instance.
      Parameters:
      choices - Choices
      Returns:
      The same instance of this LLMModuleResult class
    • addChoicesItem

      @Nonnull public LLMModuleResult addChoicesItem(@Nonnull LLMChoice choicesItem)
      Add one choices instance to this LLMModuleResult.
      Parameters:
      choicesItem - The choices that should be added
      Returns:
      The same instance of type LLMModuleResult
    • getChoices

      @Nonnull public List<LLMChoice> getChoices()
      Choices
      Returns:
      choices The choices of this LLMModuleResult instance.
    • setChoices

      public void setChoices(@Nonnull List<LLMChoice> choices)
      Set the choices of this LLMModuleResult instance.
      Parameters:
      choices - Choices
    • usage

      @Nonnull public LLMModuleResult usage(@Nonnull TokenUsage usage)
      Set the usage of this LLMModuleResult instance and return the same instance.
      Parameters:
      usage - The usage of this LLMModuleResult
      Returns:
      The same instance of this LLMModuleResult class
    • getUsage

      @Nonnull public TokenUsage getUsage()
      Get usage
      Returns:
      usage The usage of this LLMModuleResult instance.
    • setUsage

      public void setUsage(@Nonnull TokenUsage usage)
      Set the usage of this LLMModuleResult instance.
      Parameters:
      usage - The usage of this LLMModuleResult
    • citations

      @Nonnull public LLMModuleResult citations(@Nullable List<Citation> citations)
      Set the citations of this LLMModuleResult instance and return the same instance.
      Parameters:
      citations - List of citations associated with the response.
      Returns:
      The same instance of this LLMModuleResult class
    • addCitationsItem

      @Nonnull public LLMModuleResult addCitationsItem(@Nonnull Citation citationsItem)
      Add one citations instance to this LLMModuleResult.
      Parameters:
      citationsItem - The citations that should be added
      Returns:
      The same instance of type LLMModuleResult
    • getCitations

      @Nonnull public List<Citation> getCitations()
      List of citations associated with the response.
      Returns:
      citations The citations of this LLMModuleResult instance.
    • setCitations

      public void setCitations(@Nullable List<Citation> citations)
      Set the citations of this LLMModuleResult instance.
      Parameters:
      citations - List of citations associated with the response.
    • getCustomFieldNames

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