Class BedrockAi21Jurassic2ChatOptions
java.lang.Object
org.springframework.ai.bedrock.jurassic2.BedrockAi21Jurassic2ChatOptions
- All Implemented Interfaces:
ChatOptions
,ModelOptions
Request body for the /complete endpoint of the Jurassic-2 API.
- Since:
- 1.0.0
- Author:
- Ahmed Yousri, Thomas Vitale
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static final record
Penalty object for frequency, presence, and count penalties. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
copy()
Returns a copy of thisChatOptions
.fromOptions
(BedrockAi21Jurassic2ChatOptions fromOptions) Gets the count penalty object.Returns the frequency penalty to use for the chat.Gets the frequency penalty object.Gets the maximum number of tokens to generate per result.Gets the minimum number of tokens to generate per result.getModel()
Returns the model to use for the chat.Gets the number of completions to sample and return.Returns the presence penalty to use for the chat.Gets the presence penalty object.Gets the prompt text for the model to continue.Gets the stop sequences for stopping decoding if any of the strings is generated.Gets the temperature for modifying the token sampling distribution.getTopK()
Gets the top-K (topKReturn) alternative tokens to return.getTopP()
Gets the topP parameter for sampling tokens from the top percentile of probability mass.void
setCountPenaltyOptions
(BedrockAi21Jurassic2ChatOptions.Penalty countPenaltyOptions) Sets the count penalty object.void
setFrequencyPenalty
(Double frequencyPenalty) void
setFrequencyPenaltyOptions
(BedrockAi21Jurassic2ChatOptions.Penalty frequencyPenaltyOptions) Sets the frequency penalty object.void
setMaxTokens
(Integer maxTokens) Sets the maximum number of tokens to generate per result.void
setMinTokens
(Integer minTokens) Sets the minimum number of tokens to generate per result.void
setNumResults
(Integer numResults) Sets the number of completions to sample and return.void
setPresencePenalty
(Double presencePenalty) void
setPresencePenaltyOptions
(BedrockAi21Jurassic2ChatOptions.Penalty presencePenaltyOptions) Sets the presence penalty object.void
Sets the prompt text for the model to continue.void
setStopSequences
(List<String> stopSequences) Sets the stop sequences for stopping decoding if any of the strings is generated.void
setTemperature
(Double temperature) Sets the temperature for modifying the token sampling distribution.void
Sets the top-K (topKReturn) alternative tokens to return.void
Sets the topP parameter for sampling tokens from the top percentile of probability mass.
-
Constructor Details
-
BedrockAi21Jurassic2ChatOptions
public BedrockAi21Jurassic2ChatOptions()
-
-
Method Details
-
builder
-
fromOptions
public static BedrockAi21Jurassic2ChatOptions fromOptions(BedrockAi21Jurassic2ChatOptions fromOptions) -
getPrompt
Gets the prompt text for the model to continue.- Returns:
- The prompt text.
-
setPrompt
Sets the prompt text for the model to continue.- Parameters:
prompt
- The prompt text.
-
getNumResults
Gets the number of completions to sample and return.- Returns:
- The number of results.
-
setNumResults
Sets the number of completions to sample and return.- Parameters:
numResults
- The number of results.
-
getMaxTokens
Gets the maximum number of tokens to generate per result.- Specified by:
getMaxTokens
in interfaceChatOptions
- Returns:
- The maximum number of tokens.
-
setMaxTokens
Sets the maximum number of tokens to generate per result.- Parameters:
maxTokens
- The maximum number of tokens.
-
getMinTokens
Gets the minimum number of tokens to generate per result.- Returns:
- The minimum number of tokens.
-
setMinTokens
Sets the minimum number of tokens to generate per result.- Parameters:
minTokens
- The minimum number of tokens.
-
getTemperature
Gets the temperature for modifying the token sampling distribution.- Specified by:
getTemperature
in interfaceChatOptions
- Returns:
- The temperature.
-
setTemperature
Sets the temperature for modifying the token sampling distribution.- Parameters:
temperature
- The temperature.
-
getTopP
Gets the topP parameter for sampling tokens from the top percentile of probability mass.- Specified by:
getTopP
in interfaceChatOptions
- Returns:
- The topP parameter.
-
setTopP
Sets the topP parameter for sampling tokens from the top percentile of probability mass.- Parameters:
topP
- The topP parameter.
-
getTopK
Gets the top-K (topKReturn) alternative tokens to return.- Specified by:
getTopK
in interfaceChatOptions
- Returns:
- The top-K parameter. (topKReturn)
-
setTopK
Sets the top-K (topKReturn) alternative tokens to return.- Parameters:
topK
- The top-K parameter (topKReturn).
-
getStopSequences
Gets the stop sequences for stopping decoding if any of the strings is generated.- Specified by:
getStopSequences
in interfaceChatOptions
- Returns:
- The stop sequences.
-
setStopSequences
Sets the stop sequences for stopping decoding if any of the strings is generated.- Parameters:
stopSequences
- The stop sequences.
-
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
-
setFrequencyPenalty
-
getFrequencyPenaltyOptions
Gets the frequency penalty object.- Returns:
- The frequency penalty object.
-
setFrequencyPenaltyOptions
public void setFrequencyPenaltyOptions(BedrockAi21Jurassic2ChatOptions.Penalty frequencyPenaltyOptions) Sets the frequency penalty object.- Parameters:
frequencyPenaltyOptions
- The frequency penalty object.
-
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
-
getPresencePenaltyOptions
Gets the presence penalty object.- Returns:
- The presence penalty object.
-
setPresencePenaltyOptions
public void setPresencePenaltyOptions(BedrockAi21Jurassic2ChatOptions.Penalty presencePenaltyOptions) Sets the presence penalty object.- Parameters:
presencePenaltyOptions
- The presence penalty object.
-
getCountPenaltyOptions
Gets the count penalty object.- Returns:
- The count penalty object.
-
setCountPenaltyOptions
Sets the count penalty object.- Parameters:
countPenaltyOptions
- The count penalty object.
-
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
-
copy
Description copied from interface:ChatOptions
Returns a copy of thisChatOptions
.- Specified by:
copy
in interfaceChatOptions
- Returns:
- a copy of this
ChatOptions
-