Package dev.langchain4j.model.watsonx
Class WatsonxChatModel
java.lang.Object
dev.langchain4j.model.watsonx.WatsonxChatModel
- All Implemented Interfaces:
ChatModel
A
ChatModel
implementation that integrates IBM watsonx.ai with LangChain4j.
Example usage:
ChatModel chatModel = WatsonxChatModel.builder()
.url("https://...") // or use CloudRegion
.apiKey("...")
.projectId("...")
.modelName("ibm/granite-3-8b-instruct")
.maxOutputTokens(0)
.temperature(0.7)
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder class for constructingWatsonxChatModel
instances with configurable parameters. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.ibm.watsonx.ai.chat.ChatService
protected final ChatRequestParameters
protected final List
<ChatModelListener> protected final Set
<Capability> protected final com.ibm.watsonx.ai.chat.model.ExtractionTags
protected static final com.ibm.watsonx.ai.chat.model.ControlMessage
-
Method Summary
Modifier and TypeMethodDescriptionstatic WatsonxChatModel.Builder
builder()
Returns a newWatsonxChatModel.Builder
instance.doChat
(ChatRequest chatRequest) provider()
-
Field Details
-
THINKING
protected static final com.ibm.watsonx.ai.chat.model.ControlMessage THINKING -
chatService
protected final com.ibm.watsonx.ai.chat.ChatService chatService -
listeners
-
defaultRequestParameters
-
supportedCapabilities
-
tags
protected final com.ibm.watsonx.ai.chat.model.ExtractionTags tags
-
-
Method Details
-
doChat
-
listeners
-
defaultRequestParameters
- Specified by:
defaultRequestParameters
in interfaceChatModel
-
provider
-
supportedCapabilities
- Specified by:
supportedCapabilities
in interfaceChatModel
-
builder
Returns a newWatsonxChatModel.Builder
instance.Example usage:
ChatModel chatModel = WatsonxChatModel.builder() .url("https://...") // or use CloudRegion .apiKey("...") .projectId("...") .modelName("ibm/granite-3-8b-instruct") .maxOutputTokens(0) .temperature(0.7) .build();
- Returns:
WatsonxChatModel.Builder
instance.
-