Package com.tnsai.quality.redaction
Record Class RedactionContext
java.lang.Object
java.lang.Record
com.tnsai.quality.redaction.RedactionContext
- Record Components:
eventContext- framework event context (tenant, agent, capability…)scope- which sink is asking for redactiontenantPolicyId- optional named policy override; empty means "use whatever the redactor's default is"
public record RedactionContext(com.tnsai.observability.events.EventContext eventContext, RedactionScope scope, Optional<String> tenantPolicyId)
extends Record
Per-call context handed to a
Redactor (issue #80).
Lets a redactor pick policy based on which sink is calling
(RedactionScope), which tenant the event belongs to
(carried inside eventContext), and which named tenant
policy was in effect (tenantPolicyId). The redactor
itself stays stateless — context flows in per call.
- Since:
- 0.5.0 (issue #80)
-
Constructor Summary
ConstructorsConstructorDescriptionRedactionContext(com.tnsai.observability.events.EventContext eventContext, RedactionScope scope, Optional<String> tenantPolicyId) Creates an instance of aRedactionContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.com.tnsai.observability.events.EventContextReturns the value of theeventContextrecord component.final inthashCode()Returns a hash code value for this object.static RedactionContextllmPrompt(com.tnsai.observability.events.EventContext eventContext) Convenience: context for anRedactionScope.LLM_PROMPTcall with default policy.static RedactionContextllmResponse(com.tnsai.observability.events.EventContext eventContext) Convenience: context for anRedactionScope.LLM_RESPONSEcall with default policy.static RedactionContextlogAttr(com.tnsai.observability.events.EventContext eventContext) Convenience: context for aRedactionScope.LOG_ATTRcall with default policy.scope()Returns the value of thescoperecord component.Returns the value of thetenantPolicyIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RedactionContext
public RedactionContext(com.tnsai.observability.events.EventContext eventContext, RedactionScope scope, Optional<String> tenantPolicyId) Creates an instance of aRedactionContextrecord class.- Parameters:
eventContext- the value for theeventContextrecord componentscope- the value for thescoperecord componenttenantPolicyId- the value for thetenantPolicyIdrecord component
-
-
Method Details
-
logAttr
Convenience: context for aRedactionScope.LOG_ATTRcall with default policy. -
llmPrompt
Convenience: context for anRedactionScope.LLM_PROMPTcall with default policy. -
llmResponse
public static RedactionContext llmResponse(com.tnsai.observability.events.EventContext eventContext) Convenience: context for anRedactionScope.LLM_RESPONSEcall with default policy. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
eventContext
public com.tnsai.observability.events.EventContext eventContext()Returns the value of theeventContextrecord component.- Returns:
- the value of the
eventContextrecord component
-
scope
Returns the value of thescoperecord component.- Returns:
- the value of the
scoperecord component
-
tenantPolicyId
Returns the value of thetenantPolicyIdrecord component.- Returns:
- the value of the
tenantPolicyIdrecord component
-