Class WatsonxAiChatOptions

java.lang.Object
org.springframework.ai.watsonx.WatsonxAiChatOptions
All Implemented Interfaces:
ChatOptions, ModelOptions

public class WatsonxAiChatOptions extends Object implements ChatOptions
Helper class for creating watsonx.ai options.
Since:
1.0.0
Author:
Pablo Sanchidrian Herrera, John Jairo Moreno Rojas, Thomas Vitale
See Also:
  • Constructor Details

    • WatsonxAiChatOptions

      public WatsonxAiChatOptions()
  • Method Details

    • builder

      public static WatsonxAiChatOptions.Builder builder()
    • filterNonSupportedFields

      public static Map<String,Object> filterNonSupportedFields(Map<String,Object> options)
      Filter out the non-supported fields from the options.
      Parameters:
      options - The options to filter.
      Returns:
      The filtered options.
    • fromOptions

      public static WatsonxAiChatOptions fromOptions(WatsonxAiChatOptions fromOptions)
    • getTemperature

      public Double getTemperature()
      Description copied from interface: ChatOptions
      Returns the temperature to use for the chat.
      Specified by:
      getTemperature in interface ChatOptions
      Returns:
      the temperature to use for the chat
    • setTemperature

      public void setTemperature(Double temperature)
    • getTopP

      public Double getTopP()
      Description copied from interface: ChatOptions
      Returns the top P to use for the chat.
      Specified by:
      getTopP in interface ChatOptions
      Returns:
      the top P to use for the chat
    • setTopP

      public void setTopP(Double topP)
    • getTopK

      public Integer getTopK()
      Description copied from interface: ChatOptions
      Returns the top K to use for the chat.
      Specified by:
      getTopK in interface ChatOptions
      Returns:
      the top K to use for the chat
    • setTopK

      public void setTopK(Integer topK)
    • getDecodingMethod

      public String getDecodingMethod()
    • setDecodingMethod

      public void setDecodingMethod(String decodingMethod)
    • getMaxTokens

      public Integer getMaxTokens()
      Description copied from interface: ChatOptions
      Returns the maximum number of tokens to use for the chat.
      Specified by:
      getMaxTokens in interface ChatOptions
      Returns:
      the maximum number of tokens to use for the chat
    • setMaxTokens

      public void setMaxTokens(Integer maxTokens)
    • getMaxNewTokens

      public Integer getMaxNewTokens()
    • setMaxNewTokens

      public void setMaxNewTokens(Integer maxNewTokens)
    • getMinNewTokens

      public Integer getMinNewTokens()
    • setMinNewTokens

      public void setMinNewTokens(Integer minNewTokens)
    • getStopSequences

      public List<String> getStopSequences()
      Description copied from interface: ChatOptions
      Returns the stop sequences to use for the chat.
      Specified by:
      getStopSequences in interface ChatOptions
      Returns:
      the stop sequences to use for the chat
    • setStopSequences

      public void setStopSequences(List<String> stopSequences)
    • getPresencePenalty

      public Double getPresencePenalty()
      Description copied from interface: ChatOptions
      Returns the presence penalty to use for the chat.
      Specified by:
      getPresencePenalty in interface ChatOptions
      Returns:
      the presence penalty to use for the chat
    • setPresencePenalty

      public void setPresencePenalty(Double presencePenalty)
    • getRepetitionPenalty

      public Double getRepetitionPenalty()
    • setRepetitionPenalty

      public void setRepetitionPenalty(Double repetitionPenalty)
    • getRandomSeed

      public Integer getRandomSeed()
    • setRandomSeed

      public void setRandomSeed(Integer randomSeed)
    • getModel

      public String getModel()
      Description copied from interface: ChatOptions
      Returns the model to use for the chat.
      Specified by:
      getModel in interface ChatOptions
      Returns:
      the model to use for the chat
    • setModel

      public void setModel(String model)
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
    • addAdditionalProperty

      public void addAdditionalProperty(String key, Object value)
    • getFrequencyPenalty

      public Double getFrequencyPenalty()
      Description copied from interface: ChatOptions
      Returns the frequency penalty to use for the chat.
      Specified by:
      getFrequencyPenalty in interface ChatOptions
      Returns:
      the frequency penalty to use for the chat
    • toMap

      public Map<String,Object> toMap()
      Convert the WatsonxAiChatOptions object to a Map of key/value pairs.
      Returns:
      The Map of key/value pairs.
    • copy

      public WatsonxAiChatOptions copy()
      Description copied from interface: ChatOptions
      Returns a copy of this ChatOptions.
      Specified by:
      copy in interface ChatOptions
      Returns:
      a copy of this ChatOptions