FallbackChain class

Executes a request through a chain of providers with automatic fallback.

If the first provider fails with a retryable error, the next provider in the chain is tried automatically.

Constructors

FallbackChain({required List<AIProvider> providers, required Map<String, CircuitBreaker> circuitBreakers})

Properties

circuitBreakers Map<String, CircuitBreaker>
Circuit breakers for health tracking.
final
hashCode int
The hash code for this object.
no setterinherited
providers List<AIProvider>
Ordered list of providers to try.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

execute<T>(Future<T> action(AIProvider provider)) Future<T>
Executes action with automatic fallback to the next provider on failure.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited