Class AnthropicChatRequestParameters
java.lang.Object
dev.langchain4j.model.chat.request.DefaultChatRequestParameters
dev.langchain4j.model.anthropic.AnthropicChatRequestParameters
- All Implemented Interfaces:
ChatRequestParameters
Anthropic-specific
ChatRequestParameters that can be set per request (i.e., per ChatRequest),
overriding the values configured on the AnthropicChatModel / AnthropicStreamingChatModel builder.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a newChatRequestParametersby combining the current parameters with the specified ones.booleaninthashCode()Creates a newChatRequestParametersby combining the current parameters with the specified ones.Theidof the previous response to compare against whenreturnCacheDiagnostics()is enabled.Whether to request a (beta) cache-diagnostics comparison for this request.toString()userId()Methods inherited from class DefaultChatRequestParameters
frequencyPenalty, maxOutputTokens, modelName, presencePenalty, responseFormat, stopSequences, temperature, toolChoice, toolSpecifications, topK, topP
-
Field Details
-
EMPTY
-
-
Method Details
-
cacheSystemMessages
-
cacheTools
-
thinkingType
-
thinkingBudgetTokens
-
sendThinking
-
midConversationSystemMessages
-
returnThinking
-
toolChoiceName
-
disableParallelToolUse
-
userId
-
returnCacheDiagnostics
Whether to request a (beta) cache-diagnostics comparison for this request.- See Also:
-
previousMessageId
Theidof the previous response to compare against whenreturnCacheDiagnostics()is enabled. Passnullon the first turn of a conversation to opt in without a prior message to compare, and theidof the previousAnthropicChatResponseMetadataon every subsequent turn.This is a per-request value: it changes on every turn and there is intentionally no model-level setter for it. It can therefore be varied per request on its own, while
returnCacheDiagnostics()is enabled once on the model builder — the per-requestpreviousMessageIdis not paired with, or gated on,returnCacheDiagnostics.- See Also:
-
overrideWith
Description copied from interface:ChatRequestParametersCreates a newChatRequestParametersby combining the current parameters with the specified ones. Values from the specified parameters override values from the current parameters when there is overlap. Neither the current nor the specifiedChatRequestParametersobjects are modified.Example:
Current parameters: temperature = 1.0 maxOutputTokens = 100 Specified parameters: temperature = 0.5 modelName = my-model Result: temperature = 0.5 // Overridden from specified maxOutputTokens = 100 // Preserved from current modelName = my-model // Added from specified
- Specified by:
overrideWithin interfaceChatRequestParameters- Overrides:
overrideWithin classDefaultChatRequestParameters- Parameters:
that- the parameters whose values will override the current ones- Returns:
- a new
ChatRequestParametersinstance combining both sets of parameters
-
defaultedBy
Description copied from interface:ChatRequestParametersCreates a newChatRequestParametersby combining the current parameters with the specified ones. Values from the current parameters take precedence over values from the specified parameters when there is overlap. Neither the current nor the specifiedChatRequestParametersobjects are modified.Example:
Current parameters: temperature = 1.0 maxOutputTokens = 100 Specified parameters: temperature = 0.5 modelName = my-model Result: temperature = 1.0 // Preserved from current maxOutputTokens = 100 // Preserved from current modelName = my-model // Added from specified
- Specified by:
defaultedByin interfaceChatRequestParameters- Overrides:
defaultedByin classDefaultChatRequestParameters- Parameters:
that- the parameters whose values will be used as a default for the current ones- Returns:
- a new
ChatRequestParametersinstance combining both sets of parameters
-
equals
- Overrides:
equalsin classDefaultChatRequestParameters
-
hashCode
public int hashCode()- Overrides:
hashCodein classDefaultChatRequestParameters
-
toString
- Overrides:
toStringin classDefaultChatRequestParameters
-
toBuilder
-
builder
-