Record Class OutputGuardrailResult
java.lang.Object
java.lang.Record
io.quarkiverse.langchain4j.guardrails.OutputGuardrailResult
- Record Components:
result- The result of the output guardrail validation.failures- The list of failures, empty if the validation succeeded.
- All Implemented Interfaces:
GuardrailResult<OutputGuardrailResult>
public record OutputGuardrailResult(GuardrailResult.Result result, List<io.quarkiverse.langchain4j.guardrails.OutputGuardrailResult.Failure> failures)
extends Record
implements GuardrailResult<OutputGuardrailResult>
The result of the validation of an
OutputGuardrail-
Nested Class Summary
Nested classes/interfaces inherited from interface io.quarkiverse.langchain4j.guardrails.GuardrailResult
GuardrailResult.Result -
Constructor Summary
ConstructorsConstructorDescriptionOutputGuardrailResult(GuardrailResult.Result result, List<io.quarkiverse.langchain4j.guardrails.OutputGuardrailResult.Failure> failures) Creates an instance of aOutputGuardrailResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static OutputGuardrailResultfailure(List<? extends GuardrailResult.Failure> failures) List<io.quarkiverse.langchain4j.guardrails.OutputGuardrailResult.Failure> failures()Returns the value of thefailuresrecord component.final inthashCode()Returns a hash code value for this object.booleanisFatal()booleanisRetry()booleanresult()Returns the value of theresultrecord component.static OutputGuardrailResultsuccess()toString()Returns a string representation of this record class.validatedBy(Class<? extends Guardrail> guardrailClass) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.quarkiverse.langchain4j.guardrails.GuardrailResult
getFirstFailureException
-
Constructor Details
-
OutputGuardrailResult
public OutputGuardrailResult(GuardrailResult.Result result, List<io.quarkiverse.langchain4j.guardrails.OutputGuardrailResult.Failure> failures) Creates an instance of aOutputGuardrailResultrecord class.
-
-
Method Details
-
success
-
failure
-
isSuccess
public boolean isSuccess()- Specified by:
isSuccessin interfaceGuardrailResult<OutputGuardrailResult>
-
isRetry
public boolean isRetry() -
getReprompt
-
isFatal
public boolean isFatal()- Specified by:
isFatalin interfaceGuardrailResult<OutputGuardrailResult>
-
validatedBy
- Specified by:
validatedByin interfaceGuardrailResult<OutputGuardrailResult>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
failures
Returns the value of thefailuresrecord component.- Specified by:
failuresin interfaceGuardrailResult<OutputGuardrailResult>- Returns:
- the value of the
failuresrecord component
-