Record Class InputGuardrailParams

java.lang.Object
java.lang.Record
io.quarkiverse.langchain4j.guardrails.InputGuardrailParams
Record Components:
userMessage - the user message, cannot be null
memory - the memory, can be null or empty
augmentationResult - the augmentation result, can be null
userMessageTemplate - the user message template, cannot be null
variables - the variable to be used with userMessageTemplate, cannot be null
All Implemented Interfaces:
GuardrailParams

@Deprecated(forRemoval=true) public record InputGuardrailParams(dev.langchain4j.data.message.UserMessage userMessage, dev.langchain4j.memory.ChatMemory memory, dev.langchain4j.rag.AugmentationResult augmentationResult, String userMessageTemplate, Map<String,Object> variables) extends Record implements GuardrailParams
Deprecated, for removal: This API element is subject to removal in a future version.
Use InputGuardrailRequest instead
Represents the parameter passed to InputGuardrail.validate(InputGuardrailParams).
  • Constructor Summary

    Constructors
    Constructor
    Description
    InputGuardrailParams(dev.langchain4j.data.message.UserMessage userMessage, dev.langchain4j.memory.ChatMemory memory, dev.langchain4j.rag.AugmentationResult augmentationResult, String userMessageTemplate, Map<String,Object> variables)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates an instance of a InputGuardrailParams record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    dev.langchain4j.rag.AugmentationResult
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the value of the augmentationResult record component.
    final boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Indicates whether some other object is "equal to" this one.
    from(dev.langchain4j.data.message.UserMessage userMessage)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    from(dev.langchain4j.data.message.UserMessage userMessage, Map<String,Object> variables)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns a hash code value for this object.
    dev.langchain4j.memory.ChatMemory
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the value of the memory record component.
    static dev.langchain4j.data.message.UserMessage
    rewriteUserMessage(dev.langchain4j.data.message.UserMessage userMessage, String text)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns a string representation of this record class.
    dev.langchain4j.data.message.UserMessage
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the value of the userMessage record component.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the value of the userMessageTemplate record component.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the value of the variables record component.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Recreate this guardrail param with the given input or output text.

    Methods inherited from class java.lang.Object

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

    • InputGuardrailParams

      public InputGuardrailParams(dev.langchain4j.data.message.UserMessage userMessage, dev.langchain4j.memory.ChatMemory memory, dev.langchain4j.rag.AugmentationResult augmentationResult, String userMessageTemplate, Map<String,Object> variables)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an instance of a InputGuardrailParams record class.
      Parameters:
      userMessage - the value for the userMessage record component
      memory - the value for the memory record component
      augmentationResult - the value for the augmentationResult record component
      userMessageTemplate - the value for the userMessageTemplate record component
      variables - the value for the variables record component
  • Method Details

    • from

      public static InputGuardrailParams from(dev.langchain4j.data.message.UserMessage userMessage)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • from

      public static InputGuardrailParams from(dev.langchain4j.data.message.UserMessage userMessage, Map<String,Object> variables)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • withText

      public InputGuardrailParams withText(String text)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: GuardrailParams
      Recreate this guardrail param with the given input or output text.
      Specified by:
      withText in interface GuardrailParams
      Parameters:
      text - The text of the rewritten param.
      Returns:
      A clone of this guardrail params with the given input or output text.
    • rewriteUserMessage

      public static dev.langchain4j.data.message.UserMessage rewriteUserMessage(dev.langchain4j.data.message.UserMessage userMessage, String text)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • toString

      public final 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.
    • userMessage

      public dev.langchain4j.data.message.UserMessage userMessage()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the userMessage record component.
      Returns:
      the value of the userMessage record component
    • memory

      public dev.langchain4j.memory.ChatMemory memory()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the augmentationResult record component.
      Specified by:
      augmentationResult in interface GuardrailParams
      Returns:
      the value of the augmentationResult record component
    • userMessageTemplate

      public String userMessageTemplate()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the userMessageTemplate record component.
      Returns:
      the value of the userMessageTemplate record component
    • variables

      public Map<String,Object> variables()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the variables record component.
      Returns:
      the value of the variables record component