Class GuardrailRequestParams.Builder
java.lang.Object
dev.langchain4j.guardrail.GuardrailRequestParams.Builder
- Enclosing class:
GuardrailRequestParams
Builder for
GuardrailRequestParams
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaiServiceListenerRegistrar
(AiServiceListenerRegistrar aiServiceListenerRegistrar) Sets the AI service invocation event listener registrar.augmentationResult
(AugmentationResult augmentationResult) Sets the augmentation result.build()
Builds a newGuardrailRequestParams
.chatMemory
(ChatMemory chatMemory) Sets the chat memory.invocationContext
(InvocationContext invocationContext) Sets the invocation context for the builder.userMessageTemplate
(String userMessageTemplate) Sets the user message template.Sets the variables.
-
Constructor Details
-
Builder
public Builder() -
Builder
-
-
Method Details
-
chatMemory
Sets the chat memory.- Parameters:
chatMemory
- the chat memory- Returns:
- this builder
-
augmentationResult
Sets the augmentation result.- Parameters:
augmentationResult
- the augmentation result- Returns:
- this builder
-
userMessageTemplate
Sets the user message template.- Parameters:
userMessageTemplate
- the user message template- Returns:
- this builder
-
variables
Sets the variables.- Parameters:
variables
- the variables- Returns:
- this builder
-
invocationContext
Sets the invocation context for the builder.- Parameters:
invocationContext
- the invocation context, containing details such as the method name, interface name, and timestamp of the invocation- Returns:
- this builder instance, to allow for method chaining
-
aiServiceListenerRegistrar
public GuardrailRequestParams.Builder aiServiceListenerRegistrar(AiServiceListenerRegistrar aiServiceListenerRegistrar) Sets the AI service invocation event listener registrar.- Parameters:
aiServiceListenerRegistrar
- the registrar used to register and manage AI service invocation event listeners- Returns:
- this builder instance, to allow for method chaining
-
build
Builds a newGuardrailRequestParams
.- Returns:
- a new
GuardrailRequestParams
-