Package dev.langchain4j.model.anthropic
Class AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder
java.lang.Object
dev.langchain4j.model.anthropic.AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder
- Enclosing class:
AnthropicStreamingChatModel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
cacheSystemMessages
(Boolean cacheSystemMessages) cacheTools
(Boolean cacheTools) httpClientBuilder
(HttpClientBuilder httpClientBuilder) listeners
(List<ChatModelListener> listeners) logRequests
(Boolean logRequests) logResponses
(Boolean logResponses) modelName
(AnthropicChatModelName modelName) returnThinking
(Boolean returnThinking) Controls whether to return thinking/reasoning text (if available) insideAiMessage.thinking()
and whether to invoke theStreamingChatResponseHandler.onPartialThinking(PartialThinking)
callback.sendThinking
(Boolean sendThinking) Controls whether to send thinking/reasoning text to the LLM in follow-up requests.stopSequences
(List<String> stopSequences) temperature
(Double temperature) thinkingBudgetTokens
(Integer thinkingBudgetTokens) Configures thinking.thinkingType
(String thinkingType) Enables thinking.toolSpecifications
(ToolSpecification... toolSpecifications) toolSpecifications
(List<ToolSpecification> toolSpecifications)
-
Constructor Details
-
AnthropicStreamingChatModelBuilder
public AnthropicStreamingChatModelBuilder()
-
-
Method Details
-
httpClientBuilder
public AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder httpClientBuilder(HttpClientBuilder httpClientBuilder) -
baseUrl
-
apiKey
-
version
-
beta
-
modelName
-
modelName
public AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder modelName(AnthropicChatModelName modelName) -
temperature
public AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder temperature(Double temperature) -
topP
-
topK
-
maxTokens
-
stopSequences
public AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder stopSequences(List<String> stopSequences) -
toolSpecifications
public AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder toolSpecifications(List<ToolSpecification> toolSpecifications) -
toolSpecifications
public AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder toolSpecifications(ToolSpecification... toolSpecifications) -
cacheSystemMessages
public AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder cacheSystemMessages(Boolean cacheSystemMessages) -
cacheTools
public AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder cacheTools(Boolean cacheTools) -
thinkingType
public AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder thinkingType(String thinkingType) Enables thinking. -
thinkingBudgetTokens
public AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder thinkingBudgetTokens(Integer thinkingBudgetTokens) Configures thinking. -
returnThinking
public AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder returnThinking(Boolean returnThinking) Controls whether to return thinking/reasoning text (if available) insideAiMessage.thinking()
and whether to invoke theStreamingChatResponseHandler.onPartialThinking(PartialThinking)
callback. Please note that this does not enable thinking/reasoning for the LLM; it only controls whether to parse thethinking
field from the API response and return it inside theAiMessage
.Disabled by default. If enabled, the thinking text will be stored within the
AiMessage
and may be persisted. If enabled, thinking signatures will also be stored and returned inside theAiMessage.attributes()
.- See Also:
-
sendThinking
public AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder sendThinking(Boolean sendThinking) Controls whether to send thinking/reasoning text to the LLM in follow-up requests.Enabled by default. If enabled, the contents of
AiMessage.thinking()
will be sent in the API request. If enabled, thinking signatures (inside theAiMessage.attributes()
) will also be sent.- See Also:
-
timeout
-
logRequests
public AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder logRequests(Boolean logRequests) -
logResponses
public AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder logResponses(Boolean logResponses) -
listeners
public AnthropicStreamingChatModel.AnthropicStreamingChatModelBuilder listeners(List<ChatModelListener> listeners) -
build
-