Record Class InputGuardrailParams
java.lang.Object
java.lang.Record
io.quarkiverse.langchain4j.guardrails.InputGuardrailParams
- Record Components:
userMessage
- the user message, cannot benull
memory
- the memory, can benull
or emptyaugmentationResult
- the augmentation result, can benull
userMessageTemplate
- the user message template, cannot benull
variables
- the variable to be used with userMessageTemplate, cannot benull
- 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.
Represents the parameter passed to
InputGuardrail.validate(InputGuardrailParams)
.-
Constructor Summary
ConstructorsConstructorDescriptionInputGuardrailParams
(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 aInputGuardrailParams
record class. -
Method Summary
Modifier and TypeMethodDescriptiondev.langchain4j.rag.AugmentationResult
Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of theaugmentationResult
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.static InputGuardrailParams
from
(dev.langchain4j.data.message.UserMessage userMessage) Deprecated, for removal: This API element is subject to removal in a future version.static InputGuardrailParams
Deprecated, for removal: This API element is subject to removal in a future version.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.dev.langchain4j.memory.ChatMemory
memory()
Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of thememory
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
toString()
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 theuserMessage
record component.Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of theuserMessageTemplate
record component.Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of thevariables
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.
-
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 aInputGuardrailParams
record class.- Parameters:
userMessage
- the value for theuserMessage
record componentmemory
- the value for thememory
record componentaugmentationResult
- the value for theaugmentationResult
record componentuserMessageTemplate
- the value for theuserMessageTemplate
record componentvariables
- the value for thevariables
record component
-
-
Method Details
-
from
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
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 interfaceGuardrailParams
- 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
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. -
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. -
equals
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 withObjects::equals(Object,Object)
. -
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 theuserMessage
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 thememory
record component.- Specified by:
memory
in interfaceGuardrailParams
- 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 theaugmentationResult
record component.- Specified by:
augmentationResult
in interfaceGuardrailParams
- Returns:
- the value of the
augmentationResult
record component
-
userMessageTemplate
Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of theuserMessageTemplate
record component.- Returns:
- the value of the
userMessageTemplate
record component
-
variables
-
InputGuardrailRequest
instead