Interface GuardrailResult<GR extends GuardrailResult>
- All Known Implementing Classes:
InputGuardrailResult
,OutputGuardrailResult
public interface GuardrailResult<GR extends GuardrailResult>
The result of the validation of an interaction between a user and the LLM.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
The message and the cause of the failure of a single validation.static enum
The possible results of a guardrails validation. -
Method Summary
Modifier and TypeMethodDescriptiondefault GuardrailResult
<GR> List
<? extends GuardrailResult.Failure> failures()
default Throwable
default boolean
boolean
isFatal()
default boolean
default Object
default String
validatedBy
(Class<? extends Guardrail> guardrailClass)
-
Method Details
-
getResult
GuardrailResult.Result getResult() -
isSuccess
default boolean isSuccess() -
hasRewrittenResult
default boolean hasRewrittenResult() -
blockRetry
-
successfulText
-
successfulResult
-
isFatal
boolean isFatal() -
failures
List<? extends GuardrailResult.Failure> failures()- Returns:
- The list of failures eventually resulting from a set of validations.
-
getFirstFailureException
-
validatedBy
-