Package akka.javasdk.ledger
Record Class GuardrailDecisionRecord
- Record Components:
recordId- the globally unique id of the recordagentComponentId- the component id of the agent the guardrail ran forinteractionId- the id of the interaction the guardrail ran insessionId- the session id of the interactionflowId- the flow the interaction belongs to, or empty when it belongs to nonename- the name of the guardrailcontrolId- the control id the service declares for the guardrail, or empty when it declares nonecategory- the category of the guardrailboundary- where in the interaction the guardrail randecision- what the guardrail decidedexplanation- the explanation the guardrail gave for its decision, or the failure message when the decision isGuardrailDecisionRecord.Decision.FAILreportOnly- true when the guardrail only reports and the interaction continues regardless of the decisionfailMode- what the runtime does when the guardrail fails to decide, without effect whenreportOnlyis trueduration- how long the guardrail took to decidetoolCall- the tool call the guardrail decided on, or empty when it decided on nonetimestamp- when the decision was recorded
- All Implemented Interfaces:
FlowRecord
public record GuardrailDecisionRecord(String recordId, String agentComponentId, String interactionId, String sessionId, Optional<String> flowId, String name, Optional<String> controlId, String category, GuardrailDecisionRecord.Boundary boundary, GuardrailDecisionRecord.Decision decision, String explanation, boolean reportOnly, GuardrailDecisionRecord.FailMode failMode, Duration duration, Optional<GuardrailDecisionRecord.ToolCall> toolCall, Instant timestamp)
extends Record
implements FlowRecord
The record of one guardrail decision, as fetched from the ledger.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhere in an interaction a guardrail ran.static enumWhat a guardrail decided.static enumWhat the runtime does when a guardrail fails to decide.static final recordThe tool call a guardrail decided on.static interfaceWhere the tool of a guardrail decision runs. -
Constructor Summary
ConstructorsConstructorDescriptionGuardrailDecisionRecord(String recordId, String agentComponentId, String interactionId, String sessionId, Optional<String> flowId, String name, Optional<String> controlId, String category, GuardrailDecisionRecord.Boundary boundary, GuardrailDecisionRecord.Decision decision, String explanation, boolean reportOnly, GuardrailDecisionRecord.FailMode failMode, Duration duration, Optional<GuardrailDecisionRecord.ToolCall> toolCall, Instant timestamp) Creates an instance of aGuardrailDecisionRecordrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theagentComponentIdrecord component.boundary()Returns the value of theboundaryrecord component.category()Returns the value of thecategoryrecord component.Returns the value of thecontrolIdrecord component.decision()Returns the value of thedecisionrecord component.duration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexplanationrecord component.failMode()Returns the value of thefailModerecord component.flowId()Returns the value of theflowIdrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theinteractionIdrecord component.name()Returns the value of thenamerecord component.recordId()Returns the value of therecordIdrecord component.booleanReturns the value of thereportOnlyrecord component.Returns the value of thesessionIdrecord component.Returns the value of thetimestamprecord component.toolCall()Returns the value of thetoolCallrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
GuardrailDecisionRecord
public GuardrailDecisionRecord(String recordId, String agentComponentId, String interactionId, String sessionId, Optional<String> flowId, String name, Optional<String> controlId, String category, GuardrailDecisionRecord.Boundary boundary, GuardrailDecisionRecord.Decision decision, String explanation, boolean reportOnly, GuardrailDecisionRecord.FailMode failMode, Duration duration, Optional<GuardrailDecisionRecord.ToolCall> toolCall, Instant timestamp) Creates an instance of aGuardrailDecisionRecordrecord class.- Parameters:
recordId- the value for therecordIdrecord componentagentComponentId- the value for theagentComponentIdrecord componentinteractionId- the value for theinteractionIdrecord componentsessionId- the value for thesessionIdrecord componentflowId- the value for theflowIdrecord componentname- the value for thenamerecord componentcontrolId- the value for thecontrolIdrecord componentcategory- the value for thecategoryrecord componentboundary- the value for theboundaryrecord componentdecision- the value for thedecisionrecord componentexplanation- the value for theexplanationrecord componentreportOnly- the value for thereportOnlyrecord componentfailMode- the value for thefailModerecord componentduration- the value for thedurationrecord componenttoolCall- the value for thetoolCallrecord componenttimestamp- the value for thetimestamprecord component
-
-
Method Details
-
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. -
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. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
recordId
Returns the value of therecordIdrecord component.- Returns:
- the value of the
recordIdrecord component
-
agentComponentId
Returns the value of theagentComponentIdrecord component.- Returns:
- the value of the
agentComponentIdrecord component
-
interactionId
Returns the value of theinteractionIdrecord component.- Returns:
- the value of the
interactionIdrecord component
-
sessionId
Returns the value of thesessionIdrecord component.- Returns:
- the value of the
sessionIdrecord component
-
flowId
Returns the value of theflowIdrecord component.- Returns:
- the value of the
flowIdrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
controlId
Returns the value of thecontrolIdrecord component.- Returns:
- the value of the
controlIdrecord component
-
category
Returns the value of thecategoryrecord component.- Returns:
- the value of the
categoryrecord component
-
boundary
Returns the value of theboundaryrecord component.- Returns:
- the value of the
boundaryrecord component
-
decision
Returns the value of thedecisionrecord component.- Returns:
- the value of the
decisionrecord component
-
explanation
Returns the value of theexplanationrecord component.- Returns:
- the value of the
explanationrecord component
-
reportOnly
public boolean reportOnly()Returns the value of thereportOnlyrecord component.- Returns:
- the value of the
reportOnlyrecord component
-
failMode
Returns the value of thefailModerecord component.- Returns:
- the value of the
failModerecord component
-
duration
Returns the value of thedurationrecord component.- Returns:
- the value of the
durationrecord component
-
toolCall
Returns the value of thetoolCallrecord component.- Returns:
- the value of the
toolCallrecord component
-
timestamp
Returns the value of thetimestamprecord component.- Specified by:
timestampin interfaceFlowRecord- Returns:
- the value of the
timestamprecord component
-