Class ChatExecutor.AbstractBuilder<T extends ChatExecutor.AbstractBuilder<T>>
java.lang.Object
dev.langchain4j.guardrail.ChatExecutor.AbstractBuilder<T>
- Type Parameters:
T- the type of the builder subclass for enabling fluent method chaining
- Direct Known Subclasses:
ChatExecutor.StreamingToSynchronousBuilder, ChatExecutor.SynchronousBuilder
- Enclosing interface:
ChatExecutor
public abstract static class ChatExecutor.AbstractBuilder<T extends ChatExecutor.AbstractBuilder<T>>
extends Object
An abstract base-builder class for constructing instances of
ChatExecutor.
This class provides a fluent API for setting required components, such as
ChatRequest, and defines a contract for building ChatExecutor
instances. Subclasses should implement the build() method to ensure
proper construction of the target chat executor object.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ChatExecutorbuild()Constructs and returns an instance ofChatExecutor.chatRequest(ChatRequest chatRequest) Sets theChatRequestinstance for the synchronousBuilder.
-
Field Details
-
chatRequest
-
-
Constructor Details
-
AbstractBuilder
protected AbstractBuilder()
-
-
Method Details
-
chatRequest
Sets theChatRequestinstance for the synchronousBuilder. TheChatRequestencapsulates the input messages and parameters required to generate a response from the chat model.- Parameters:
chatRequest- theChatRequestcontaining the input messages and parameters- Returns:
- the updated SynchronousBuilder instance
-
build
Constructs and returns an instance ofChatExecutor. Ensures that all required parameters have been appropriately set before building theChatExecutor.- Returns:
- a fully constructed
ChatExecutorinstance
-