Class AnthropicChatRequestParameters.Builder
java.lang.Object
dev.langchain4j.model.chat.request.DefaultChatRequestParameters.Builder<AnthropicChatRequestParameters.Builder>
dev.langchain4j.model.anthropic.AnthropicChatRequestParameters.Builder
- Enclosing class:
AnthropicChatRequestParameters
public static class AnthropicChatRequestParameters.Builder
extends DefaultChatRequestParameters.Builder<AnthropicChatRequestParameters.Builder>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()cacheSystemMessages(Boolean cacheSystemMessages) cacheTools(Boolean cacheTools) disableParallelToolUse(Boolean disableParallelToolUse) midConversationSystemMessages(Boolean midConversationSystemMessages) modelName(AnthropicChatModelName modelName) overrideWith(ChatRequestParameters parameters) previousMessageId(String previousMessageId) Theidof the previous response to compare against; seeAnthropicChatRequestParameters.previousMessageId()for the full contract.returnCacheDiagnostics(Boolean returnCacheDiagnostics) Enables Anthropic's (beta) cache diagnostics for this request, requesting a comparison against the request identified bypreviousMessageId(String).returnThinking(Boolean returnThinking) sendThinking(Boolean sendThinking) thinkingBudgetTokens(Integer thinkingBudgetTokens) thinkingType(String thinkingType) toolChoiceName(String toolChoiceName) Methods inherited from class DefaultChatRequestParameters.Builder
frequencyPenalty, maxOutputTokens, modelName, presencePenalty, responseFormat, responseFormat, stopSequences, stopSequences, temperature, toolChoice, toolSpecifications, toolSpecifications, topK, topP
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
overrideWith
- Overrides:
overrideWithin classDefaultChatRequestParameters.Builder<AnthropicChatRequestParameters.Builder>
-
modelName
-
cacheSystemMessages
-
cacheTools
-
thinkingType
-
thinkingBudgetTokens
-
sendThinking
-
midConversationSystemMessages
public AnthropicChatRequestParameters.Builder midConversationSystemMessages(Boolean midConversationSystemMessages) -
returnThinking
-
toolChoiceName
-
disableParallelToolUse
public AnthropicChatRequestParameters.Builder disableParallelToolUse(Boolean disableParallelToolUse) -
userId
-
returnCacheDiagnostics
public AnthropicChatRequestParameters.Builder returnCacheDiagnostics(Boolean returnCacheDiagnostics) Enables Anthropic's (beta) cache diagnostics for this request, requesting a comparison against the request identified bypreviousMessageId(String). Requires thecache-diagnosis-2026-04-07beta header to be set on the model (seebeta(String)onAnthropicChatModel.AnthropicChatModelBuilder/AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder).- See Also:
-
previousMessageId
Theidof the previous response to compare against; seeAnthropicChatRequestParameters.previousMessageId()for the full contract. Passnull(the default) on the first turn of a conversation to opt in without a prior message to compare, and theidof the previousAnthropicChatResponseMetadataon every subsequent turn.- See Also:
-
build
- Overrides:
buildin classDefaultChatRequestParameters.Builder<AnthropicChatRequestParameters.Builder>
-