Class WatsonxStreamingChatModel.Builder
java.lang.Object
dev.langchain4j.model.watsonx.WatsonxStreamingChatModel.Builder
- Enclosing class:
WatsonxStreamingChatModel
Builder class for constructing
WatsonxStreamingChatModel 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 WatsonxStreamingChatModel.Builder toolChoice(dev.langchain4j.model.chat.request.ToolChoice toolChoice) -
responseFormat
public WatsonxStreamingChatModel.Builder responseFormat(dev.langchain4j.model.chat.request.ResponseFormat responseFormat) -
logitBias
-
logprobs
-
topLogprobs
-
seed
-
toolChoiceName
-
timeLimit
-
supportedCapabilities
public WatsonxStreamingChatModel.Builder supportedCapabilities(Set<dev.langchain4j.model.chat.Capability> supportedCapabilities) -
supportedCapabilities
public WatsonxStreamingChatModel.Builder supportedCapabilities(dev.langchain4j.model.chat.Capability... supportedCapabilities) -
toolSpecifications
public WatsonxStreamingChatModel.Builder toolSpecifications(List<dev.langchain4j.agent.tool.ToolSpecification> toolSpecifications) -
toolSpecifications
public WatsonxStreamingChatModel.Builder toolSpecifications(dev.langchain4j.agent.tool.ToolSpecification... toolSpecifications) -
listeners
public WatsonxStreamingChatModel.Builder listeners(List<dev.langchain4j.model.chat.listener.ChatModelListener> listeners) -
defaultRequestParameters
public WatsonxStreamingChatModel.Builder defaultRequestParameters(dev.langchain4j.model.chat.request.ChatRequestParameters defaultRequestParameters) -
thinking
public WatsonxStreamingChatModel.Builder thinking(com.ibm.watsonx.ai.chat.model.ExtractionTags tags) 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 WatsonxStreamingChatModel.Builder authenticationProvider(com.ibm.watsonx.ai.core.auth.AuthenticationProvider authenticationProvider)
-