Record Class DefaultInputGuardrailExecutedEvent

java.lang.Object
java.lang.Record
io.quarkiverse.langchain4j.audit.internal.DefaultInputGuardrailExecutedEvent
All Implemented Interfaces:
GuardrailExecutedEvent<InputGuardrailParams,InputGuardrailResult,InputGuardrail>, InputGuardrailExecutedEvent, LLMInteractionEvent

public record DefaultInputGuardrailExecutedEvent(AuditSourceInfo sourceInfo, InputGuardrailParams params, InputGuardrailResult result, Class<InputGuardrail> guardrailClass) extends Record implements InputGuardrailExecutedEvent
  • Constructor Details

    • DefaultInputGuardrailExecutedEvent

      public DefaultInputGuardrailExecutedEvent(AuditSourceInfo sourceInfo, InputGuardrailParams params, InputGuardrailResult result, Class<InputGuardrail> guardrailClass)
      Creates an instance of a DefaultInputGuardrailExecutedEvent record class.
      Parameters:
      sourceInfo - the value for the sourceInfo record component
      params - the value for the params record component
      result - the value for the result record component
      guardrailClass - the value for the guardrailClass record component
  • Method Details

    • rewrittenUserMessage

      public dev.langchain4j.data.message.UserMessage rewrittenUserMessage()
      Description copied from interface: InputGuardrailExecutedEvent
      Retrieves a rewritten user message if a successful rewritten result exists. If the result contains a rewritten message, it constructs a new user message with the rewritten text; otherwise, it returns the original user message.
      Specified by:
      rewrittenUserMessage in interface InputGuardrailExecutedEvent
      Returns:
      The rewritten user message if a rewritten result exists; otherwise, the original user message.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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.
    • sourceInfo

      public AuditSourceInfo sourceInfo()
      Returns the value of the sourceInfo record component.
      Specified by:
      sourceInfo in interface LLMInteractionEvent
      Returns:
      the value of the sourceInfo record component
    • params

      public InputGuardrailParams params()
      Returns the value of the params record component.
      Specified by:
      params in interface GuardrailExecutedEvent<InputGuardrailParams,InputGuardrailResult,InputGuardrail>
      Returns:
      the value of the params record component
    • result

      public InputGuardrailResult result()
      Returns the value of the result record component.
      Specified by:
      result in interface GuardrailExecutedEvent<InputGuardrailParams,InputGuardrailResult,InputGuardrail>
      Returns:
      the value of the result record component
    • guardrailClass

      public Class<InputGuardrail> guardrailClass()
      Returns the value of the guardrailClass record component.
      Specified by:
      guardrailClass in interface GuardrailExecutedEvent<InputGuardrailParams,InputGuardrailResult,InputGuardrail>
      Returns:
      the value of the guardrailClass record component