AxBalancerAdaptiveStrategy
type AxBalancerAdaptiveStrategy<TModelKey> = Readonly<{
badOutcomeCost: number;
deadlineMs: number;
estimateCost?: (context: AxBalancerCostContext<TModelKey>) => number;
expectedTokens?: AxBalancerExpectedTokens;
namespace?: string;
onRoutingEvent?: (event: AxBalancerRoutingEvent) => void | Promise<void>;
routeKey?: (service: AxAIService<unknown, unknown, TModelKey>, serviceIndex: number) => string;
slice?: (context: AxBalancerRoutingContext<TModelKey>) => string;
statsStore?: AxBalancerStatsStore;
type: "adaptive";
}>;Opt-in adaptive provider-routing strategy for AxBalancer.
Type Parameters
| Type Parameter | Default type |
|---|---|
TModelKey | string |