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-3-8b-instruct")
.maxOutputTokens(0)
.temperature(0.7)
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class for constructingWatsonxStreamingChatModelinstances with configurable parameters. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.ibm.watsonx.ai.chat.ChatServiceprotected final ChatRequestParametersprotected final List<ChatModelListener> protected final Set<Capability> -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Returns a newWatsonxStreamingChatModel.Builderinstance.voiddoChat(ChatRequest chatRequest, StreamingChatResponseHandler handler) provider()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface StreamingChatModel
chat, chat, chat
-
Field Details
-
chatService
protected final com.ibm.watsonx.ai.chat.ChatService chatService -
listeners
-
defaultRequestParameters
-
supportedCapabilities
-
-
Method Details
-
doChat
- Specified by:
doChatin interfaceStreamingChatModel
-
listeners
- Specified by:
listenersin interfaceStreamingChatModel
-
defaultRequestParameters
- Specified by:
defaultRequestParametersin interfaceStreamingChatModel
-
supportedCapabilities
- Specified by:
supportedCapabilitiesin interfaceStreamingChatModel
-
provider
- Specified by:
providerin interfaceStreamingChatModel
-
builder
Returns a newWatsonxStreamingChatModel.Builderinstance.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.Builderinstance.
-