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 Summary
ConstructorsConstructorDescriptionDefaultInputGuardrailExecutedEvent(AuditSourceInfo sourceInfo, InputGuardrailParams params, InputGuardrailResult result, Class<InputGuardrail> guardrailClass) Creates an instance of aDefaultInputGuardrailExecutedEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theguardrailClassrecord component.final inthashCode()Returns a hash code value for this object.params()Returns the value of theparamsrecord component.result()Returns the value of theresultrecord component.dev.langchain4j.data.message.UserMessageRetrieves a rewritten user message if a successful rewritten result exists.Returns the value of thesourceInforecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DefaultInputGuardrailExecutedEvent
public DefaultInputGuardrailExecutedEvent(AuditSourceInfo sourceInfo, InputGuardrailParams params, InputGuardrailResult result, Class<InputGuardrail> guardrailClass) Creates an instance of aDefaultInputGuardrailExecutedEventrecord class.- Parameters:
sourceInfo- the value for thesourceInforecord componentparams- the value for theparamsrecord componentresult- the value for theresultrecord componentguardrailClass- the value for theguardrailClassrecord component
-
-
Method Details
-
rewrittenUserMessage
public dev.langchain4j.data.message.UserMessage rewrittenUserMessage()Description copied from interface:InputGuardrailExecutedEventRetrieves 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:
rewrittenUserMessagein interfaceInputGuardrailExecutedEvent- Returns:
- The rewritten user message if a rewritten result exists; otherwise, the original user message.
-
toString
-
hashCode
-
equals
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). -
sourceInfo
Returns the value of thesourceInforecord component.- Specified by:
sourceInfoin interfaceLLMInteractionEvent- Returns:
- the value of the
sourceInforecord component
-
params
Returns the value of theparamsrecord component.- Specified by:
paramsin interfaceGuardrailExecutedEvent<InputGuardrailParams,InputGuardrailResult, InputGuardrail> - Returns:
- the value of the
paramsrecord component
-
result
Returns the value of theresultrecord component.- Specified by:
resultin interfaceGuardrailExecutedEvent<InputGuardrailParams,InputGuardrailResult, InputGuardrail> - Returns:
- the value of the
resultrecord component
-
guardrailClass
Returns the value of theguardrailClassrecord component.- Specified by:
guardrailClassin interfaceGuardrailExecutedEvent<InputGuardrailParams,InputGuardrailResult, InputGuardrail> - Returns:
- the value of the
guardrailClassrecord component
-