Class OutputGuardrailRequest
java.lang.Object
dev.langchain4j.guardrail.OutputGuardrailRequest
- All Implemented Interfaces:
GuardrailRequest<OutputGuardrailRequest>
public final class OutputGuardrailRequest
extends Object
implements GuardrailRequest<OutputGuardrailRequest>
Represents the parameter passed to
OutputGuardrail.validate(OutputGuardrailRequest).-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a new builder forOutputGuardrailRequest.Returns the chat executor.Returns the common parameters that are shared across guardrail checks.Returns the response from the LLM.Recreate this guardrail param with the given input or output text.
-
Method Details
-
responseFromLLM
Returns the response from the LLM.- Returns:
- the response from the LLM
-
chatExecutor
-
requestParams
Returns the common parameters that are shared across guardrail checks.- Specified by:
requestParamsin interfaceGuardrailRequest<OutputGuardrailRequest>- Returns:
- an instance of
GuardrailRequestParamscontaining shared parameters
-
withText
Description copied from interface:GuardrailRequestRecreate this guardrail param with the given input or output text.- Specified by:
withTextin interfaceGuardrailRequest<OutputGuardrailRequest>- Parameters:
text- The text of the rewritten param.- Returns:
- A clone of this guardrail params with the given input or output text.
-
builder
Creates a new builder forOutputGuardrailRequest.- Returns:
- a new builder
-