AxBalancerRoutingEvent Generated TypeScript API reference. typescript api api/reference build/apidocs/TypeAlias.AxBalancerRoutingEvent.md type AxBalancerRoutingEvent

AxBalancerRoutingEvent

TypeScript
type AxBalancerRoutingEvent = Readonly<{
  logicalModel: string;
  namespace: string;
  slice: string;
}> & 
  | Readonly<{
  candidates: readonly AxBalancerCandidateScore[];
  type: "ranked";
}>
  | Readonly<{
  attempt: number;
  routeKey: string;
  serviceName: string;
  type: "selected";
}>
  | Readonly<{
  fromRouteKey: string;
  reason: AxBalancerFailureReason;
  status: number | undefined;
  toRouteKey: string | undefined;
  type: "fallback";
}>
  | Readonly<{
  latencyMs: number | undefined;
  outcome: AxBalancerStatsObservation["outcome"];
  reason:   | AxBalancerFailureReason
     | undefined;
  routeKey: string;
  serviceName: string;
  status: number | undefined;
  streaming: boolean;
  type: "observation";
}>
  | Readonly<{
  errorType: string;
  operation: "get" | "observe";
  routeKey: string;
  type: "store-error";
}>;

Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/ai/balance_adaptive.ts#L127

Prompt-free adaptive routing telemetry.

Events intentionally contain no chat request, response, or raw provider error. Callback failures never affect routing.

Docs