Record Class AnthropicChatBedrockApi.AnthropicChatRequest
java.lang.Object
java.lang.Record
org.springframework.ai.bedrock.anthropic.api.AnthropicChatBedrockApi.AnthropicChatRequest
- Record Components:
prompt
- The prompt to use for the chat.temperature
- (default 0.5) The temperature to use for the chat. You should either alter temperature or top_p, but not both.maxTokensToSample
- (default 200) Specify the maximum number of tokens to use in the generated response. Note that the models may stop before reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate. We recommend a limit of 4,000 tokens for optimal performance.topK
- (default 250) Specify the number of token choices the model uses to generate the next token.topP
- (default 1) Nucleus sampling to specify the cumulative probability of the next token in range [0,1]. In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by top_p. You should either alter temperature or top_p, but not both.stopSequences
- (defaults to "\n\nHuman:") Configure up to four sequences that the model recognizes. After a stop sequence, the model stops generating further tokens. The returned text doesn't contain the stop sequence.anthropicVersion
- The version of the model to use. The default value is bedrock-2023-05-31.
- Enclosing class:
- AnthropicChatBedrockApi
public static record AnthropicChatBedrockApi.AnthropicChatRequest(String prompt, Double temperature, Integer maxTokensToSample, Integer topK, Double topP, List<String> stopSequences, String anthropicVersion)
extends Record
AnthropicChatRequest encapsulates the request parameters for the Anthropic chat model.
https://docs.anthropic.com/claude/reference/complete_post
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theanthropicVersion
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of themaxTokensToSample
record component.prompt()
Returns the value of theprompt
record component.Returns the value of thestopSequences
record component.Returns the value of thetemperature
record component.topK()
Returns the value of thetopK
record component.topP()
Returns the value of thetopP
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
AnthropicChatRequest
public AnthropicChatRequest(String prompt, Double temperature, Integer maxTokensToSample, Integer topK, Double topP, List<String> stopSequences, String anthropicVersion) Creates an instance of aAnthropicChatRequest
record class.- Parameters:
prompt
- the value for theprompt
record componenttemperature
- the value for thetemperature
record componentmaxTokensToSample
- the value for themaxTokensToSample
record componenttopK
- the value for thetopK
record componenttopP
- the value for thetopP
record componentstopSequences
- the value for thestopSequences
record componentanthropicVersion
- the value for theanthropicVersion
record component
-
-
Method Details
-
builder
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
prompt
Returns the value of theprompt
record component.- Returns:
- the value of the
prompt
record component
-
temperature
Returns the value of thetemperature
record component.- Returns:
- the value of the
temperature
record component
-
maxTokensToSample
Returns the value of themaxTokensToSample
record component.- Returns:
- the value of the
maxTokensToSample
record component
-
topK
Returns the value of thetopK
record component.- Returns:
- the value of the
topK
record component
-
topP
Returns the value of thetopP
record component.- Returns:
- the value of the
topP
record component
-
stopSequences
Returns the value of thestopSequences
record component.- Returns:
- the value of the
stopSequences
record component
-
anthropicVersion
Returns the value of theanthropicVersion
record component.- Returns:
- the value of the
anthropicVersion
record component
-