Record Class OutputGuardrailParams

java.lang.Object
java.lang.Record
io.quarkiverse.langchain4j.guardrails.OutputGuardrailParams
Record Components:
responseFromLLM - the response from the LLM
memory - the memory, can be null or empty
augmentationResult - the augmentation result, can be null
All Implemented Interfaces:
GuardrailParams

public record OutputGuardrailParams(dev.langchain4j.data.message.AiMessage responseFromLLM, dev.langchain4j.memory.ChatMemory memory, dev.langchain4j.rag.AugmentationResult augmentationResult) extends Record implements GuardrailParams
Represents the parameter passed to OutputGuardrail.validate(OutputGuardrailParams).
  • Constructor Summary

    Constructors
    Constructor
    Description
    OutputGuardrailParams(dev.langchain4j.data.message.AiMessage responseFromLLM, dev.langchain4j.memory.ChatMemory memory, dev.langchain4j.rag.AugmentationResult augmentationResult)
    Creates an instance of a OutputGuardrailParams record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    dev.langchain4j.rag.AugmentationResult
    Returns the value of the augmentationResult record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    dev.langchain4j.memory.ChatMemory
    Returns the value of the memory record component.
    dev.langchain4j.data.message.AiMessage
    Returns the value of the responseFromLLM record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • OutputGuardrailParams

      public OutputGuardrailParams(dev.langchain4j.data.message.AiMessage responseFromLLM, dev.langchain4j.memory.ChatMemory memory, dev.langchain4j.rag.AugmentationResult augmentationResult)
      Creates an instance of a OutputGuardrailParams record class.
      Parameters:
      responseFromLLM - the value for the responseFromLLM record component
      memory - the value for the memory record component
      augmentationResult - the value for the augmentationResult record component
  • Method Details

    • 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.
    • responseFromLLM

      public dev.langchain4j.data.message.AiMessage responseFromLLM()
      Returns the value of the responseFromLLM record component.
      Returns:
      the value of the responseFromLLM record component
    • memory

      public dev.langchain4j.memory.ChatMemory memory()
      Returns the value of the memory record component.
      Specified by:
      memory in interface GuardrailParams
      Returns:
      the value of the memory record component
    • augmentationResult

      public dev.langchain4j.rag.AugmentationResult augmentationResult()
      Returns the value of the augmentationResult record component.
      Specified by:
      augmentationResult in interface GuardrailParams
      Returns:
      the value of the augmentationResult record component