Package dev.langchain4j.model.watsonx
Class WatsonxStreamingChatModel
java.lang.Object
dev.langchain4j.model.watsonx.WatsonxStreamingChatModel
- All Implemented Interfaces:
StreamingChatModel
A
StreamingChatModel
implementation that integrates IBM watsonx.ai with LangChain4j.
Example usage:
StreamingChatModel chatModel = WatsonxStreamingChatModel.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 constructingWatsonxStreamingChatModel
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 TypeMethodDescriptionbuilder()
Returns a newWatsonxStreamingChatModel.Builder
instance.void
doChat
(ChatRequest chatRequest, StreamingChatResponseHandler handler) provider()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.langchain4j.model.chat.StreamingChatModel
chat, chat, chat
-
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
- Specified by:
doChat
in interfaceStreamingChatModel
-
listeners
- Specified by:
listeners
in interfaceStreamingChatModel
-
defaultRequestParameters
- Specified by:
defaultRequestParameters
in interfaceStreamingChatModel
-
supportedCapabilities
- Specified by:
supportedCapabilities
in interfaceStreamingChatModel
-
provider
- Specified by:
provider
in interfaceStreamingChatModel
-
builder
Returns a newWatsonxStreamingChatModel.Builder
instance.Example usage:
StreamingChatModel chatModel = WatsonxStreamingChatModel.builder() .url("https://...") // or use CloudRegion .apiKey("...") .projectId("...") .modelName("ibm/granite-3-8b-instruct") .maxOutputTokens(0) .temperature(0.7) .build();
- Returns:
WatsonxStreamingChatModel.Builder
instance.
-