Class ChatExecutor.StreamingToSynchronousBuilder
java.lang.Object
dev.langchain4j.guardrail.ChatExecutor.AbstractBuilder<ChatExecutor.StreamingToSynchronousBuilder>
dev.langchain4j.guardrail.ChatExecutor.StreamingToSynchronousBuilder
- Enclosing interface:
ChatExecutor
public static class ChatExecutor.StreamingToSynchronousBuilder
extends ChatExecutor.AbstractBuilder<ChatExecutor.StreamingToSynchronousBuilder>
StreamingToSynchronousBuilder for constructing instances of
ChatExecutor.
This streaming build provides a fluent API for setting required components
like ChatRequest, and for building an instance of the ChatExecutor
that simulates streaming.-
Field Summary
FieldsFields inherited from class ChatExecutor.AbstractBuilder
chatRequest -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStreamingToSynchronousBuilder(StreamingChatModel streamingChatModel) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Constructs and returns an instance ofChatExecutor.errorHandler(Consumer<Throwable> errorHandler) Sets a custom error handler to manage exceptions or errors that occur during the execution.Methods inherited from class ChatExecutor.AbstractBuilder
chatRequest
-
Field Details
-
streamingChatModel
-
errorHandler
-
-
Constructor Details
-
StreamingToSynchronousBuilder
-
-
Method Details
-
errorHandler
Sets a custom error handler to manage exceptions or errors that occur during the execution.- Parameters:
errorHandler- aConsumerofThrowablethat processes the error- Returns:
- the current
ChatExecutor.StreamingToSynchronousBuilderinstance for method chaining
-
build
Constructs and returns an instance ofChatExecutor. Ensures that all required parameters have been appropriately set before building theChatExecutor.- Specified by:
buildin classChatExecutor.AbstractBuilder<ChatExecutor.StreamingToSynchronousBuilder>- Returns:
- a fully constructed
ChatExecutorinstance
-