Package dev.langchain4j.guardrail
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 ChatExecutor
build()
Constructs and returns an instance ofChatExecutor
.chatRequest
(ChatRequest chatRequest) Sets theChatRequest
instance for the synchronousBuilder.
-
Field Details
-
chatRequest
-
-
Constructor Details
-
AbstractBuilder
protected AbstractBuilder()
-
-
Method Details
-
chatRequest
Sets theChatRequest
instance for the synchronousBuilder. TheChatRequest
encapsulates the input messages and parameters required to generate a response from the chat model.- Parameters:
chatRequest
- theChatRequest
containing 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
ChatExecutor
instance
-