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>

@Deprecated(forRemoval=true) public record OutputGuardrailResult(GuardrailResult.Result result, String successfulText, Object successfulResult, List<OutputGuardrailResult.Failure> failures) extends Record implements GuardrailResult<OutputGuardrailResult>
Deprecated, for removal: This API element is subject to removal in a future version.
Use OutputGuardrailResult instead
The result of the validation of an OutputGuardrail
  • Constructor Details

    • OutputGuardrailResult

      public OutputGuardrailResult(GuardrailResult.Result result, String successfulText, Object successfulResult, List<OutputGuardrailResult.Failure> failures)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an instance of a OutputGuardrailResult record class.
      Parameters:
      result - the value for the result record component
      successfulText - the value for the successfulText record component
      successfulResult - the value for the successfulResult record component
      failures - the value for the failures record component
  • Method Details

    • success

      public static OutputGuardrailResult success()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • successWith

      public static OutputGuardrailResult successWith(String successfulText)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • successWith

      public static OutputGuardrailResult successWith(String successfulText, Object successfulResult)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • failure

      public static OutputGuardrailResult failure(List<? extends GuardrailResult.Failure> failures)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getResult

      public GuardrailResult.Result getResult()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getResult in interface GuardrailResult<OutputGuardrailResult>
    • isRetry

      public boolean isRetry()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • blockRetry

      public OutputGuardrailResult blockRetry()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      blockRetry in interface GuardrailResult<OutputGuardrailResult>
    • getReprompt

      public String getReprompt()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • isFatal

      public boolean isFatal()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      isFatal in interface GuardrailResult<OutputGuardrailResult>
    • validatedBy

      public OutputGuardrailResult validatedBy(Class<? extends Guardrail> guardrailClass)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      validatedBy in interface GuardrailResult<OutputGuardrailResult>
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • result

      public GuardrailResult.Result result()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the result record component.
      Returns:
      the value of the result record component
    • successfulText

      public String successfulText()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the successfulText record component.
      Specified by:
      successfulText in interface GuardrailResult<OutputGuardrailResult>
      Returns:
      the value of the successfulText record component
    • successfulResult

      public Object successfulResult()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the successfulResult record component.
      Specified by:
      successfulResult in interface GuardrailResult<OutputGuardrailResult>
      Returns:
      the value of the successfulResult record component
    • failures

      public List<OutputGuardrailResult.Failure> failures()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the failures record component.
      Specified by:
      failures in interface GuardrailResult<OutputGuardrailResult>
      Returns:
      the value of the failures record component