Package org.springframework.ai.watsonx
Class WatsonxAiChatOptions
java.lang.Object
org.springframework.ai.watsonx.WatsonxAiChatOptions
- All Implemented Interfaces:
ChatOptions
,ModelOptions
Helper class for creating watsonx.ai options.
- Since:
- 1.0.0
- Author:
- Pablo Sanchidrian Herrera, John Jairo Moreno Rojas, Thomas Vitale
- See Also:
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdditionalProperty
(String key, Object value) static WatsonxAiChatOptions.Builder
builder()
copy()
Returns a copy of thisChatOptions
.filterNonSupportedFields
(Map<String, Object> options) Filter out the non-supported fields from the options.static WatsonxAiChatOptions
fromOptions
(WatsonxAiChatOptions fromOptions) Returns the frequency penalty to use for the chat.Returns the maximum number of tokens to use for the chat.getModel()
Returns the model to use for the chat.Returns the presence penalty to use for the chat.Returns the stop sequences to use for the chat.Returns the temperature to use for the chat.getTopK()
Returns the top K to use for the chat.getTopP()
Returns the top P to use for the chat.void
setDecodingMethod
(String decodingMethod) void
setMaxNewTokens
(Integer maxNewTokens) void
setMaxTokens
(Integer maxTokens) void
setMinNewTokens
(Integer minNewTokens) void
void
setPresencePenalty
(Double presencePenalty) void
setRandomSeed
(Integer randomSeed) void
setRepetitionPenalty
(Double repetitionPenalty) void
setStopSequences
(List<String> stopSequences) void
setTemperature
(Double temperature) void
void
toMap()
Convert theWatsonxAiChatOptions
object to aMap
of key/value pairs.
-
Constructor Details
-
WatsonxAiChatOptions
public WatsonxAiChatOptions()
-
-
Method Details
-
builder
-
filterNonSupportedFields
Filter out the non-supported fields from the options.- Parameters:
options
- The options to filter.- Returns:
- The filtered options.
-
fromOptions
-
getTemperature
Description copied from interface:ChatOptions
Returns the temperature to use for the chat.- Specified by:
getTemperature
in interfaceChatOptions
- Returns:
- the temperature to use for the chat
-
setTemperature
-
getTopP
Description copied from interface:ChatOptions
Returns the top P to use for the chat.- Specified by:
getTopP
in interfaceChatOptions
- Returns:
- the top P to use for the chat
-
setTopP
-
getTopK
Description copied from interface:ChatOptions
Returns the top K to use for the chat.- Specified by:
getTopK
in interfaceChatOptions
- Returns:
- the top K to use for the chat
-
setTopK
-
getDecodingMethod
-
setDecodingMethod
-
getMaxTokens
Description copied from interface:ChatOptions
Returns the maximum number of tokens to use for the chat.- Specified by:
getMaxTokens
in interfaceChatOptions
- Returns:
- the maximum number of tokens to use for the chat
-
setMaxTokens
-
getMaxNewTokens
-
setMaxNewTokens
-
getMinNewTokens
-
setMinNewTokens
-
getStopSequences
Description copied from interface:ChatOptions
Returns the stop sequences to use for the chat.- Specified by:
getStopSequences
in interfaceChatOptions
- Returns:
- the stop sequences to use for the chat
-
setStopSequences
-
getPresencePenalty
Description copied from interface:ChatOptions
Returns the presence penalty to use for the chat.- Specified by:
getPresencePenalty
in interfaceChatOptions
- Returns:
- the presence penalty to use for the chat
-
setPresencePenalty
-
getRepetitionPenalty
-
setRepetitionPenalty
-
getRandomSeed
-
setRandomSeed
-
getModel
Description copied from interface:ChatOptions
Returns the model to use for the chat.- Specified by:
getModel
in interfaceChatOptions
- Returns:
- the model to use for the chat
-
setModel
-
getAdditionalProperties
-
addAdditionalProperty
-
getFrequencyPenalty
Description copied from interface:ChatOptions
Returns the frequency penalty to use for the chat.- Specified by:
getFrequencyPenalty
in interfaceChatOptions
- Returns:
- the frequency penalty to use for the chat
-
toMap
Convert theWatsonxAiChatOptions
object to aMap
of key/value pairs.- Returns:
- The
Map
of key/value pairs.
-
copy
Description copied from interface:ChatOptions
Returns a copy of thisChatOptions
.- Specified by:
copy
in interfaceChatOptions
- Returns:
- a copy of this
ChatOptions
-