Class LLMChoiceStreaming

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

public class LLMChoiceStreaming extends Object
LLMChoiceStreaming
  • Constructor Details

    • LLMChoiceStreaming

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

    • index

      @Nonnull public LLMChoiceStreaming index(@Nonnull Integer index)
      Set the index of this LLMChoiceStreaming instance and return the same instance.
      Parameters:
      index - Index of the choice
      Returns:
      The same instance of this LLMChoiceStreaming class
    • getIndex

      @Nonnull public Integer getIndex()
      Index of the choice
      Returns:
      index The index of this LLMChoiceStreaming instance.
    • setIndex

      public void setIndex(@Nonnull Integer index)
      Set the index of this LLMChoiceStreaming instance.
      Parameters:
      index - Index of the choice
    • delta

      @Nonnull public LLMChoiceStreaming delta(@Nonnull ChatDelta delta)
      Set the delta of this LLMChoiceStreaming instance and return the same instance.
      Parameters:
      delta - The delta of this LLMChoiceStreaming
      Returns:
      The same instance of this LLMChoiceStreaming class
    • getDelta

      @Nonnull public ChatDelta getDelta()
      Get delta
      Returns:
      delta The delta of this LLMChoiceStreaming instance.
    • setDelta

      public void setDelta(@Nonnull ChatDelta delta)
      Set the delta of this LLMChoiceStreaming instance.
      Parameters:
      delta - The delta of this LLMChoiceStreaming
    • logprobs

      @Nonnull public LLMChoiceStreaming logprobs(@Nullable ChoiceLogprobs logprobs)
      Set the logprobs of this LLMChoiceStreaming instance and return the same instance.
      Parameters:
      logprobs - The logprobs of this LLMChoiceStreaming
      Returns:
      The same instance of this LLMChoiceStreaming class
    • getLogprobs

      @Nonnull public ChoiceLogprobs getLogprobs()
      Get logprobs
      Returns:
      logprobs The logprobs of this LLMChoiceStreaming instance.
    • setLogprobs

      public void setLogprobs(@Nullable ChoiceLogprobs logprobs)
      Set the logprobs of this LLMChoiceStreaming instance.
      Parameters:
      logprobs - The logprobs of this LLMChoiceStreaming
    • finishReason

      @Nonnull public LLMChoiceStreaming finishReason(@Nullable String finishReason)
      Set the finishReason of this LLMChoiceStreaming instance and return the same instance.
      Parameters:
      finishReason - Reason for stopping the model
      Returns:
      The same instance of this LLMChoiceStreaming class
    • getFinishReason

      @Nonnull public String getFinishReason()
      Reason for stopping the model
      Returns:
      finishReason The finishReason of this LLMChoiceStreaming instance.
    • setFinishReason

      public void setFinishReason(@Nullable String finishReason)
      Set the finishReason of this LLMChoiceStreaming instance.
      Parameters:
      finishReason - Reason for stopping the model
    • providerSpecificFields

      @Nonnull public LLMChoiceStreaming providerSpecificFields(@Nullable Map<String,Object> providerSpecificFields)
      Set the providerSpecificFields of this LLMChoiceStreaming instance and return the same instance.
      Parameters:
      providerSpecificFields - Provider-specific fields not representable in the OpenAI schema. When not identical, includes 'finish_reason' with the raw, unmapped finish reason string from the provider.
      Returns:
      The same instance of this LLMChoiceStreaming class
    • putproviderSpecificFieldsItem

      @Nonnull public LLMChoiceStreaming putproviderSpecificFieldsItem(@Nonnull String key, @Nullable Object providerSpecificFieldsItem)
      Put one providerSpecificFields instance to this LLMChoiceStreaming instance.
      Parameters:
      key - The String key of this providerSpecificFields instance
      providerSpecificFieldsItem - The providerSpecificFields that should be added under the given key
      Returns:
      The same instance of type LLMChoiceStreaming
    • getProviderSpecificFields

      @Nonnull public Map<String,Object> getProviderSpecificFields()
      Provider-specific fields not representable in the OpenAI schema. When not identical, includes 'finish_reason' with the raw, unmapped finish reason string from the provider.
      Returns:
      providerSpecificFields The providerSpecificFields of this LLMChoiceStreaming instance.
    • setProviderSpecificFields

      public void setProviderSpecificFields(@Nullable Map<String,Object> providerSpecificFields)
      Set the providerSpecificFields of this LLMChoiceStreaming instance.
      Parameters:
      providerSpecificFields - Provider-specific fields not representable in the OpenAI schema. When not identical, includes 'finish_reason' with the raw, unmapped finish reason string from the provider.
    • getCustomFieldNames

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