Class GuardrailRequestParams
java.lang.Object
dev.langchain4j.guardrail.GuardrailRequestParams
Represents the common parameters shared across guardrail checks when validating interactions
between a user and a language model. This class encapsulates the chat memory, user message
template, and additional variables required for guardrail processing.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionReturns theAiServiceListenerRegistrar
, which provides functionality for registering, unregistering, and notifying listeners of AI service invocation events.Returns the augmentation result.builder()
Creates a new builder forGuardrailRequestParams
.Returns the chat memory.Returns theInvocationContext
, which contains general information about the AI Service invocation.Converts the currentGuardrailRequestParams
instance to a builder, allowing modifications to the current state or creation of a new modified object.Returns the user message template.Returns the variables.
-
Method Details
-
chatMemory
-
augmentationResult
Returns the augmentation result.- Returns:
- the augmentation result, may be null
-
userMessageTemplate
Returns the user message template.- Returns:
- the user message template, never null
-
variables
-
invocationContext
Returns theInvocationContext
, which contains general information about the AI Service invocation.- Returns:
- the invocation context
-
aiservicelistenerregistrar
Returns theAiServiceListenerRegistrar
, which provides functionality for registering, unregistering, and notifying listeners of AI service invocation events.- Returns:
- the
AiServiceListenerRegistrar
-
toBuilder
Converts the currentGuardrailRequestParams
instance to a builder, allowing modifications to the current state or creation of a new modified object.- Returns:
- a
GuardrailRequestParams.Builder
pre-populated with the current state's values
-
builder
Creates a new builder forGuardrailRequestParams
.- Returns:
- a new builder
-