Package com.tnsai.quality.slo
Record Class DegradationPolicy.RouteToFallback
java.lang.Object
java.lang.Record
com.tnsai.quality.slo.DegradationPolicy.RouteToFallback
- All Implemented Interfaces:
DegradationPolicy
- Enclosing interface:
DegradationPolicy
public static record DegradationPolicy.RouteToFallback(String fallbackTargetId)
extends Record
implements DegradationPolicy
Switch the agent to a cheaper / simpler LLM target identified by
its provider qualifier (e.g.
"openai/gpt-4o-mini"). The
actual switch happens in the hook layer; this record only carries
the identifier so the policy stays serializable + side-effect-free.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tnsai.quality.slo.DegradationPolicy
DegradationPolicy.DisableFeature, DegradationPolicy.NoDegradation, DegradationPolicy.RefuseNewWork, DegradationPolicy.RouteToFallback, DegradationPolicy.ShedLowPriorityLoad -
Constructor Summary
ConstructorsConstructorDescriptionRouteToFallback(String fallbackTargetId) Creates an instance of aRouteToFallbackrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefallbackTargetIdrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RouteToFallback
Creates an instance of aRouteToFallbackrecord class.- Parameters:
fallbackTargetId- the value for thefallbackTargetIdrecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
fallbackTargetId
Returns the value of thefallbackTargetIdrecord component.- Returns:
- the value of the
fallbackTargetIdrecord component
-