Class WatsonxChatModel.Builder
java.lang.Object
dev.langchain4j.model.watsonx.WatsonxChatModel.Builder
- Enclosing class:
WatsonxChatModel
Builder class for constructing
WatsonxChatModel instances with configurable parameters.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionauthenticationProvider(com.ibm.watsonx.ai.core.auth.AuthenticationProvider authenticationProvider) build()defaultRequestParameters(dev.langchain4j.model.chat.request.ChatRequestParameters defaultRequestParameters) frequencyPenalty(Double frequencyPenalty) logRequests(Boolean logRequests) logResponses(Boolean logResponses) maxOutputTokens(Integer maxOutputTokens) presencePenalty(Double presencePenalty) responseFormat(dev.langchain4j.model.chat.request.ResponseFormat responseFormat) stopSequences(String... stopSequences) stopSequences(List<String> stopSequences) supportedCapabilities(dev.langchain4j.model.chat.Capability... supportedCapabilities) supportedCapabilities(Set<dev.langchain4j.model.chat.Capability> supportedCapabilities) temperature(Double temperature) thinking(com.ibm.watsonx.ai.chat.model.ExtractionTags tags) Sets the tag names used to extract segmented content from the assistant's response.toolChoice(dev.langchain4j.model.chat.request.ToolChoice toolChoice) toolChoiceName(String toolChoiceName) toolSpecifications(dev.langchain4j.agent.tool.ToolSpecification... toolSpecifications) toolSpecifications(List<dev.langchain4j.agent.tool.ToolSpecification> toolSpecifications) topLogprobs(Integer topLogprobs) url(com.ibm.watsonx.ai.CloudRegion cloudRegion)
-
Field Details
-
url
-
version
-
apiKey
-
logRequests
-
logResponses
-
authenticationProvider
protected com.ibm.watsonx.ai.core.auth.AuthenticationProvider authenticationProvider
-
-
Method Details
-
build
-
url
-
modelName
-
projectId
-
spaceId
-
temperature
-
topP
-
frequencyPenalty
-
presencePenalty
-
maxOutputTokens
-
stopSequences
-
stopSequences
-
toolChoice
public WatsonxChatModel.Builder toolChoice(dev.langchain4j.model.chat.request.ToolChoice toolChoice) -
responseFormat
public WatsonxChatModel.Builder responseFormat(dev.langchain4j.model.chat.request.ResponseFormat responseFormat) -
logitBias
-
logprobs
-
topLogprobs
-
seed
-
toolChoiceName
-
timeLimit
-
supportedCapabilities
public WatsonxChatModel.Builder supportedCapabilities(Set<dev.langchain4j.model.chat.Capability> supportedCapabilities) -
supportedCapabilities
public WatsonxChatModel.Builder supportedCapabilities(dev.langchain4j.model.chat.Capability... supportedCapabilities) -
toolSpecifications
public WatsonxChatModel.Builder toolSpecifications(List<dev.langchain4j.agent.tool.ToolSpecification> toolSpecifications) -
toolSpecifications
public WatsonxChatModel.Builder toolSpecifications(dev.langchain4j.agent.tool.ToolSpecification... toolSpecifications) -
listeners
public WatsonxChatModel.Builder listeners(List<dev.langchain4j.model.chat.listener.ChatModelListener> listeners) -
defaultRequestParameters
public WatsonxChatModel.Builder defaultRequestParameters(dev.langchain4j.model.chat.request.ChatRequestParameters defaultRequestParameters) -
thinking
Sets the tag names used to extract segmented content from the assistant's response.The provided
ExtractionTagsdefine which XML-like tags (such as<think>and<response>) will be used to extract the response from theAiMessage.If the
responsetag is not specified inExtractionTags, it will automatically default to"root", meaning that only the text nodes directly under the root element will be treated as the final response.Example:
// Explicitly set both tags builder.thinking(ExtractionTags.of("think", "response")).build(); // Only set reasoning tag — response defaults to "root" builder.thinking(ExtractionTags.of("think")).build();- Parameters:
tags- anExtractionTagsinstance containing the reasoning and (optionally) response tag names
-
url
-
url
-
version
-
apiKey
-
logRequests
-
logResponses
-
authenticationProvider
public WatsonxChatModel.Builder authenticationProvider(com.ibm.watsonx.ai.core.auth.AuthenticationProvider authenticationProvider)
-