@ax-llm/ax 21.0.0 → 21.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -82,7 +82,10 @@ declare class AxMemory implements AxAIMemory {
82
82
  } | {
83
83
  type: "audio";
84
84
  data: string;
85
- format?: "wav" | "mp3" | "ogg";
85
+ format?: AxAudioFormat;
86
+ mimeType?: string;
87
+ sampleRate?: number;
88
+ channels?: number;
86
89
  cache?: boolean;
87
90
  transcription?: string;
88
91
  duration?: number;
@@ -123,6 +126,10 @@ declare class AxMemory implements AxAIMemory {
123
126
  }[];
124
127
  thought?: string;
125
128
  thoughtBlocks?: AxThoughtBlockItem[];
129
+ audio?: {
130
+ id: string;
131
+ transcript?: string;
132
+ };
126
133
  cache?: boolean;
127
134
  } | {
128
135
  role: "function";
@@ -1561,7 +1568,10 @@ declare class AxPromptTemplate {
1561
1568
  } | {
1562
1569
  type: "audio";
1563
1570
  data: string;
1564
- format?: "wav" | "mp3" | "ogg";
1571
+ format?: AxAudioFormat;
1572
+ mimeType?: string;
1573
+ sampleRate?: number;
1574
+ channels?: number;
1565
1575
  cache?: boolean;
1566
1576
  transcription?: string;
1567
1577
  duration?: number;
@@ -1623,7 +1633,15 @@ interface TypeMap {
1623
1633
  boolean: boolean;
1624
1634
  json: any;
1625
1635
  date: Date;
1636
+ dateRange: {
1637
+ start: Date;
1638
+ end: Date;
1639
+ };
1626
1640
  datetime: Date;
1641
+ datetimeRange: {
1642
+ start: Date;
1643
+ end: Date;
1644
+ };
1627
1645
  image: {
1628
1646
  mimeType: string;
1629
1647
  data: string;
@@ -2220,6 +2238,43 @@ declare class AxContentProcessingError extends Error {
2220
2238
  toString(): string;
2221
2239
  }
2222
2240
 
2241
+ type AxAudioFormat = 'wav' | 'mp3' | 'flac' | 'opus' | 'aac' | 'pcm16' | 'pcm' | 'ogg';
2242
+ type AxChatAudioConfig = {
2243
+ input?: {
2244
+ format?: AxAudioFormat;
2245
+ mimeType?: string;
2246
+ sampleRate?: number;
2247
+ channels?: number;
2248
+ };
2249
+ output?: {
2250
+ enabled?: boolean;
2251
+ voice?: string | {
2252
+ id: string;
2253
+ };
2254
+ format?: AxAudioFormat;
2255
+ mimeType?: string;
2256
+ sampleRate?: number;
2257
+ channels?: number;
2258
+ includeTranscript?: boolean;
2259
+ };
2260
+ live?: {
2261
+ turnTimeoutMs?: number;
2262
+ enableAffectiveDialog?: boolean;
2263
+ proactiveAudio?: boolean;
2264
+ };
2265
+ };
2266
+ type AxChatAudioOutput = {
2267
+ data: string;
2268
+ id?: string;
2269
+ mimeType?: string;
2270
+ format?: AxAudioFormat;
2271
+ transcript?: string;
2272
+ expiresAt?: number;
2273
+ sampleRate?: number;
2274
+ channels?: number;
2275
+ isDelta?: boolean;
2276
+ };
2277
+
2223
2278
  interface AxAIFeatures {
2224
2279
  functions: boolean;
2225
2280
  streaming: boolean;
@@ -2249,6 +2304,17 @@ interface AxAIFeatures {
2249
2304
  formats: string[];
2250
2305
  /** Maximum audio duration in seconds */
2251
2306
  maxDuration?: number;
2307
+ /** Audio output capabilities for conversational audio models */
2308
+ output?: {
2309
+ /** Whether the provider supports generated audio responses */
2310
+ supported: boolean;
2311
+ /** Supported generated audio formats */
2312
+ formats: string[];
2313
+ /** Default output sample rate, when fixed by the provider */
2314
+ sampleRate?: number;
2315
+ /** Known built-in voice names, when enumerable */
2316
+ voices?: string[];
2317
+ };
2252
2318
  };
2253
2319
  /** File processing capabilities */
2254
2320
  files: {
@@ -2317,6 +2383,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
2317
2383
  private customLabels?;
2318
2384
  private contextCache?;
2319
2385
  private beta?;
2386
+ private includeRequestBodyInErrors?;
2320
2387
  private modelInfo;
2321
2388
  private modelUsage?;
2322
2389
  private embedModelUsage?;
@@ -2461,6 +2528,10 @@ type AxModelInfo = {
2461
2528
  temperature?: boolean;
2462
2529
  topP?: boolean;
2463
2530
  };
2531
+ audio?: {
2532
+ input?: boolean;
2533
+ output?: boolean;
2534
+ };
2464
2535
  maxTokens?: number;
2465
2536
  isExpensive?: boolean;
2466
2537
  contextWindow?: number;
@@ -2587,6 +2658,8 @@ type AxModelConfig = {
2587
2658
  * you to display partial results as they're generated.
2588
2659
  */
2589
2660
  stream?: boolean;
2661
+ /** Conversational audio input/output configuration for chat models. */
2662
+ audio?: AxChatAudioConfig;
2590
2663
  /**
2591
2664
  * Number of completions to generate for each prompt.
2592
2665
  *
@@ -2653,6 +2726,7 @@ type AxChatResponseResult = {
2653
2726
  thoughtBlocks?: AxThoughtBlockItem[];
2654
2727
  name?: string;
2655
2728
  id?: string;
2729
+ audio?: AxChatAudioOutput;
2656
2730
  functionCalls?: {
2657
2731
  id: string;
2658
2732
  type: 'function';
@@ -2736,7 +2810,10 @@ type AxChatRequest<TModel = string> = {
2736
2810
  } | {
2737
2811
  type: 'audio';
2738
2812
  data: string;
2739
- format?: 'wav' | 'mp3' | 'ogg';
2813
+ format?: AxAudioFormat;
2814
+ mimeType?: string;
2815
+ sampleRate?: number;
2816
+ channels?: number;
2740
2817
  cache?: boolean;
2741
2818
  /** Pre-transcribed text content for fallback */
2742
2819
  transcription?: string;
@@ -2796,6 +2873,11 @@ type AxChatRequest<TModel = string> = {
2796
2873
  thought?: string;
2797
2874
  /** Array of thinking blocks, each with its own signature */
2798
2875
  thoughtBlocks?: AxThoughtBlockItem[];
2876
+ /** Previous assistant audio response reference for audio-capable chat models */
2877
+ audio?: {
2878
+ id: string;
2879
+ transcript?: string;
2880
+ };
2799
2881
  cache?: boolean;
2800
2882
  } | {
2801
2883
  role: 'function';
@@ -2810,6 +2892,8 @@ type AxChatRequest<TModel = string> = {
2810
2892
  requiresImages?: boolean;
2811
2893
  /** Whether the request requires audio support */
2812
2894
  requiresAudio?: boolean;
2895
+ /** Whether the request requires generated audio responses */
2896
+ requiresAudioOutput?: boolean;
2813
2897
  /** Whether the request requires file support */
2814
2898
  requiresFiles?: boolean;
2815
2899
  /** Whether the request requires web search capabilities */
@@ -3084,6 +3168,8 @@ type AxAIServiceOptions = {
3084
3168
  rateLimiter?: AxRateLimiterFunction;
3085
3169
  /** Custom fetch implementation (useful for proxies or custom HTTP handling). */
3086
3170
  fetch?: typeof fetch;
3171
+ /** Custom WebSocket constructor for providers that use realtime WebSocket transports. */
3172
+ webSocket?: any;
3087
3173
  /** OpenTelemetry tracer for distributed tracing. */
3088
3174
  tracer?: Tracer;
3089
3175
  /** OpenTelemetry meter for metrics collection. */
@@ -3220,6 +3306,16 @@ type AxAIServiceOptions = {
3220
3306
  * @example { environment: 'production', feature: 'search' }
3221
3307
  */
3222
3308
  customLabels?: Record<string, string>;
3309
+ /**
3310
+ * Whether to include the request body in `AxAIServiceError` messages.
3311
+ *
3312
+ * When `false`, the request body is omitted from thrown errors. Useful when
3313
+ * requests may contain sensitive data (API keys, PII) or large base64-encoded
3314
+ * content that would bloat error logs.
3315
+ *
3316
+ * @default true
3317
+ */
3318
+ includeRequestBodyInErrors?: boolean;
3223
3319
  };
3224
3320
  interface AxAIService<TModel = unknown, TEmbedModel = unknown, TModelKey = string> {
3225
3321
  getId(): string;
@@ -3368,7 +3464,7 @@ interface AxFieldOptions {
3368
3464
  */
3369
3465
  type AsRecord<T> = T extends Record<string, any> ? T : Record<string, any>;
3370
3466
  interface AxFieldType {
3371
- readonly type: 'string' | 'number' | 'boolean' | 'json' | 'image' | 'audio' | 'file' | 'url' | 'date' | 'datetime' | 'class' | 'code' | 'object';
3467
+ readonly type: 'string' | 'number' | 'boolean' | 'json' | 'image' | 'audio' | 'file' | 'url' | 'date' | 'dateRange' | 'datetime' | 'datetimeRange' | 'class' | 'code' | 'object';
3372
3468
  readonly isArray?: boolean;
3373
3469
  readonly options?: readonly string[];
3374
3470
  readonly fields?: Record<string, AxFieldType>;
@@ -3560,6 +3656,8 @@ type ValidateNoMediaTypes<TFields> = {
3560
3656
  * - `f.json(desc?)` - Arbitrary JSON objects
3561
3657
  * - `f.datetime(desc?)` - ISO 8601 datetime strings
3562
3658
  * - `f.date(desc?)` - Date in YYYY-MM-DD format
3659
+ * - `f.datetimeRange(desc?)` - `{ start: Date; end: Date }` datetime ranges
3660
+ * - `f.dateRange(desc?)` - `{ start: Date; end: Date }` date ranges
3563
3661
  * - `f.class(options, desc?)` - Classification with predefined choices
3564
3662
  * - `f.image(desc?)` - Image input (multimodal)
3565
3663
  * - `f.audio(desc?)` - Audio input
@@ -3716,6 +3814,14 @@ declare const f: (() => AxSignatureBuilder) & {
3716
3814
  * ```
3717
3815
  */
3718
3816
  datetime: (desc?: string) => AxFluentFieldType<"datetime", false, undefined, false, false, undefined, false>;
3817
+ /**
3818
+ * Creates a datetime range field type.
3819
+ *
3820
+ * Values normalize to `{ start: Date; end: Date }`. Prefer ISO 8601
3821
+ * interval strings such as `2024-01-15T14:30:00Z/2024-01-15T15:30:00Z`
3822
+ * or JSON objects with `start` and `end`.
3823
+ */
3824
+ datetimeRange: (desc?: string) => AxFluentFieldType<"datetimeRange", false, undefined, false, false, undefined, false>;
3719
3825
  /**
3720
3826
  * Creates a date field type for YYYY-MM-DD formatted dates.
3721
3827
  *
@@ -3732,6 +3838,13 @@ declare const f: (() => AxSignatureBuilder) & {
3732
3838
  * ```
3733
3839
  */
3734
3840
  date: (desc?: string) => AxFluentFieldType<"date", false, undefined, false, false, undefined, false>;
3841
+ /**
3842
+ * Creates a date range field type.
3843
+ *
3844
+ * Values normalize to `{ start: Date; end: Date }`. Prefer interval strings
3845
+ * such as `2024-01-15/2024-01-20` or JSON objects with `start` and `end`.
3846
+ */
3847
+ dateRange: (desc?: string) => AxFluentFieldType<"dateRange", false, undefined, false, false, undefined, false>;
3735
3848
  /**
3736
3849
  * Creates a classification field type with predefined options.
3737
3850
  *
@@ -3908,7 +4021,7 @@ interface AxField {
3908
4021
  title?: string;
3909
4022
  description?: string;
3910
4023
  type?: {
3911
- name: 'string' | 'number' | 'boolean' | 'json' | 'image' | 'audio' | 'file' | 'url' | 'date' | 'datetime' | 'class' | 'code' | 'object';
4024
+ name: 'string' | 'number' | 'boolean' | 'json' | 'image' | 'audio' | 'file' | 'url' | 'date' | 'dateRange' | 'datetime' | 'datetimeRange' | 'class' | 'code' | 'object';
3912
4025
  isArray?: boolean;
3913
4026
  options?: string[];
3914
4027
  fields?: Record<string, AxFieldType>;
@@ -3930,7 +4043,11 @@ interface AxField {
3930
4043
  type AxIField = Omit<AxField, 'title'> & {
3931
4044
  title: string;
3932
4045
  };
3933
- type InferFieldValueType<T> = T extends AxFieldType | AxFluentFieldType ? T['type'] extends 'string' ? T['isArray'] extends true ? string[] : string : T['type'] extends 'number' ? T['isArray'] extends true ? number[] : number : T['type'] extends 'boolean' ? T['isArray'] extends true ? boolean[] : boolean : T['type'] extends 'json' ? T['isArray'] extends true ? any[] : any : T['type'] extends 'date' ? T['isArray'] extends true ? Date[] : Date : T['type'] extends 'datetime' ? T['isArray'] extends true ? Date[] : Date : T['type'] extends 'image' ? T['isArray'] extends true ? {
4046
+ type AxDateRangeValue = {
4047
+ start: Date;
4048
+ end: Date;
4049
+ };
4050
+ type InferFieldValueType<T> = T extends AxFieldType | AxFluentFieldType ? T['type'] extends 'string' ? T['isArray'] extends true ? string[] : string : T['type'] extends 'number' ? T['isArray'] extends true ? number[] : number : T['type'] extends 'boolean' ? T['isArray'] extends true ? boolean[] : boolean : T['type'] extends 'json' ? T['isArray'] extends true ? any[] : any : T['type'] extends 'date' ? T['isArray'] extends true ? Date[] : Date : T['type'] extends 'dateRange' ? T['isArray'] extends true ? AxDateRangeValue[] : AxDateRangeValue : T['type'] extends 'datetime' ? T['isArray'] extends true ? Date[] : Date : T['type'] extends 'datetimeRange' ? T['isArray'] extends true ? AxDateRangeValue[] : AxDateRangeValue : T['type'] extends 'image' ? T['isArray'] extends true ? {
3934
4051
  mimeType: string;
3935
4052
  data: string;
3936
4053
  }[] : {
@@ -3979,7 +4096,7 @@ interface AxFluentFieldInfo<TType extends AxFieldType['type'] = AxFieldType['typ
3979
4096
  readonly patternDescription?: string;
3980
4097
  readonly format?: string;
3981
4098
  }
3982
- type InferFluentType<T extends AxFluentFieldInfo<any, any, any, any> | AxFluentFieldType> = T['type'] extends 'string' ? T['isArray'] extends true ? string[] : string : T['type'] extends 'number' ? T['isArray'] extends true ? number[] : number : T['type'] extends 'boolean' ? T['isArray'] extends true ? boolean[] : boolean : T['type'] extends 'json' ? T['isArray'] extends true ? any[] : any : T['type'] extends 'date' ? T['isArray'] extends true ? Date[] : Date : T['type'] extends 'datetime' ? T['isArray'] extends true ? Date[] : Date : T['type'] extends 'image' ? T['isArray'] extends true ? {
4099
+ type InferFluentType<T extends AxFluentFieldInfo<any, any, any, any> | AxFluentFieldType> = T['type'] extends 'string' ? T['isArray'] extends true ? string[] : string : T['type'] extends 'number' ? T['isArray'] extends true ? number[] : number : T['type'] extends 'boolean' ? T['isArray'] extends true ? boolean[] : boolean : T['type'] extends 'json' ? T['isArray'] extends true ? any[] : any : T['type'] extends 'date' ? T['isArray'] extends true ? Date[] : Date : T['type'] extends 'dateRange' ? T['isArray'] extends true ? AxDateRangeValue[] : AxDateRangeValue : T['type'] extends 'datetime' ? T['isArray'] extends true ? Date[] : Date : T['type'] extends 'datetimeRange' ? T['isArray'] extends true ? AxDateRangeValue[] : AxDateRangeValue : T['type'] extends 'image' ? T['isArray'] extends true ? {
3983
4100
  mimeType: string;
3984
4101
  data: string;
3985
4102
  }[] : {
@@ -5868,6 +5985,15 @@ declare class AxAIAnthropic<TModelKey = string> extends AxBaseAI<AxAIAnthropicMo
5868
5985
 
5869
5986
  declare const axModelInfoAnthropic: AxModelInfo[];
5870
5987
 
5988
+ declare const axOpenAIChatAudioDefaults: () => AxChatAudioConfig;
5989
+ declare const axGoogleGeminiLiveAudioDefaults: () => AxChatAudioConfig;
5990
+ declare const axMergeChatAudioConfig: (base?: Readonly<AxChatAudioConfig>, override?: Readonly<AxChatAudioConfig>) => AxChatAudioConfig | undefined;
5991
+ declare const axIsAudioOutputEnabled: (audio?: Readonly<AxChatAudioConfig>) => boolean;
5992
+
5993
+ declare const axAudioMimeType: (format?: AxAudioFormat, sampleRate?: number, fallback?: string) => string;
5994
+ declare const axAudioFormatFromMimeType: (mimeType?: string) => AxAudioFormat | undefined;
5995
+ declare const axConcatBase64: (chunks: readonly string[]) => string;
5996
+
5871
5997
  declare enum AxAIOpenAIModel {
5872
5998
  GPT4 = "gpt-4",
5873
5999
  GPT41 = "gpt-4.1",
@@ -5875,6 +6001,10 @@ declare enum AxAIOpenAIModel {
5875
6001
  GPT41Nano = "gpt-4.1-nano",
5876
6002
  GPT4O = "gpt-4o",
5877
6003
  GPT4OMini = "gpt-4o-mini",
6004
+ GPTAudio = "gpt-audio",
6005
+ GPTAudioMini = "gpt-audio-mini",
6006
+ GPTRealtime2 = "gpt-realtime-2",
6007
+ GPTRealtimeWhisper = "gpt-realtime-whisper",
5878
6008
  GPT4ChatGPT4O = "chatgpt-4o-latest",
5879
6009
  GPT4Turbo = "gpt-4-turbo",
5880
6010
  GPT35Turbo = "gpt-3.5-turbo",
@@ -5959,6 +6089,12 @@ type AxAIOpenAIUsage = {
5959
6089
  prompt_tokens: number;
5960
6090
  completion_tokens: number;
5961
6091
  total_tokens: number;
6092
+ prompt_tokens_details?: {
6093
+ cached_tokens?: number;
6094
+ };
6095
+ completion_tokens_details?: {
6096
+ reasoning_tokens?: number;
6097
+ };
5962
6098
  };
5963
6099
  interface AxAIOpenAIResponseDelta<T> {
5964
6100
  id: string;
@@ -5968,15 +6104,22 @@ interface AxAIOpenAIResponseDelta<T> {
5968
6104
  choices: {
5969
6105
  index: number;
5970
6106
  delta: T;
5971
- finish_reason: 'stop' | 'length' | 'content_filter' | 'tool_calls';
6107
+ finish_reason?: 'stop' | 'length' | 'content_filter' | 'tool_calls' | null;
5972
6108
  }[];
5973
6109
  usage?: AxAIOpenAIUsage;
5974
6110
  system_fingerprint: string;
5975
6111
  }
5976
6112
  type AxAIOpenAIChatRequest<TModel> = {
5977
6113
  model: TModel;
5978
- reasoning_effort?: 'minimal' | 'low' | 'medium' | 'high';
6114
+ reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high';
5979
6115
  store?: boolean;
6116
+ modalities?: readonly ('text' | 'audio')[];
6117
+ audio?: {
6118
+ format: 'wav' | 'mp3' | 'flac' | 'opus' | 'aac' | 'pcm16';
6119
+ voice: string | {
6120
+ id: string;
6121
+ };
6122
+ };
5980
6123
  messages: ({
5981
6124
  role: 'system';
5982
6125
  content: string;
@@ -5995,7 +6138,10 @@ type AxAIOpenAIChatRequest<TModel> = {
5995
6138
  type: 'input_audio';
5996
6139
  input_audio: {
5997
6140
  data: string;
5998
- format?: 'wav';
6141
+ format: 'wav' | 'mp3' | 'pcm16';
6142
+ mimeType?: string;
6143
+ sampleRate?: number;
6144
+ channels?: number;
5999
6145
  };
6000
6146
  } | {
6001
6147
  type: 'file';
@@ -6007,11 +6153,14 @@ type AxAIOpenAIChatRequest<TModel> = {
6007
6153
  name?: string;
6008
6154
  } | {
6009
6155
  role: 'assistant';
6010
- content: string | {
6156
+ content?: string | {
6011
6157
  type: string;
6012
6158
  text: string;
6013
6159
  };
6014
6160
  name?: string;
6161
+ audio?: {
6162
+ id: string;
6163
+ };
6015
6164
  } | {
6016
6165
  role: 'assistant';
6017
6166
  content?: string | {
@@ -6086,6 +6235,12 @@ type AxAIOpenAIChatResponse = {
6086
6235
  role: string;
6087
6236
  content: string | null;
6088
6237
  refusal: string | null;
6238
+ audio?: {
6239
+ id: string;
6240
+ data?: string;
6241
+ expires_at?: number;
6242
+ transcript?: string;
6243
+ } | null;
6089
6244
  reasoning_content?: string;
6090
6245
  annotations?: AxAIOpenAIAnnotation[];
6091
6246
  tool_calls?: {
@@ -6111,6 +6266,13 @@ type AxAIOpenAIChatResponse = {
6111
6266
  type AxAIOpenAIChatResponseDelta = AxAIOpenAIResponseDelta<{
6112
6267
  content: string | null;
6113
6268
  refusal?: string | null;
6269
+ audio?: {
6270
+ id?: string;
6271
+ data?: string;
6272
+ delta?: string;
6273
+ expires_at?: number;
6274
+ transcript?: string;
6275
+ } | null;
6114
6276
  reasoning_content?: string;
6115
6277
  role?: string;
6116
6278
  annotations?: AxAIOpenAIAnnotation[];
@@ -6133,6 +6295,55 @@ type AxAIOpenAIEmbedResponse = {
6133
6295
  usage: AxAIOpenAIUsage;
6134
6296
  };
6135
6297
 
6298
+ type AxOpenAIInputAudioFormat = 'wav' | 'mp3';
6299
+ type AxOpenAIRealtimeInputAudioFormat = AxOpenAIInputAudioFormat | 'pcm16';
6300
+ type AxOpenAIAudioPart = {
6301
+ type: 'audio';
6302
+ data: string;
6303
+ format?: AxAudioFormat;
6304
+ mimeType?: string;
6305
+ sampleRate?: number;
6306
+ channels?: number;
6307
+ };
6308
+ declare const axAIOpenAIAudioDefaultConfig: () => AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;
6309
+ declare const axIsOpenAIChatAudioModel: (model: string) => boolean;
6310
+ declare const axResolveOpenAIChatAudioConfig: (providerAudio?: Readonly<AxChatAudioConfig>, requestAudio?: Readonly<AxChatAudioConfig>) => AxChatAudioConfig | undefined;
6311
+ declare const axMapOpenAIInputAudioPart: (part: Readonly<AxOpenAIAudioPart>, options?: Readonly<{
6312
+ allowPcm16?: boolean;
6313
+ }>) => {
6314
+ type: "input_audio";
6315
+ input_audio: {
6316
+ data: string;
6317
+ format: AxOpenAIRealtimeInputAudioFormat;
6318
+ mimeType?: string;
6319
+ sampleRate?: number;
6320
+ channels?: number;
6321
+ };
6322
+ };
6323
+ declare const axApplyOpenAIChatAudioRequest: <TModel>(reqValue: AxAIOpenAIChatRequest<TModel>, req: Readonly<AxInternalChatRequest<TModel>>, providerAudio?: Readonly<AxChatAudioConfig>) => AxAIOpenAIChatRequest<TModel>;
6324
+ declare const axMapOpenAIChatAudioResponse: (audio: NonNullable<AxAIOpenAIChatResponse["choices"][number]["message"]["audio"]> | null | undefined) => AxChatAudioOutput | undefined;
6325
+ declare const axMapOpenAIChatAudioDelta: (audio: NonNullable<AxAIOpenAIChatResponseDelta["choices"][number]["delta"]["audio"]> | null | undefined) => AxChatAudioOutput | undefined;
6326
+
6327
+ type OpenAIRealtimeRequest<TModel> = {
6328
+ model: TModel;
6329
+ request: AxAIOpenAIChatRequest<TModel>;
6330
+ apiKey: string;
6331
+ audio: AxChatAudioConfig;
6332
+ webSocket?: any;
6333
+ debug?: boolean;
6334
+ apiName?: string;
6335
+ providerName?: string;
6336
+ wsURL?: (model: string) => string;
6337
+ createSessionUpdate?: (request: Readonly<OpenAIRealtimeRequest<TModel>>) => object;
6338
+ };
6339
+ declare const axAIOpenAIRealtimeDefaultConfig: () => AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;
6340
+ declare const axAIOpenAIRealtimeTranscriptionDefaultConfig: () => AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;
6341
+ declare const axIsOpenAIRealtimeModel: (model: string) => boolean;
6342
+ declare const axIsOpenAIRealtimeTranscriptionModel: (model: string) => boolean;
6343
+ declare const axResolveOpenAIRealtimeAudioConfig: (providerAudio?: Readonly<AxChatAudioConfig>, requestAudio?: Readonly<AxChatAudioConfig>) => AxChatAudioConfig;
6344
+ declare const axShouldUseOpenAIRealtime: (model: string, providerAudio?: Readonly<AxChatAudioConfig>, requestAudio?: Readonly<AxChatAudioConfig>) => boolean;
6345
+ declare const axCreateOpenAIRealtimeApi: <TModel>(realtimeRequest: OpenAIRealtimeRequest<TModel>) => AxAPI;
6346
+
6136
6347
  declare const axAIOpenAIDefaultConfig: () => AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;
6137
6348
  declare const axAIOpenAIBestConfig: () => AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;
6138
6349
  declare const axAIOpenAICreativeConfig: () => AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;
@@ -6145,6 +6356,12 @@ interface AxAIOpenAIArgs<TName = 'openai', TModel = AxAIOpenAIModel, TEmbedModel
6145
6356
  type ChatReqUpdater<TModel, TChatReq extends AxAIOpenAIChatRequest<TModel>> = (req: Readonly<TChatReq>, config: Readonly<AxAIServiceOptions>) => TChatReq;
6146
6357
  type ChatRespProcessor = (resp: AxChatResponse) => AxChatResponse;
6147
6358
  type ChatStreamRespProcessor = (resp: AxChatResponse, state: object) => AxChatResponse;
6359
+ type RealtimeAdapter<TModel> = {
6360
+ apiName: string;
6361
+ shouldUse: (model: string, providerAudio?: Readonly<AxChatAudioConfig>, requestAudio?: Readonly<AxChatAudioConfig>) => boolean;
6362
+ resolveAudioConfig: (providerAudio?: Readonly<AxChatAudioConfig>, requestAudio?: Readonly<AxChatAudioConfig>) => AxChatAudioConfig;
6363
+ createApi: (request: OpenAIRealtimeRequest<TModel>) => AxAPI;
6364
+ };
6148
6365
  interface AxAIOpenAIBaseArgs<TModel, TEmbedModel, TModelKey, TChatReq extends AxAIOpenAIChatRequest<TModel>> {
6149
6366
  apiKey: string;
6150
6367
  apiURL?: string;
@@ -6157,10 +6374,11 @@ interface AxAIOpenAIBaseArgs<TModel, TEmbedModel, TModelKey, TChatReq extends Ax
6157
6374
  chatReqUpdater?: ChatReqUpdater<TModel, TChatReq>;
6158
6375
  chatRespProcessor?: ChatRespProcessor;
6159
6376
  chatStreamRespProcessor?: ChatStreamRespProcessor;
6377
+ realtime?: RealtimeAdapter<TModel>;
6160
6378
  supportFor: AxAIFeatures | ((model: TModel) => AxAIFeatures);
6161
6379
  }
6162
6380
  declare class AxAIOpenAIBase<TModel, TEmbedModel, TModelKey, TChatReq extends AxAIOpenAIChatRequest<TModel> = AxAIOpenAIChatRequest<TModel>> extends AxBaseAI<TModel, TEmbedModel, AxAIOpenAIChatRequest<TModel>, AxAIOpenAIEmbedRequest<TEmbedModel>, AxAIOpenAIChatResponse, AxAIOpenAIChatResponseDelta, AxAIOpenAIEmbedResponse, TModelKey> {
6163
- constructor({ apiKey, config, options, apiURL, modelInfo, models, chatReqUpdater, chatRespProcessor, chatStreamRespProcessor, supportFor, }: Readonly<Omit<AxAIOpenAIBaseArgs<TModel, TEmbedModel, TModelKey, TChatReq>, 'name'>>);
6381
+ constructor({ apiKey, config, options, apiURL, modelInfo, models, chatReqUpdater, chatRespProcessor, chatStreamRespProcessor, realtime, supportFor, }: Readonly<Omit<AxAIOpenAIBaseArgs<TModel, TEmbedModel, TModelKey, TChatReq>, 'name'>>);
6164
6382
  }
6165
6383
  declare class AxAIOpenAI<TModelKey = string> extends AxAIOpenAIBase<AxAIOpenAIModel, AxAIOpenAIEmbedModel, TModelKey> {
6166
6384
  constructor({ apiKey, apiURL, config, options, models, modelInfo, }: Readonly<Omit<AxAIOpenAIArgs<'openai', AxAIOpenAIModel, AxAIOpenAIEmbedModel, TModelKey>, 'name'>>);
@@ -6394,6 +6612,7 @@ interface CapabilityValidationResult {
6394
6612
  * ```
6395
6613
  */
6396
6614
  declare function axAnalyzeRequestRequirements(request: AxChatRequest): MediaRequirements & {
6615
+ hasAudioOutput: boolean;
6397
6616
  requiresFunctions: boolean;
6398
6617
  requiresStreaming: boolean;
6399
6618
  requiresCaching: boolean;
@@ -6674,8 +6893,6 @@ declare class AxAICohere<TModelKey> extends AxBaseAI<AxAICohereModel, AxAICohere
6674
6893
  constructor({ apiKey, config, options, models, }: Readonly<Omit<AxAICohereArgs<TModelKey>, 'name'>>);
6675
6894
  }
6676
6895
 
6677
- declare const axModelInfoCohere: AxModelInfo[];
6678
-
6679
6896
  /**
6680
6897
  * DeepSeek: Models for text generation
6681
6898
  */
@@ -6723,8 +6940,6 @@ declare class AxAIDeepSeek<TModelKey> extends AxAIOpenAIBase<AxAIDeepSeekModel,
6723
6940
  constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIDeepSeekArgs<TModelKey>, 'name'>>);
6724
6941
  }
6725
6942
 
6726
- declare const axModelInfoDeepSeek: AxModelInfo[];
6727
-
6728
6943
  declare enum AxAIGoogleGeminiModel {
6729
6944
  Gemini31Pro = "gemini-3.1-pro-preview",
6730
6945
  Gemini3FlashLite = "gemini-3.1-flash-lite-preview",
@@ -6733,6 +6948,7 @@ declare enum AxAIGoogleGeminiModel {
6733
6948
  Gemini3ProImage = "gemini-3-pro-image-preview",
6734
6949
  Gemini25Pro = "gemini-2.5-pro",
6735
6950
  Gemini25Flash = "gemini-2.5-flash",
6951
+ Gemini25FlashNativeAudio = "gemini-2.5-flash-native-audio-preview-12-2025",
6736
6952
  Gemini25FlashLite = "gemini-2.5-flash-lite",
6737
6953
  Gemini20Flash = "gemini-2.0-flash",
6738
6954
  Gemini20FlashLite = "gemini-2.0-flash-lite",
@@ -7057,6 +7273,20 @@ type AxAIGoogleGeminiCacheUpdateRequest = {
7057
7273
  expireTime?: string;
7058
7274
  };
7059
7275
 
7276
+ type GeminiLiveRequest = {
7277
+ model: AxAIGoogleGeminiModel;
7278
+ request: AxAIGoogleGeminiChatRequest;
7279
+ apiKey: string;
7280
+ audio: AxChatAudioConfig;
7281
+ };
7282
+ declare const axAIGoogleGeminiLiveAudioDefaultConfig: () => AxAIGoogleGeminiConfig;
7283
+ declare const axIsGeminiLiveAudioModel: (model: string) => boolean;
7284
+ declare const axResolveGeminiLiveAudioConfig: (providerAudio?: Readonly<AxChatAudioConfig>, requestAudio?: Readonly<AxChatAudioConfig>) => AxChatAudioConfig | undefined;
7285
+ declare const axShouldUseGeminiLiveAudio: (model: string, providerAudio?: Readonly<AxChatAudioConfig>, requestAudio?: Readonly<AxChatAudioConfig>) => boolean;
7286
+ declare const axValidateGeminiLiveAudioInput: (part: Readonly<AxAIGoogleGeminiContentPart>) => void;
7287
+ declare const axMapGeminiLiveAudioPart: (part: Readonly<AxAIGoogleGeminiContentPart>) => AxChatAudioOutput | undefined;
7288
+ declare const axCreateGeminiLiveAudioApi: (liveRequest: GeminiLiveRequest) => AxAPI;
7289
+
7060
7290
  /**
7061
7291
  * AxAIGoogleGemini: Default Model options for text generation
7062
7292
  */
@@ -7094,11 +7324,6 @@ declare class AxAIGoogleGemini<TModelKey = string> extends AxBaseAI<AxAIGoogleGe
7094
7324
  constructor({ apiKey, projectId, region, endpointId, config, options, models, modelInfo, }: Readonly<Omit<AxAIGoogleGeminiArgs<TModelKey>, 'name'>>);
7095
7325
  }
7096
7326
 
7097
- /**
7098
- * AxAIGoogleGemini: Model information
7099
- */
7100
- declare const axModelInfoGoogleGemini: AxModelInfo[];
7101
-
7102
7327
  declare enum AxAIGroqModel {
7103
7328
  Llama3_8B = "llama3-8b-8192",
7104
7329
  Llama33_70B = "llama-3.3-70b-versatile",
@@ -7118,11 +7343,6 @@ declare class AxAIGroq<TModelKey> extends AxAIOpenAIBase<AxAIGroqModel, undefine
7118
7343
  private newRateLimiter;
7119
7344
  }
7120
7345
 
7121
- /**
7122
- * AxAIGroq: Model information
7123
- */
7124
- declare const axModelInfoGroq: AxModelInfo[];
7125
-
7126
7346
  declare enum AxAIHuggingFaceModel {
7127
7347
  MetaLlama270BChatHF = "meta-llama/Llama-2-70b-chat-hf"
7128
7348
  }
@@ -7170,40 +7390,6 @@ declare class AxAIHuggingFace<TModelKey> extends AxBaseAI<AxAIHuggingFaceModel,
7170
7390
  constructor({ apiKey, config, options, models, }: Readonly<Omit<AxAIHuggingFaceArgs<TModelKey>, 'name'>>);
7171
7391
  }
7172
7392
 
7173
- /**
7174
- * HuggingFace: Model information
7175
- */
7176
- declare const axModelInfoHuggingFace: AxModelInfo[];
7177
-
7178
- interface AxAIMetricsInstruments {
7179
- latencyHistogram?: Histogram;
7180
- errorCounter?: Counter;
7181
- requestCounter?: Counter;
7182
- tokenCounter?: Counter;
7183
- inputTokenCounter?: Counter;
7184
- outputTokenCounter?: Counter;
7185
- errorRateGauge?: Gauge;
7186
- meanLatencyGauge?: Gauge;
7187
- p95LatencyGauge?: Gauge;
7188
- p99LatencyGauge?: Gauge;
7189
- streamingRequestsCounter?: Counter;
7190
- functionCallsCounter?: Counter;
7191
- functionCallLatencyHistogram?: Histogram;
7192
- requestSizeHistogram?: Histogram;
7193
- responseSizeHistogram?: Histogram;
7194
- temperatureGauge?: Gauge;
7195
- maxTokensGauge?: Gauge;
7196
- estimatedCostCounter?: Counter;
7197
- promptLengthHistogram?: Histogram;
7198
- contextWindowUsageGauge?: Gauge;
7199
- timeoutsCounter?: Counter;
7200
- abortsCounter?: Counter;
7201
- thinkingBudgetUsageCounter?: Counter;
7202
- multimodalRequestsCounter?: Counter;
7203
- cacheReadTokensCounter?: Counter;
7204
- cacheWriteTokensCounter?: Counter;
7205
- }
7206
-
7207
7393
  declare enum AxAIMistralModel {
7208
7394
  Mistral7B = "open-mistral-7b",
7209
7395
  Mistral8x7B = "open-mixtral-8x7b",
@@ -7264,136 +7450,6 @@ declare class AxAIMistral<TModelKey> extends AxAIOpenAIBase<AxAIMistralModel, Ax
7264
7450
  private updateMessages;
7265
7451
  }
7266
7452
 
7267
- declare const axModelInfoMistral: AxModelInfo[];
7268
-
7269
- type AxMockAIServiceConfig<TModelKey> = {
7270
- name?: string;
7271
- id?: string;
7272
- modelInfo?: Partial<AxModelInfoWithProvider>;
7273
- embedModelInfo?: AxModelInfoWithProvider;
7274
- features?: {
7275
- functions?: boolean;
7276
- streaming?: boolean;
7277
- structuredOutputs?: boolean;
7278
- media?: Partial<AxAIFeatures['media']>;
7279
- };
7280
- models?: AxAIModelList<TModelKey>;
7281
- options?: AxAIServiceOptions;
7282
- chatResponse?: AxChatResponse | ReadableStream<AxChatResponse> | (() => Promise<AxChatResponse | ReadableStream<AxChatResponse>>) | ((req: Readonly<AxChatRequest<unknown>>, options?: Readonly<AxAIServiceOptions>) => Promise<AxChatResponse | ReadableStream<AxChatResponse>>);
7283
- embedResponse?: AxEmbedResponse | ((req: Readonly<AxEmbedRequest>) => AxEmbedResponse | Promise<AxEmbedResponse>);
7284
- shouldError?: boolean;
7285
- errorMessage?: string;
7286
- latencyMs?: number;
7287
- };
7288
- declare class AxMockAIService<TModelKey> implements AxAIService<unknown, unknown, TModelKey> {
7289
- private readonly config;
7290
- private metrics;
7291
- constructor(config?: AxMockAIServiceConfig<TModelKey>);
7292
- getLastUsedChatModel(): unknown;
7293
- getLastUsedEmbedModel(): unknown;
7294
- getLastUsedModelConfig(): AxModelConfig | undefined;
7295
- getName(): string;
7296
- getId(): string;
7297
- getFeatures(_model?: string): AxAIFeatures;
7298
- getModelList(): AxAIModelList<TModelKey> | undefined;
7299
- getMetrics(): AxAIServiceMetrics;
7300
- getEstimatedCost(): number;
7301
- chat(req: Readonly<AxChatRequest<unknown>>, _options?: Readonly<AxAIServiceOptions>): Promise<AxChatResponse | ReadableStream<AxChatResponse>>;
7302
- embed(req: Readonly<AxEmbedRequest>, _options?: Readonly<AxAIServiceOptions>): Promise<AxEmbedResponse>;
7303
- setOptions(options: Readonly<AxAIServiceOptions>): void;
7304
- getOptions(): Readonly<AxAIServiceOptions>;
7305
- getLogger(): AxLoggerFunction;
7306
- private updateMetrics;
7307
- }
7308
-
7309
- type AxAIServiceListItem<TModel = unknown, TEmbedModel = unknown, TModelKey = string> = {
7310
- key: TModelKey;
7311
- service: AxAIService<TModel, TEmbedModel, TModelKey>;
7312
- description: string;
7313
- isInternal?: boolean;
7314
- };
7315
- type ExtractServiceModelKeys<T> = T extends AxAIService<any, any, infer K> ? K : T extends AxAIServiceListItem<any, any, infer K> ? K : never;
7316
- type ExtractAllModelKeys<T extends readonly any[]> = T extends readonly [
7317
- infer First,
7318
- ...infer Rest
7319
- ] ? ExtractServiceModelKeys<First> | ExtractAllModelKeys<Rest> : never;
7320
- declare class AxMultiServiceRouter<TServices extends readonly (AxAIService | AxAIServiceListItem<any, any, any>)[] = readonly AxAIService[], TModelKey = ExtractAllModelKeys<TServices>> implements AxAIService<unknown, unknown, TModelKey> {
7321
- private options?;
7322
- private lastUsedService?;
7323
- private services;
7324
- /**
7325
- * Constructs a new multi-service router.
7326
- * It validates that each service provides a unique set of model keys,
7327
- * then builds a lookup (map) for routing the chat/embed requests.
7328
- */
7329
- constructor(services: TServices);
7330
- /**
7331
- * Static factory method for type-safe multi-service router creation with automatic model key inference.
7332
- */
7333
- static create<const TServices extends readonly (AxAIService | AxAIServiceListItem<any, any, any>)[]>(services: TServices): AxMultiServiceRouter<TServices, ExtractAllModelKeys<TServices>>;
7334
- getLastUsedChatModel(): unknown | undefined;
7335
- getLastUsedEmbedModel(): unknown | undefined;
7336
- getLastUsedModelConfig(): AxModelConfig | undefined;
7337
- /**
7338
- * Delegates the chat call to the service matching the provided model key.
7339
- */
7340
- chat(req: Readonly<AxChatRequest<TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxChatResponse | ReadableStream<AxChatResponse>>;
7341
- /**
7342
- * Delegates the embed call to the service matching the provided embed model key.
7343
- */
7344
- embed(req: Readonly<AxEmbedRequest<TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxEmbedResponse>;
7345
- /**
7346
- * Returns a composite ID built from the IDs of the underlying services.
7347
- */
7348
- getId(): string;
7349
- /**
7350
- * Returns the name of this router.
7351
- */
7352
- getName(): string;
7353
- /**
7354
- * Aggregates all available models across the underlying services.
7355
- */
7356
- getModelList(): AxAIModelList<TModelKey>;
7357
- /**
7358
- * If a model key is provided, delegate to the corresponding service's features.
7359
- * Otherwise, returns a default feature set.
7360
- */
7361
- getFeatures(model?: TModelKey): AxAIFeatures;
7362
- /**
7363
- * Returns aggregated metrics from the underlying service.
7364
- * Uses the metrics from the last service that was used,
7365
- * or falls back to the first service if none has been used.
7366
- */
7367
- getMetrics(): AxAIServiceMetrics;
7368
- getEstimatedCost(modelUsage?: AxModelUsage): number;
7369
- /**
7370
- * Sets options on all underlying services.
7371
- */
7372
- setOptions(options: Readonly<AxAIServiceOptions>): void;
7373
- /**
7374
- * Returns the options from the last used service,
7375
- * or falls back to the first service if none has been used.
7376
- */
7377
- getOptions(): Readonly<AxAIServiceOptions>;
7378
- /**
7379
- * Returns the logger from the last used service,
7380
- * or falls back to the first service if none has been used.
7381
- */
7382
- getLogger(): AxLoggerFunction;
7383
- /**
7384
- * Sets a service entry for a given key. This method is intended for testing purposes.
7385
- * @param key - The model key
7386
- * @param entry - The service entry to set
7387
- */
7388
- setServiceEntry(key: TModelKey, entry: {
7389
- isInternal?: boolean;
7390
- description: string;
7391
- model?: string;
7392
- embedModel?: string;
7393
- service: AxAIService<unknown, unknown, TModelKey>;
7394
- }): void;
7395
- }
7396
-
7397
7453
  /**
7398
7454
  * Configuration type for Ollama AI service
7399
7455
  */
@@ -7438,15 +7494,6 @@ declare class AxAIOllama<TModelKey> extends AxAIOpenAIBase<string, string, TMode
7438
7494
  constructor({ apiKey, url, config, options, models, }: Readonly<Omit<AxAIOllamaArgs<TModelKey>, 'name'>>);
7439
7495
  }
7440
7496
 
7441
- /**
7442
- * OpenAI: Model information
7443
- */
7444
- declare const axModelInfoOpenAI: AxModelInfo[];
7445
- /**
7446
- * OpenAI: Model information
7447
- */
7448
- declare const axModelInfoOpenAIResponses: AxModelInfo[];
7449
-
7450
7497
  declare enum AxAIOpenAIResponsesModel {
7451
7498
  GPT4 = "gpt-4",
7452
7499
  GPT41 = "gpt-4.1",
@@ -7622,10 +7669,23 @@ interface AxAIOpenAIResponsesResponse {
7622
7669
  readonly model: string;
7623
7670
  readonly output: ReadonlyArray<AxAIOpenAIResponsesOutputItem>;
7624
7671
  readonly usage?: {
7625
- readonly prompt_tokens: number;
7672
+ readonly prompt_tokens?: number;
7673
+ readonly input_tokens?: number;
7626
7674
  readonly completion_tokens?: number;
7627
7675
  readonly output_tokens?: number;
7628
- readonly total_tokens: number;
7676
+ readonly total_tokens?: number;
7677
+ readonly prompt_tokens_details?: {
7678
+ readonly cached_tokens?: number;
7679
+ };
7680
+ readonly input_tokens_details?: {
7681
+ readonly cached_tokens?: number;
7682
+ };
7683
+ readonly completion_tokens_details?: {
7684
+ readonly reasoning_tokens?: number;
7685
+ };
7686
+ readonly output_tokens_details?: {
7687
+ readonly reasoning_tokens?: number;
7688
+ };
7629
7689
  } | null;
7630
7690
  }
7631
7691
  interface AxAIOpenAIResponsesStreamEventBase {
@@ -7887,11 +7947,25 @@ interface AxAIOpenAIResponsesResponseDelta {
7887
7947
  readonly item?: Partial<Readonly<AxAIOpenAIResponsesOutputItem>>;
7888
7948
  readonly response?: Readonly<AxAIOpenAIResponsesResponse>;
7889
7949
  readonly usage?: {
7890
- readonly prompt_tokens: number;
7891
- readonly completion_tokens: number;
7892
- readonly total_tokens: number;
7893
- } | null;
7894
- }
7950
+ readonly prompt_tokens?: number;
7951
+ readonly input_tokens?: number;
7952
+ readonly completion_tokens?: number;
7953
+ readonly output_tokens?: number;
7954
+ readonly total_tokens?: number;
7955
+ readonly prompt_tokens_details?: {
7956
+ readonly cached_tokens?: number;
7957
+ };
7958
+ readonly input_tokens_details?: {
7959
+ readonly cached_tokens?: number;
7960
+ };
7961
+ readonly completion_tokens_details?: {
7962
+ readonly reasoning_tokens?: number;
7963
+ };
7964
+ readonly output_tokens_details?: {
7965
+ readonly reasoning_tokens?: number;
7966
+ };
7967
+ } | null;
7968
+ }
7895
7969
  type ResponsesReqUpdater<TModel, TResponsesReq extends AxAIOpenAIResponsesRequest<TModel>> = (req: Readonly<TResponsesReq>) => Readonly<TResponsesReq>;
7896
7970
  type AxAIOpenAIResponsesConfig<TModel, TEmbedModel> = Omit<AxModelConfig, 'topK'> & {
7897
7971
  model: TModel;
@@ -7960,28 +8034,6 @@ interface AxAIOpenAIResponsesMCPToolCall extends AxAIOpenAIResponsesToolCallBase
7960
8034
  }
7961
8035
  type AxAIOpenAIResponsesToolCall = AxAIOpenAIResponsesFunctionCallItem | AxAIOpenAIResponsesFileSearchToolCall | AxAIOpenAIResponsesWebSearchToolCall | AxAIOpenAIResponsesComputerToolCall | AxAIOpenAIResponsesCodeInterpreterToolCall | AxAIOpenAIResponsesImageGenerationToolCall | AxAIOpenAIResponsesLocalShellToolCall | AxAIOpenAIResponsesMCPToolCall;
7962
8036
 
7963
- declare class AxAIOpenAIResponsesImpl<TModel, TEmbedModel, // Kept for interface compatibility, but not used by this impl.
7964
- TResponsesReq extends AxAIOpenAIResponsesRequest<TModel>> implements AxAIServiceImpl<TModel, TEmbedModel, Readonly<AxAIOpenAIResponsesRequest<TModel>>, // ChatReq (now ResponsesReq)
7965
- Readonly<AxAIOpenAIEmbedRequest<TEmbedModel>>, // EmbedReq
7966
- Readonly<AxAIOpenAIResponsesResponse>, // ChatResp (now ResponsesResp)
7967
- Readonly<AxAIOpenAIResponsesResponseDelta>, // ChatRespDelta (now ResponsesRespDelta)
7968
- Readonly<AxAIOpenAIEmbedResponse>> {
7969
- private readonly config;
7970
- private readonly streamingUsage;
7971
- private readonly responsesReqUpdater?;
7972
- private tokensUsed;
7973
- constructor(config: Readonly<AxAIOpenAIResponsesConfig<TModel, TEmbedModel>>, streamingUsage: boolean, // If /v1/responses supports include_usage for streams
7974
- responsesReqUpdater?: ResponsesReqUpdater<TModel, TResponsesReq> | undefined);
7975
- getTokenUsage(): Readonly<AxTokenUsage> | undefined;
7976
- getModelConfig(): Readonly<AxModelConfig>;
7977
- private mapInternalContentToResponsesInput;
7978
- private createResponsesReqInternalInput;
7979
- createChatReq(req: Readonly<AxInternalChatRequest<TModel>>, config: Readonly<AxAIServiceOptions>): [Readonly<AxAPI>, Readonly<AxAIOpenAIResponsesRequest<TModel>>];
7980
- createChatResp(resp: Readonly<AxAIOpenAIResponsesResponse>): Readonly<AxChatResponse>;
7981
- createChatStreamResp: (streamEvent: Readonly<AxAIOpenAIResponsesResponseDelta>) => Readonly<AxChatResponse>;
7982
- createEmbedReq(req: Readonly<AxInternalEmbedRequest<TEmbedModel>>): [AxAPI, AxAIOpenAIEmbedRequest<TEmbedModel>];
7983
- }
7984
-
7985
8037
  declare const axAIOpenAIResponsesDefaultConfig: () => AxAIOpenAIResponsesConfig<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel>;
7986
8038
  declare const axAIOpenAIResponsesBestConfig: () => AxAIOpenAIResponsesConfig<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel>;
7987
8039
  declare const axAIOpenAIResponsesCreativeConfig: () => AxAIOpenAIResponsesConfig<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel>;
@@ -8113,642 +8165,929 @@ declare class AxAIReka<TModelKey> extends AxBaseAI<AxAIRekaModel, undefined, AxA
8113
8165
  constructor({ apiKey, config, options, apiURL, modelInfo, models, }: Readonly<Omit<AxAIRekaArgs<TModelKey>, 'name'>>);
8114
8166
  }
8115
8167
 
8116
- /**
8117
- * OpenAI: Model information
8118
- */
8119
- declare const axModelInfoReka: AxModelInfo[];
8168
+ declare enum AxAITogetherModel {
8169
+ KimiK25 = "moonshotai/Kimi-K2.5",
8170
+ KimiK2Instruct0905 = "moonshotai/Kimi-K2-Instruct-0905",
8171
+ KimiK2Thinking = "moonshotai/Kimi-K2-Thinking",
8172
+ DeepSeekV31 = "deepseek-ai/DeepSeek-V3.1",
8173
+ DeepSeekR1 = "deepseek-ai/DeepSeek-R1",
8174
+ GPTOSS120B = "openai/gpt-oss-120b",
8175
+ GPTOSS20B = "openai/gpt-oss-20b",
8176
+ Qwen35_397B = "Qwen/Qwen3.5-397B-A17B",
8177
+ Qwen3CoderNext = "Qwen/Qwen3-Coder-Next-FP8",
8178
+ Qwen3Coder480B = "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8",
8179
+ Qwen3_235BInstruct2507 = "Qwen/Qwen3-235B-A22B-Instruct-2507-tput",
8180
+ Qwen3_235BThinking2507 = "Qwen/Qwen3-235B-A22B-Thinking-2507",
8181
+ Qwen3Next80BInstruct = "Qwen/Qwen3-Next-80B-A3B-Instruct",
8182
+ Qwen3Next80BThinking = "Qwen/Qwen3-Next-80B-A3B-Thinking",
8183
+ GLM5 = "zai-org/GLM-5",
8184
+ GLM47 = "zai-org/GLM-4.7",
8185
+ Llama4Maverick = "meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8",
8186
+ Llama33_70B = "meta-llama/Llama-3.3-70B-Instruct-Turbo"
8187
+ }
8188
+ type AxAITogetherChatModel = AxAITogetherModel | (string & {});
8189
+
8190
+ type TogetherAIConfig = AxAIOpenAIConfig<AxAITogetherChatModel, unknown>;
8191
+ declare const axAITogetherDefaultConfig: () => TogetherAIConfig;
8192
+ type AxAITogetherArgs<TModelKey> = AxAIOpenAIArgs<'together', AxAITogetherChatModel, unknown, TModelKey>;
8193
+ declare class AxAITogether<TModelKey> extends AxAIOpenAIBase<AxAITogetherChatModel, unknown, TModelKey> {
8194
+ constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAITogetherArgs<TModelKey>, 'name'>>);
8195
+ }
8120
8196
 
8121
8197
  /**
8122
- * Services for converting unsupported content types to text or optimized formats
8198
+ * WebLLM: Models for text generation
8199
+ * Based on WebLLM's supported models
8123
8200
  */
8124
- interface AxContentProcessingServices {
8125
- /** Service to convert images to text descriptions */
8126
- imageToText?: (imageData: string) => Promise<string>;
8127
- /** Service to convert audio to text transcriptions */
8128
- audioToText?: (audioData: string, format?: string) => Promise<string>;
8129
- /** Service to extract text from files */
8130
- fileToText?: (fileData: string, mimeType: string) => Promise<string>;
8131
- /** Service to fetch and extract text from URLs */
8132
- urlToText?: (url: string) => Promise<string>;
8133
- /** Service to optimize images for size/quality */
8134
- imageOptimization?: (imageData: string, options: OptimizationOptions) => Promise<string>;
8201
+ declare enum AxAIWebLLMModel {
8202
+ Llama31_8B_Instruct = "Llama-3.1-8B-Instruct-q4f32_1-MLC",
8203
+ Llama31_70B_Instruct = "Llama-3.1-70B-Instruct-q4f16_1-MLC",
8204
+ Llama32_1B_Instruct = "Llama-3.2-1B-Instruct-q4f32_1-MLC",
8205
+ Llama32_3B_Instruct = "Llama-3.2-3B-Instruct-q4f32_1-MLC",
8206
+ Mistral7B_Instruct = "Mistral-7B-Instruct-v0.3-q4f32_1-MLC",
8207
+ Phi35_Mini_Instruct = "Phi-3.5-mini-instruct-q4f32_1-MLC",
8208
+ Gemma2_2B_Instruct = "gemma-2-2b-it-q4f32_1-MLC",
8209
+ Gemma2_9B_Instruct = "gemma-2-9b-it-q4f32_1-MLC",
8210
+ Qwen2_5_0_5B_Instruct = "Qwen2.5-0.5B-Instruct-q4f32_1-MLC",
8211
+ Qwen2_5_1_5B_Instruct = "Qwen2.5-1.5B-Instruct-q4f32_1-MLC",
8212
+ Qwen2_5_3B_Instruct = "Qwen2.5-3B-Instruct-q4f32_1-MLC",
8213
+ Qwen2_5_7B_Instruct = "Qwen2.5-7B-Instruct-q4f32_1-MLC"
8135
8214
  }
8136
8215
  /**
8137
- * Options for image optimization processing
8216
+ * WebLLM: Model options for text generation
8138
8217
  */
8139
- interface OptimizationOptions {
8140
- /** Image quality (0-100) */
8141
- quality?: number;
8142
- /** Maximum file size in bytes */
8143
- maxSize?: number;
8144
- /** Target image format */
8145
- format?: 'jpeg' | 'png' | 'webp';
8146
- }
8218
+ type AxAIWebLLMConfig = AxModelConfig & {
8219
+ model: AxAIWebLLMModel;
8220
+ logitBias?: Record<number, number>;
8221
+ logProbs?: boolean;
8222
+ topLogprobs?: number;
8223
+ };
8147
8224
  /**
8148
- * Configuration for multi-provider routing with fallback capabilities
8225
+ * WebLLM: Chat request structure
8226
+ * Based on OpenAI-compatible API from WebLLM
8149
8227
  */
8150
- interface AxMultiProviderConfig {
8151
- /** Provider hierarchy for routing */
8152
- providers: {
8153
- /** Primary provider to try first */
8154
- primary: AxAIService;
8155
- /** Alternative providers for fallback */
8156
- alternatives: AxAIService[];
8157
- };
8158
- /** Routing behavior configuration */
8159
- routing: {
8160
- /** Order of preferences when selecting providers */
8161
- preferenceOrder: ('capability' | 'cost' | 'speed' | 'quality')[];
8162
- /** Capability matching requirements */
8163
- capability: {
8164
- /** Only use providers with full capability support */
8165
- requireExactMatch: boolean;
8166
- /** Allow providers that require content processing fallbacks */
8167
- allowDegradation: boolean;
8228
+ type AxAIWebLLMChatRequest = {
8229
+ model: AxAIWebLLMModel;
8230
+ messages: Array<{
8231
+ role: 'system' | 'user' | 'assistant' | 'function';
8232
+ content?: string;
8233
+ name?: string;
8234
+ function_call?: {
8235
+ name: string;
8236
+ arguments: string;
8237
+ };
8238
+ }>;
8239
+ temperature?: number;
8240
+ top_p?: number;
8241
+ max_tokens?: number;
8242
+ stream?: boolean;
8243
+ stop?: string | string[];
8244
+ presence_penalty?: number;
8245
+ frequency_penalty?: number;
8246
+ logit_bias?: Record<number, number>;
8247
+ logprobs?: boolean;
8248
+ top_logprobs?: number;
8249
+ n?: number;
8250
+ tools?: Array<{
8251
+ type: 'function';
8252
+ function: {
8253
+ name: string;
8254
+ description: string;
8255
+ parameters: object;
8256
+ };
8257
+ }>;
8258
+ tool_choice?: 'none' | 'auto' | {
8259
+ type: 'function';
8260
+ function: {
8261
+ name: string;
8168
8262
  };
8169
8263
  };
8170
- /** Content processing services for unsupported media types */
8171
- processing: AxContentProcessingServices;
8172
- }
8264
+ };
8173
8265
  /**
8174
- * Result of the routing process including provider selection and processing information
8266
+ * WebLLM: Chat response structure
8175
8267
  */
8176
- interface AxRoutingResult {
8177
- /** The selected AI service provider */
8178
- provider: AxAIService;
8179
- /** List of content processing steps that were applied */
8180
- processingApplied: string[];
8181
- /** List of capability degradations that occurred */
8182
- degradations: string[];
8183
- /** Non-critical warnings about the routing decision */
8184
- warnings: string[];
8185
- }
8268
+ type AxAIWebLLMChatResponse = {
8269
+ id: string;
8270
+ object: 'chat.completion';
8271
+ created: number;
8272
+ model: AxAIWebLLMModel;
8273
+ choices: Array<{
8274
+ index: number;
8275
+ message: {
8276
+ role: 'assistant';
8277
+ content?: string;
8278
+ tool_calls?: Array<{
8279
+ id: string;
8280
+ type: 'function';
8281
+ function: {
8282
+ name: string;
8283
+ arguments: string;
8284
+ };
8285
+ }>;
8286
+ };
8287
+ finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter';
8288
+ logprobs?: {
8289
+ content: Array<{
8290
+ token: string;
8291
+ logprob: number;
8292
+ bytes: number[];
8293
+ top_logprobs: Array<{
8294
+ token: string;
8295
+ logprob: number;
8296
+ bytes: number[];
8297
+ }>;
8298
+ }>;
8299
+ };
8300
+ }>;
8301
+ usage: {
8302
+ prompt_tokens: number;
8303
+ completion_tokens: number;
8304
+ total_tokens: number;
8305
+ };
8306
+ };
8186
8307
  /**
8187
- * Multi-provider router that automatically selects optimal AI providers and handles content processing.
8188
- *
8189
- * The router analyzes requests to determine capability requirements, scores available providers,
8190
- * and automatically handles content transformation for unsupported media types. It provides
8191
- * graceful degradation and fallback mechanisms for robust multi-modal AI applications.
8192
- *
8193
- * @example
8194
- * ```typescript
8195
- * const router = new AxProviderRouter({
8196
- * providers: {
8197
- * primary: openaiProvider,
8198
- * alternatives: [geminiProvider, cohereProvider]
8199
- * },
8200
- * routing: {
8201
- * preferenceOrder: ['capability', 'quality'],
8202
- * capability: {
8203
- * requireExactMatch: false,
8204
- * allowDegradation: true
8205
- * }
8206
- * },
8207
- * processing: {
8208
- * imageToText: async (data) => await visionService.describe(data),
8209
- * audioToText: async (data) => await speechService.transcribe(data)
8210
- * }
8211
- * });
8212
- *
8213
- * const result = await router.chat(multiModalRequest);
8214
- * console.log(`Used: ${result.routing.provider.getName()}`);
8215
- * ```
8308
+ * WebLLM: Streaming chat response structure
8216
8309
  */
8217
- declare class AxProviderRouter {
8218
- private providers;
8219
- private processingServices;
8220
- private config;
8221
- /**
8222
- * Creates a new provider router with the specified configuration.
8223
- *
8224
- * @param config - Router configuration including providers, routing preferences, and processing services
8225
- */
8226
- constructor(config: AxMultiProviderConfig);
8227
- /**
8228
- * Routes a chat request to the most appropriate provider with automatic content processing.
8229
- *
8230
- * This method analyzes the request, selects the optimal provider, preprocesses content
8231
- * for compatibility, and executes the request with fallback support.
8232
- *
8233
- * @param request - The chat request to process
8234
- * @param options - Extended options including fallback providers and routing preferences
8235
- * @param options.fallbackProviders - Additional providers to try if primary selection fails
8236
- * @param options.processingOptions - Content processing options and conversion services
8237
- * @param options.routingOptions - Provider selection and routing behavior options
8238
- * @param options.routingOptions.requireExactMatch - Only use providers with full capability support
8239
- * @param options.routingOptions.allowDegradation - Allow content processing for unsupported types
8240
- * @param options.routingOptions.maxRetries - Maximum number of fallback providers to try
8241
- * @returns Promise resolving to the AI response and routing information
8242
- * @throws AxMediaNotSupportedError when no suitable provider can handle the request
8243
- *
8244
- * @example
8245
- * ```typescript
8246
- * const result = await router.chat(
8247
- * { chatPrompt: [{ role: 'user', content: [{ type: 'image', image: '...' }] }] },
8248
- * {
8249
- * processingOptions: { fallbackBehavior: 'degrade' },
8250
- * routingOptions: { allowDegradation: true }
8251
- * }
8252
- * );
8253
- *
8254
- * console.log(`Provider: ${result.routing.provider.getName()}`);
8255
- * console.log(`Processing applied: ${result.routing.processingApplied}`);
8256
- * ```
8257
- */
8258
- chat(request: AxChatRequest, options?: AxAIServiceOptions & {
8259
- fallbackProviders?: AxAIService[];
8260
- processingOptions?: ProcessingOptions;
8261
- routingOptions?: {
8262
- requireExactMatch?: boolean;
8263
- allowDegradation?: boolean;
8264
- maxRetries?: number;
8310
+ type AxAIWebLLMChatResponseDelta = {
8311
+ id: string;
8312
+ object: 'chat.completion.chunk';
8313
+ created: number;
8314
+ model: AxAIWebLLMModel;
8315
+ choices: Array<{
8316
+ index: number;
8317
+ delta: {
8318
+ role?: 'assistant';
8319
+ content?: string;
8320
+ tool_calls?: Array<{
8321
+ index: number;
8322
+ id?: string;
8323
+ type?: 'function';
8324
+ function?: {
8325
+ name?: string;
8326
+ arguments?: string;
8327
+ };
8328
+ }>;
8329
+ };
8330
+ finish_reason?: 'stop' | 'length' | 'tool_calls' | 'content_filter';
8331
+ logprobs?: {
8332
+ content: Array<{
8333
+ token: string;
8334
+ logprob: number;
8335
+ bytes: number[];
8336
+ top_logprobs: Array<{
8337
+ token: string;
8338
+ logprob: number;
8339
+ bytes: number[];
8340
+ }>;
8341
+ }>;
8265
8342
  };
8266
- }): Promise<{
8267
- response: AxChatResponse | ReadableStream<AxChatResponse>;
8268
- routing: AxRoutingResult;
8269
- }>;
8270
- /**
8271
- * Preprocesses request content for the target provider
8272
- */
8273
- private preprocessRequest;
8274
- /**
8275
- * Selects provider with graceful degradation
8276
- */
8277
- private selectProviderWithDegradation;
8278
- /**
8279
- * Tries fallback providers when primary provider fails
8280
- */
8281
- private tryFallbackProviders;
8282
- /**
8283
- * Gets routing recommendation without executing the request.
8284
- *
8285
- * Analyzes the request and returns routing information including which provider
8286
- * would be selected, what processing would be applied, and any degradations or warnings.
8287
- *
8288
- * @param request - The chat request to analyze
8289
- * @returns Promise resolving to routing result with provider selection and processing info
8290
- *
8291
- * @example
8292
- * ```typescript
8293
- * const recommendation = await router.getRoutingRecommendation(request);
8294
- * console.log(`Would use: ${recommendation.provider.getName()}`);
8295
- * console.log(`Degradations: ${recommendation.degradations.join(', ')}`);
8296
- * ```
8297
- */
8298
- getRoutingRecommendation(request: AxChatRequest): Promise<AxRoutingResult>;
8299
- /**
8300
- * Validates whether the configured providers can handle a specific request.
8301
- *
8302
- * Performs pre-flight validation to check if the request can be successfully
8303
- * processed by available providers, identifies potential issues, and provides
8304
- * recommendations for improving compatibility.
8305
- *
8306
- * @param request - The chat request to validate
8307
- * @returns Promise resolving to validation result with handling capability and recommendations
8308
- *
8309
- * @example
8310
- * ```typescript
8311
- * const validation = await router.validateRequest(request);
8312
- * if (!validation.canHandle) {
8313
- * console.log('Issues:', validation.issues);
8314
- * console.log('Recommendations:', validation.recommendations);
8315
- * }
8316
- * ```
8317
- */
8318
- validateRequest(request: AxChatRequest): Promise<{
8319
- canHandle: boolean;
8320
- issues: string[];
8321
- recommendations: string[];
8322
8343
  }>;
8344
+ usage?: {
8345
+ prompt_tokens: number;
8346
+ completion_tokens: number;
8347
+ total_tokens: number;
8348
+ };
8349
+ };
8350
+ /**
8351
+ * WebLLM doesn't support embeddings natively
8352
+ * This is a placeholder for consistency with the framework
8353
+ */
8354
+ type AxAIWebLLMEmbedModel = never;
8355
+ type AxAIWebLLMEmbedRequest = never;
8356
+ type AxAIWebLLMEmbedResponse = never;
8357
+
8358
+ declare const axAIWebLLMDefaultConfig: () => AxAIWebLLMConfig;
8359
+ declare const axAIWebLLMCreativeConfig: () => AxAIWebLLMConfig;
8360
+ interface AxAIWebLLMArgs<TModelKey> {
8361
+ name: 'webllm';
8362
+ engine: any;
8363
+ config?: Readonly<Partial<AxAIWebLLMConfig>>;
8364
+ options?: Readonly<AxAIServiceOptions>;
8365
+ models?: AxAIInputModelList<AxAIWebLLMModel, AxAIWebLLMEmbedModel, TModelKey>;
8366
+ }
8367
+ declare class AxAIWebLLM<TModelKey> extends AxBaseAI<AxAIWebLLMModel, AxAIWebLLMEmbedModel, AxAIWebLLMChatRequest, AxAIWebLLMEmbedRequest, AxAIWebLLMChatResponse, AxAIWebLLMChatResponseDelta, AxAIWebLLMEmbedResponse, TModelKey> {
8368
+ constructor({ engine, config, options, models, }: Readonly<Omit<AxAIWebLLMArgs<TModelKey>, 'name'>>);
8369
+ }
8370
+
8371
+ declare enum AxAIGrokModel {
8372
+ Grok43 = "grok-4.3",
8373
+ Grok43Latest = "grok-4.3-latest",
8374
+ GrokLatest = "grok-latest",
8375
+ Grok420Reasoning = "grok-4.20-reasoning",
8376
+ Grok420Reasoning0309 = "grok-4.20-0309-reasoning",
8377
+ Grok420NonReasoning = "grok-4.20-non-reasoning",
8378
+ Grok420NonReasoning0309 = "grok-4.20-0309-non-reasoning",
8379
+ Grok420MultiAgent = "grok-4.20-multi-agent",
8380
+ Grok420MultiAgent0309 = "grok-4.20-multi-agent-0309",
8381
+ Grok41FastReasoning = "grok-4-1-fast-reasoning",
8382
+ Grok41FastNonReasoning = "grok-4-1-fast-non-reasoning",
8383
+ GrokVoiceThinkFast = "grok-voice-think-fast-1.0",
8384
+ GrokVoiceFast = "grok-voice-fast-1.0",
8385
+ Grok3 = "grok-3",
8386
+ Grok3Mini = "grok-3-mini",
8387
+ Grok3Fast = "grok-3-fast",
8388
+ Grok3MiniFast = "grok-3-mini-fast"
8389
+ }
8390
+ declare enum AxAIGrokEmbedModels {
8391
+ GrokEmbedSmall = "grok-embed-small"
8392
+ }
8393
+
8394
+ declare const axAIGrokDefaultConfig: () => AxAIOpenAIConfig<AxAIGrokModel, AxAIGrokEmbedModels>;
8395
+ declare const axAIGrokBestConfig: () => AxAIOpenAIConfig<AxAIGrokModel, AxAIGrokEmbedModels>;
8396
+ declare const axAIGrokVoiceDefaultConfig: () => AxAIOpenAIConfig<AxAIGrokModel, AxAIGrokEmbedModels>;
8397
+ declare const axIsGrokVoiceModel: (model: string) => boolean;
8398
+ declare const axResolveGrokRealtimeAudioConfig: (providerAudio?: Readonly<AxChatAudioConfig>, requestAudio?: Readonly<AxChatAudioConfig>) => AxChatAudioConfig;
8399
+ declare const axShouldUseGrokRealtime: (model: string, providerAudio?: Readonly<AxChatAudioConfig>, requestAudio?: Readonly<AxChatAudioConfig>) => boolean;
8400
+ declare const axCreateGrokRealtimeApi: <TModel>(realtimeRequest: OpenAIRealtimeRequest<TModel>) => AxAPI;
8401
+ interface AxAIGrokSearchSource {
8402
+ type: 'web' | 'x' | 'news' | 'rss';
8403
+ country?: string;
8404
+ excludedWebsites?: string[];
8405
+ allowedWebsites?: string[];
8406
+ safeSearch?: boolean;
8407
+ xHandles?: string[];
8408
+ links?: string[];
8409
+ }
8410
+ interface AxAIGrokOptionsTools {
8411
+ searchParameters?: {
8412
+ mode?: 'auto' | 'on' | 'off';
8413
+ returnCitations?: boolean;
8414
+ fromDate?: string;
8415
+ toDate?: string;
8416
+ maxSearchResults?: number;
8417
+ sources?: AxAIGrokSearchSource[];
8418
+ };
8419
+ }
8420
+ type AxAIGrokChatRequest = AxAIOpenAIChatRequest<AxAIGrokModel> & {
8421
+ search_parameters?: {
8422
+ mode?: 'auto' | 'on' | 'off';
8423
+ return_citations?: boolean;
8424
+ from_date?: string;
8425
+ to_date?: string;
8426
+ max_search_results?: number;
8427
+ sources?: AxAIGrokSearchSource[];
8428
+ };
8429
+ };
8430
+ type AxAIGrokArgs<TModelKey> = AxAIOpenAIArgs<'grok', AxAIGrokModel, AxAIGrokEmbedModels, TModelKey, AxAIGrokChatRequest> & {
8431
+ options?: Readonly<AxAIServiceOptions & AxAIGrokOptionsTools> & {
8432
+ tokensPerMinute?: number;
8433
+ };
8434
+ modelInfo?: AxModelInfo[];
8435
+ };
8436
+ declare class AxAIGrok<TModelKey> extends AxAIOpenAIBase<AxAIGrokModel, AxAIGrokEmbedModels, TModelKey, AxAIGrokChatRequest> {
8437
+ constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIGrokArgs<TModelKey>, 'name'>>);
8438
+ }
8439
+
8440
+ type AxAIArgs<TModelKey> = AxAIOpenAIArgs<'openai', AxAIOpenAIModel, AxAIOpenAIEmbedModel, TModelKey> | AxAIOpenAIResponsesArgs<'openai-responses', AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel, TModelKey> | AxAIAzureOpenAIArgs<TModelKey> | AxAITogetherArgs<TModelKey> | AxAIOpenRouterArgs<TModelKey> | AxAIAnthropicArgs<TModelKey> | AxAIGroqArgs<TModelKey> | AxAIGoogleGeminiArgs<TModelKey> | AxAICohereArgs<TModelKey> | AxAIHuggingFaceArgs<TModelKey> | AxAIMistralArgs<TModelKey> | AxAIDeepSeekArgs<TModelKey> | AxAIOllamaArgs<TModelKey> | AxAIRekaArgs<TModelKey> | AxAIGrokArgs<TModelKey> | AxAIWebLLMArgs<TModelKey>;
8441
+ type AxAIModels = AxAIOpenAIModel | AxAIAnthropicModel | AxAIGroqModel | AxAIGoogleGeminiModel | AxAICohereModel | AxAIHuggingFaceModel | AxAIMistralModel | AxAIDeepSeekModel | AxAIGrokModel | AxAIWebLLMModel;
8442
+ type AxAIEmbedModels = AxAIOpenAIEmbedModel | AxAIGoogleGeminiEmbedModel | AxAICohereEmbedModel;
8443
+ type ExtractModelKeysAndValues<T> = T extends readonly {
8444
+ key: infer K;
8445
+ model: infer M;
8446
+ }[] ? K | M : never;
8447
+ type InferTModelKey<T> = T extends {
8448
+ models: infer M;
8449
+ } ? ExtractModelKeysAndValues<M> : string;
8450
+ /**
8451
+ * Factory function for creating AI service instances with full type safety.
8452
+ *
8453
+ * This is the recommended way to create AI instances. It automatically selects
8454
+ * the appropriate provider implementation based on the `name` field and provides
8455
+ * type-safe access to provider-specific models.
8456
+ *
8457
+ * **Supported Providers:**
8458
+ * - `'openai'` - OpenAI (GPT-4, GPT-4o, o1, o3, etc.)
8459
+ * - `'openai-responses'` - OpenAI Responses API (for web search, file search)
8460
+ * - `'anthropic'` - Anthropic (Claude 3.5 Sonnet, Claude 3 Opus, etc.)
8461
+ * - `'google-gemini'` - Google (Gemini 1.5 Pro, Gemini 2.0 Flash, etc.)
8462
+ * - `'azure-openai'` - Azure OpenAI Service
8463
+ * - `'groq'` - Groq (Llama, Mixtral with fast inference)
8464
+ * - `'cohere'` - Cohere (Command R+, embeddings)
8465
+ * - `'mistral'` - Mistral AI (Mistral Large, Codestral)
8466
+ * - `'deepseek'` - DeepSeek (DeepSeek-V3, DeepSeek-R1)
8467
+ * - `'together'` - Together AI (various open models)
8468
+ * - `'openrouter'` - OpenRouter (unified API for many providers)
8469
+ * - `'ollama'` - Ollama (local models)
8470
+ * - `'huggingface'` - Hugging Face Inference API
8471
+ * - `'reka'` - Reka AI
8472
+ * - `'grok'` - xAI Grok
8473
+ * - `'webllm'` - WebLLM (browser-based inference)
8474
+ *
8475
+ * @param options - Provider-specific configuration. Must include `name` to identify the provider.
8476
+ * @param options.name - The provider identifier (see list above)
8477
+ * @param options.apiKey - API key for the provider (not needed for Ollama/WebLLM)
8478
+ * @param options.config - Optional default model configuration (maxTokens, temperature, etc.)
8479
+ * @param options.models - Optional custom model aliases for type-safe model selection
8480
+ *
8481
+ * @returns A configured AI service instance ready for chat completions and embeddings
8482
+ *
8483
+ * @see {@link AxModelConfig} for model configuration options
8484
+ * @see {@link AxAIServiceOptions} for runtime options like streaming and function calling
8485
+ *
8486
+ * @example Basic OpenAI setup
8487
+ * ```typescript
8488
+ * const ai = ai({
8489
+ * name: 'openai',
8490
+ * apiKey: process.env.OPENAI_API_KEY
8491
+ * });
8492
+ * ```
8493
+ *
8494
+ * @example Anthropic with custom defaults
8495
+ * ```typescript
8496
+ * const ai = ai({
8497
+ * name: 'anthropic',
8498
+ * apiKey: process.env.ANTHROPIC_API_KEY,
8499
+ * config: {
8500
+ * model: 'claude-sonnet-4-20250514',
8501
+ * maxTokens: 4096,
8502
+ * temperature: 0.7
8503
+ * }
8504
+ * });
8505
+ * ```
8506
+ *
8507
+ * @example Google Gemini with model aliases
8508
+ * ```typescript
8509
+ * const ai = ai({
8510
+ * name: 'google-gemini',
8511
+ * apiKey: process.env.GOOGLE_API_KEY,
8512
+ * models: [
8513
+ * { key: 'fast', model: 'gemini-2.0-flash' },
8514
+ * { key: 'smart', model: 'gemini-1.5-pro' }
8515
+ * ]
8516
+ * });
8517
+ * // Now use ai with model: 'fast' or model: 'smart'
8518
+ * ```
8519
+ *
8520
+ * @example Local models with Ollama
8521
+ * ```typescript
8522
+ * const ai = ai({
8523
+ * name: 'ollama',
8524
+ * config: { model: 'llama3.2' }
8525
+ * });
8526
+ * ```
8527
+ */
8528
+ declare function ai<const T extends AxAIArgs<any>>(options: T): AxAI<InferTModelKey<T>>;
8529
+ declare class AxAI<TModelKey = string> implements AxAIService<any, any, TModelKey> {
8530
+ private ai;
8531
+ static create<const T extends AxAIArgs<any>>(options: T): AxAI<InferTModelKey<T>>;
8323
8532
  /**
8324
- * Gets detailed statistics about the router's provider capabilities.
8325
- *
8326
- * Returns information about available providers, their supported capabilities,
8327
- * and routing recommendations for analysis and debugging purposes.
8533
+ * @deprecated Use `AxAI.create()` or `ai()` function instead for better type safety.
8534
+ * This constructor will be removed in v15.0.0.
8328
8535
  *
8329
- * @returns Object containing provider statistics and capability matrix
8536
+ * Migration timeline:
8537
+ * - v13.0.24+: Deprecation warnings (current)
8538
+ * - v14.0.0: Runtime console warnings
8539
+ * - v15.0.0: Complete removal
8330
8540
  *
8331
8541
  * @example
8332
8542
  * ```typescript
8333
- * const stats = router.getRoutingStats();
8334
- * console.log(`Total providers: ${stats.totalProviders}`);
8335
- * console.log('Capabilities:');
8336
- * for (const [capability, providers] of Object.entries(stats.capabilityMatrix)) {
8337
- * console.log(` ${capability}: ${providers.join(', ')}`);
8338
- * }
8543
+ * // Instead of: new AxAI({ name: 'openai', apiKey: '...' })
8544
+ * // Use: AxAI.create({ name: 'openai', apiKey: '...' })
8545
+ * // Or: ai({ name: 'openai', apiKey: '...' })
8339
8546
  * ```
8340
8547
  */
8341
- getRoutingStats(): {
8342
- totalProviders: number;
8343
- capabilityMatrix: {
8344
- [capability: string]: string[];
8345
- };
8346
- recommendedProvider: string;
8347
- };
8548
+ constructor(options: Readonly<AxAIArgs<TModelKey>>);
8549
+ getName(): string;
8550
+ getId(): string;
8551
+ getFeatures(model?: string): AxAIFeatures;
8552
+ getModelList(): AxAIModelList<TModelKey> | undefined;
8553
+ getLastUsedChatModel(): any;
8554
+ getLastUsedEmbedModel(): any;
8555
+ getLastUsedModelConfig(): AxModelConfig | undefined;
8556
+ getMetrics(): AxAIServiceMetrics;
8557
+ getEstimatedCost(modelUsage?: AxModelUsage): number;
8558
+ chat(req: Readonly<AxChatRequest<TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxChatResponse | ReadableStream<AxChatResponse>>;
8559
+ embed(req: Readonly<AxEmbedRequest<TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxEmbedResponse>;
8560
+ setOptions(options: Readonly<AxAIServiceOptions>): void;
8561
+ getOptions(): Readonly<AxAIServiceOptions>;
8562
+ getLogger(): AxLoggerFunction;
8348
8563
  }
8349
8564
 
8350
- declare enum AxAITogetherModel {
8351
- KimiK25 = "moonshotai/Kimi-K2.5",
8352
- KimiK2Instruct0905 = "moonshotai/Kimi-K2-Instruct-0905",
8353
- KimiK2Thinking = "moonshotai/Kimi-K2-Thinking",
8354
- DeepSeekV31 = "deepseek-ai/DeepSeek-V3.1",
8355
- DeepSeekR1 = "deepseek-ai/DeepSeek-R1",
8356
- GPTOSS120B = "openai/gpt-oss-120b",
8357
- GPTOSS20B = "openai/gpt-oss-20b",
8358
- Qwen35_397B = "Qwen/Qwen3.5-397B-A17B",
8359
- Qwen3CoderNext = "Qwen/Qwen3-Coder-Next-FP8",
8360
- Qwen3Coder480B = "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8",
8361
- Qwen3_235BInstruct2507 = "Qwen/Qwen3-235B-A22B-Instruct-2507-tput",
8362
- Qwen3_235BThinking2507 = "Qwen/Qwen3-235B-A22B-Thinking-2507",
8363
- Qwen3Next80BInstruct = "Qwen/Qwen3-Next-80B-A3B-Instruct",
8364
- Qwen3Next80BThinking = "Qwen/Qwen3-Next-80B-A3B-Thinking",
8365
- GLM5 = "zai-org/GLM-5",
8366
- GLM47 = "zai-org/GLM-4.7",
8367
- Llama4Maverick = "meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8",
8368
- Llama33_70B = "meta-llama/Llama-3.3-70B-Instruct-Turbo"
8369
- }
8370
- type AxAITogetherChatModel = AxAITogetherModel | (string & {});
8565
+ type AxAIModelCatalogProviderName = AxAIArgs<string>['name'];
8566
+ type AxAIModelCatalogModelCapabilities = {
8567
+ thinkingBudget: boolean;
8568
+ showThoughts: boolean;
8569
+ structuredOutputs: boolean;
8570
+ temperature: boolean;
8571
+ topP: boolean;
8572
+ audioInput: boolean;
8573
+ audioOutput: boolean;
8574
+ };
8575
+ type AxAIModelCatalogAudioSupport = {
8576
+ input?: boolean;
8577
+ output?: boolean;
8578
+ };
8579
+ type AxAIModelCatalogModelType = 'text' | 'embeddings' | 'code' | 'audio';
8580
+ type AxAIModelCatalogFilter = 'all' | AxAIModelCatalogModelType;
8581
+ type AxAIModelCatalogModel = AxModelInfo & {
8582
+ provider: AxAIModelCatalogProviderName;
8583
+ audio?: AxAIModelCatalogAudioSupport;
8584
+ type: AxAIModelCatalogModelType;
8585
+ isDefault: boolean;
8586
+ capabilities: AxAIModelCatalogModelCapabilities;
8587
+ };
8588
+ type AxAIModelCatalogProvider = {
8589
+ name: AxAIModelCatalogProviderName;
8590
+ displayName: string;
8591
+ defaultModel?: string;
8592
+ defaultEmbedModel?: string;
8593
+ isDynamic: boolean;
8594
+ models: AxAIModelCatalogModel[];
8595
+ };
8596
+ type AxAIModelCatalogOptions = {
8597
+ type?: AxAIModelCatalogFilter | readonly AxAIModelCatalogFilter[];
8598
+ };
8599
+ /**
8600
+ * Returns the static Ax AI provider/model catalog.
8601
+ *
8602
+ * The catalog is built from bundled Ax metadata and does not fetch live provider
8603
+ * pricing. Dynamic providers can support arbitrary user-selected models or
8604
+ * deployments, so their model lists are intentionally empty or static-limited.
8605
+ */
8606
+ declare const axGetSupportedAIModels: (options?: Readonly<AxAIModelCatalogOptions>) => AxAIModelCatalogProvider[];
8371
8607
 
8372
- type TogetherAIConfig = AxAIOpenAIConfig<AxAITogetherChatModel, unknown>;
8373
- declare const axAITogetherDefaultConfig: () => TogetherAIConfig;
8374
- type AxAITogetherArgs<TModelKey> = AxAIOpenAIArgs<'together', AxAITogetherChatModel, unknown, TModelKey>;
8375
- declare class AxAITogether<TModelKey> extends AxAIOpenAIBase<AxAITogetherChatModel, unknown, TModelKey> {
8376
- constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAITogetherArgs<TModelKey>, 'name'>>);
8377
- }
8608
+ declare const axModelInfoCohere: AxModelInfo[];
8378
8609
 
8379
- declare const axModelInfoTogether: AxModelInfo[];
8610
+ declare const axModelInfoDeepSeek: AxModelInfo[];
8380
8611
 
8381
- type AxChatRequestMessage = AxChatRequest['chatPrompt'][number];
8382
8612
  /**
8383
- * Validates a chat request message item to ensure it meets the required criteria
8384
- * @param item - The chat request message to validate
8385
- * @throws {Error} When validation fails with a descriptive error message
8613
+ * AxAIGoogleGemini: Model information
8386
8614
  */
8387
- declare function axValidateChatRequestMessage(item: AxChatRequestMessage): void;
8615
+ declare const axModelInfoGoogleGemini: AxModelInfo[];
8616
+
8388
8617
  /**
8389
- * Validates a chat response result to ensure it meets the required criteria
8390
- * @param results - The chat response results to validate (single result or array)
8391
- * @throws {Error} When validation fails with a descriptive error message
8618
+ * AxAIGroq: Model information
8392
8619
  */
8393
- declare function axValidateChatResponseResult(results: Readonly<AxChatResponseResult[]> | Readonly<AxChatResponseResult>): void;
8620
+ declare const axModelInfoGroq: AxModelInfo[];
8394
8621
 
8395
8622
  /**
8396
- * WebLLM: Models for text generation
8397
- * Based on WebLLM's supported models
8623
+ * HuggingFace: Model information
8398
8624
  */
8399
- declare enum AxAIWebLLMModel {
8400
- Llama31_8B_Instruct = "Llama-3.1-8B-Instruct-q4f32_1-MLC",
8401
- Llama31_70B_Instruct = "Llama-3.1-70B-Instruct-q4f16_1-MLC",
8402
- Llama32_1B_Instruct = "Llama-3.2-1B-Instruct-q4f32_1-MLC",
8403
- Llama32_3B_Instruct = "Llama-3.2-3B-Instruct-q4f32_1-MLC",
8404
- Mistral7B_Instruct = "Mistral-7B-Instruct-v0.3-q4f32_1-MLC",
8405
- Phi35_Mini_Instruct = "Phi-3.5-mini-instruct-q4f32_1-MLC",
8406
- Gemma2_2B_Instruct = "gemma-2-2b-it-q4f32_1-MLC",
8407
- Gemma2_9B_Instruct = "gemma-2-9b-it-q4f32_1-MLC",
8408
- Qwen2_5_0_5B_Instruct = "Qwen2.5-0.5B-Instruct-q4f32_1-MLC",
8409
- Qwen2_5_1_5B_Instruct = "Qwen2.5-1.5B-Instruct-q4f32_1-MLC",
8410
- Qwen2_5_3B_Instruct = "Qwen2.5-3B-Instruct-q4f32_1-MLC",
8411
- Qwen2_5_7B_Instruct = "Qwen2.5-7B-Instruct-q4f32_1-MLC"
8625
+ declare const axModelInfoHuggingFace: AxModelInfo[];
8626
+
8627
+ interface AxAIMetricsInstruments {
8628
+ latencyHistogram?: Histogram;
8629
+ errorCounter?: Counter;
8630
+ requestCounter?: Counter;
8631
+ tokenCounter?: Counter;
8632
+ inputTokenCounter?: Counter;
8633
+ outputTokenCounter?: Counter;
8634
+ errorRateGauge?: Gauge;
8635
+ meanLatencyGauge?: Gauge;
8636
+ p95LatencyGauge?: Gauge;
8637
+ p99LatencyGauge?: Gauge;
8638
+ streamingRequestsCounter?: Counter;
8639
+ functionCallsCounter?: Counter;
8640
+ functionCallLatencyHistogram?: Histogram;
8641
+ requestSizeHistogram?: Histogram;
8642
+ responseSizeHistogram?: Histogram;
8643
+ temperatureGauge?: Gauge;
8644
+ maxTokensGauge?: Gauge;
8645
+ estimatedCostCounter?: Counter;
8646
+ promptLengthHistogram?: Histogram;
8647
+ contextWindowUsageGauge?: Gauge;
8648
+ timeoutsCounter?: Counter;
8649
+ abortsCounter?: Counter;
8650
+ thinkingBudgetUsageCounter?: Counter;
8651
+ multimodalRequestsCounter?: Counter;
8652
+ cacheReadTokensCounter?: Counter;
8653
+ cacheWriteTokensCounter?: Counter;
8412
8654
  }
8413
- /**
8414
- * WebLLM: Model options for text generation
8415
- */
8416
- type AxAIWebLLMConfig = AxModelConfig & {
8417
- model: AxAIWebLLMModel;
8418
- logitBias?: Record<number, number>;
8419
- logProbs?: boolean;
8420
- topLogprobs?: number;
8421
- };
8422
- /**
8423
- * WebLLM: Chat request structure
8424
- * Based on OpenAI-compatible API from WebLLM
8425
- */
8426
- type AxAIWebLLMChatRequest = {
8427
- model: AxAIWebLLMModel;
8428
- messages: Array<{
8429
- role: 'system' | 'user' | 'assistant' | 'function';
8430
- content?: string;
8431
- name?: string;
8432
- function_call?: {
8433
- name: string;
8434
- arguments: string;
8435
- };
8436
- }>;
8437
- temperature?: number;
8438
- top_p?: number;
8439
- max_tokens?: number;
8440
- stream?: boolean;
8441
- stop?: string | string[];
8442
- presence_penalty?: number;
8443
- frequency_penalty?: number;
8444
- logit_bias?: Record<number, number>;
8445
- logprobs?: boolean;
8446
- top_logprobs?: number;
8447
- n?: number;
8448
- tools?: Array<{
8449
- type: 'function';
8450
- function: {
8451
- name: string;
8452
- description: string;
8453
- parameters: object;
8454
- };
8455
- }>;
8456
- tool_choice?: 'none' | 'auto' | {
8457
- type: 'function';
8458
- function: {
8459
- name: string;
8460
- };
8655
+
8656
+ declare const axModelInfoMistral: AxModelInfo[];
8657
+
8658
+ type AxMockAIServiceConfig<TModelKey> = {
8659
+ name?: string;
8660
+ id?: string;
8661
+ modelInfo?: Partial<AxModelInfoWithProvider>;
8662
+ embedModelInfo?: AxModelInfoWithProvider;
8663
+ features?: {
8664
+ functions?: boolean;
8665
+ streaming?: boolean;
8666
+ structuredOutputs?: boolean;
8667
+ media?: Partial<AxAIFeatures['media']>;
8461
8668
  };
8669
+ models?: AxAIModelList<TModelKey>;
8670
+ options?: AxAIServiceOptions;
8671
+ chatResponse?: AxChatResponse | ReadableStream<AxChatResponse> | (() => Promise<AxChatResponse | ReadableStream<AxChatResponse>>) | ((req: Readonly<AxChatRequest<unknown>>, options?: Readonly<AxAIServiceOptions>) => Promise<AxChatResponse | ReadableStream<AxChatResponse>>);
8672
+ embedResponse?: AxEmbedResponse | ((req: Readonly<AxEmbedRequest>) => AxEmbedResponse | Promise<AxEmbedResponse>);
8673
+ shouldError?: boolean;
8674
+ errorMessage?: string;
8675
+ latencyMs?: number;
8462
8676
  };
8463
- /**
8464
- * WebLLM: Chat response structure
8465
- */
8466
- type AxAIWebLLMChatResponse = {
8467
- id: string;
8468
- object: 'chat.completion';
8469
- created: number;
8470
- model: AxAIWebLLMModel;
8471
- choices: Array<{
8472
- index: number;
8473
- message: {
8474
- role: 'assistant';
8475
- content?: string;
8476
- tool_calls?: Array<{
8477
- id: string;
8478
- type: 'function';
8479
- function: {
8480
- name: string;
8481
- arguments: string;
8482
- };
8483
- }>;
8484
- };
8485
- finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter';
8486
- logprobs?: {
8487
- content: Array<{
8488
- token: string;
8489
- logprob: number;
8490
- bytes: number[];
8491
- top_logprobs: Array<{
8492
- token: string;
8493
- logprob: number;
8494
- bytes: number[];
8495
- }>;
8496
- }>;
8497
- };
8498
- }>;
8499
- usage: {
8500
- prompt_tokens: number;
8501
- completion_tokens: number;
8502
- total_tokens: number;
8503
- };
8677
+ declare class AxMockAIService<TModelKey> implements AxAIService<unknown, unknown, TModelKey> {
8678
+ private readonly config;
8679
+ private metrics;
8680
+ constructor(config?: AxMockAIServiceConfig<TModelKey>);
8681
+ getLastUsedChatModel(): unknown;
8682
+ getLastUsedEmbedModel(): unknown;
8683
+ getLastUsedModelConfig(): AxModelConfig | undefined;
8684
+ getName(): string;
8685
+ getId(): string;
8686
+ getFeatures(_model?: string): AxAIFeatures;
8687
+ getModelList(): AxAIModelList<TModelKey> | undefined;
8688
+ getMetrics(): AxAIServiceMetrics;
8689
+ getEstimatedCost(): number;
8690
+ chat(req: Readonly<AxChatRequest<unknown>>, _options?: Readonly<AxAIServiceOptions>): Promise<AxChatResponse | ReadableStream<AxChatResponse>>;
8691
+ embed(req: Readonly<AxEmbedRequest>, _options?: Readonly<AxAIServiceOptions>): Promise<AxEmbedResponse>;
8692
+ setOptions(options: Readonly<AxAIServiceOptions>): void;
8693
+ getOptions(): Readonly<AxAIServiceOptions>;
8694
+ getLogger(): AxLoggerFunction;
8695
+ private updateMetrics;
8696
+ }
8697
+
8698
+ type AxAIServiceListItem<TModel = unknown, TEmbedModel = unknown, TModelKey = string> = {
8699
+ key: TModelKey;
8700
+ service: AxAIService<TModel, TEmbedModel, TModelKey>;
8701
+ description: string;
8702
+ isInternal?: boolean;
8504
8703
  };
8704
+ type ExtractServiceModelKeys<T> = T extends AxAIService<any, any, infer K> ? K : T extends AxAIServiceListItem<any, any, infer K> ? K : never;
8705
+ type ExtractAllModelKeys<T extends readonly any[]> = T extends readonly [
8706
+ infer First,
8707
+ ...infer Rest
8708
+ ] ? ExtractServiceModelKeys<First> | ExtractAllModelKeys<Rest> : never;
8709
+ declare class AxMultiServiceRouter<TServices extends readonly (AxAIService | AxAIServiceListItem<any, any, any>)[] = readonly AxAIService[], TModelKey = ExtractAllModelKeys<TServices>> implements AxAIService<unknown, unknown, TModelKey> {
8710
+ private options?;
8711
+ private lastUsedService?;
8712
+ private services;
8713
+ /**
8714
+ * Constructs a new multi-service router.
8715
+ * It validates that each service provides a unique set of model keys,
8716
+ * then builds a lookup (map) for routing the chat/embed requests.
8717
+ */
8718
+ constructor(services: TServices);
8719
+ /**
8720
+ * Static factory method for type-safe multi-service router creation with automatic model key inference.
8721
+ */
8722
+ static create<const TServices extends readonly (AxAIService | AxAIServiceListItem<any, any, any>)[]>(services: TServices): AxMultiServiceRouter<TServices, ExtractAllModelKeys<TServices>>;
8723
+ getLastUsedChatModel(): unknown | undefined;
8724
+ getLastUsedEmbedModel(): unknown | undefined;
8725
+ getLastUsedModelConfig(): AxModelConfig | undefined;
8726
+ /**
8727
+ * Delegates the chat call to the service matching the provided model key.
8728
+ */
8729
+ chat(req: Readonly<AxChatRequest<TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxChatResponse | ReadableStream<AxChatResponse>>;
8730
+ /**
8731
+ * Delegates the embed call to the service matching the provided embed model key.
8732
+ */
8733
+ embed(req: Readonly<AxEmbedRequest<TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxEmbedResponse>;
8734
+ /**
8735
+ * Returns a composite ID built from the IDs of the underlying services.
8736
+ */
8737
+ getId(): string;
8738
+ /**
8739
+ * Returns the name of this router.
8740
+ */
8741
+ getName(): string;
8742
+ /**
8743
+ * Aggregates all available models across the underlying services.
8744
+ */
8745
+ getModelList(): AxAIModelList<TModelKey>;
8746
+ /**
8747
+ * If a model key is provided, delegate to the corresponding service's features.
8748
+ * Otherwise, returns a default feature set.
8749
+ */
8750
+ getFeatures(model?: TModelKey): AxAIFeatures;
8751
+ /**
8752
+ * Returns aggregated metrics from the underlying service.
8753
+ * Uses the metrics from the last service that was used,
8754
+ * or falls back to the first service if none has been used.
8755
+ */
8756
+ getMetrics(): AxAIServiceMetrics;
8757
+ getEstimatedCost(modelUsage?: AxModelUsage): number;
8758
+ /**
8759
+ * Sets options on all underlying services.
8760
+ */
8761
+ setOptions(options: Readonly<AxAIServiceOptions>): void;
8762
+ /**
8763
+ * Returns the options from the last used service,
8764
+ * or falls back to the first service if none has been used.
8765
+ */
8766
+ getOptions(): Readonly<AxAIServiceOptions>;
8767
+ /**
8768
+ * Returns the logger from the last used service,
8769
+ * or falls back to the first service if none has been used.
8770
+ */
8771
+ getLogger(): AxLoggerFunction;
8772
+ /**
8773
+ * Sets a service entry for a given key. This method is intended for testing purposes.
8774
+ * @param key - The model key
8775
+ * @param entry - The service entry to set
8776
+ */
8777
+ setServiceEntry(key: TModelKey, entry: {
8778
+ isInternal?: boolean;
8779
+ description: string;
8780
+ model?: string;
8781
+ embedModel?: string;
8782
+ service: AxAIService<unknown, unknown, TModelKey>;
8783
+ }): void;
8784
+ }
8785
+
8505
8786
  /**
8506
- * WebLLM: Streaming chat response structure
8787
+ * OpenAI: Model information
8507
8788
  */
8508
- type AxAIWebLLMChatResponseDelta = {
8509
- id: string;
8510
- object: 'chat.completion.chunk';
8511
- created: number;
8512
- model: AxAIWebLLMModel;
8513
- choices: Array<{
8514
- index: number;
8515
- delta: {
8516
- role?: 'assistant';
8517
- content?: string;
8518
- tool_calls?: Array<{
8519
- index: number;
8520
- id?: string;
8521
- type?: 'function';
8522
- function?: {
8523
- name?: string;
8524
- arguments?: string;
8525
- };
8526
- }>;
8527
- };
8528
- finish_reason?: 'stop' | 'length' | 'tool_calls' | 'content_filter';
8529
- logprobs?: {
8530
- content: Array<{
8531
- token: string;
8532
- logprob: number;
8533
- bytes: number[];
8534
- top_logprobs: Array<{
8535
- token: string;
8536
- logprob: number;
8537
- bytes: number[];
8538
- }>;
8539
- }>;
8540
- };
8541
- }>;
8542
- usage?: {
8543
- prompt_tokens: number;
8544
- completion_tokens: number;
8545
- total_tokens: number;
8546
- };
8547
- };
8789
+ declare const axModelInfoOpenAI: AxModelInfo[];
8548
8790
  /**
8549
- * WebLLM doesn't support embeddings natively
8550
- * This is a placeholder for consistency with the framework
8791
+ * OpenAI: Model information
8551
8792
  */
8552
- type AxAIWebLLMEmbedModel = never;
8553
- type AxAIWebLLMEmbedRequest = never;
8554
- type AxAIWebLLMEmbedResponse = never;
8793
+ declare const axModelInfoOpenAIResponses: AxModelInfo[];
8555
8794
 
8556
- declare const axAIWebLLMDefaultConfig: () => AxAIWebLLMConfig;
8557
- declare const axAIWebLLMCreativeConfig: () => AxAIWebLLMConfig;
8558
- interface AxAIWebLLMArgs<TModelKey> {
8559
- name: 'webllm';
8560
- engine: any;
8561
- config?: Readonly<Partial<AxAIWebLLMConfig>>;
8562
- options?: Readonly<AxAIServiceOptions>;
8563
- models?: AxAIInputModelList<AxAIWebLLMModel, AxAIWebLLMEmbedModel, TModelKey>;
8564
- }
8565
- declare class AxAIWebLLM<TModelKey> extends AxBaseAI<AxAIWebLLMModel, AxAIWebLLMEmbedModel, AxAIWebLLMChatRequest, AxAIWebLLMEmbedRequest, AxAIWebLLMChatResponse, AxAIWebLLMChatResponseDelta, AxAIWebLLMEmbedResponse, TModelKey> {
8566
- constructor({ engine, config, options, models, }: Readonly<Omit<AxAIWebLLMArgs<TModelKey>, 'name'>>);
8795
+ declare class AxAIOpenAIResponsesImpl<TModel, TEmbedModel, // Kept for interface compatibility, but not used by this impl.
8796
+ TResponsesReq extends AxAIOpenAIResponsesRequest<TModel>> implements AxAIServiceImpl<TModel, TEmbedModel, Readonly<AxAIOpenAIResponsesRequest<TModel>>, // ChatReq (now ResponsesReq)
8797
+ Readonly<AxAIOpenAIEmbedRequest<TEmbedModel>>, // EmbedReq
8798
+ Readonly<AxAIOpenAIResponsesResponse>, // ChatResp (now ResponsesResp)
8799
+ Readonly<AxAIOpenAIResponsesResponseDelta>, // ChatRespDelta (now ResponsesRespDelta)
8800
+ Readonly<AxAIOpenAIEmbedResponse>> {
8801
+ private readonly config;
8802
+ private readonly streamingUsage;
8803
+ private readonly responsesReqUpdater?;
8804
+ private tokensUsed;
8805
+ constructor(config: Readonly<AxAIOpenAIResponsesConfig<TModel, TEmbedModel>>, streamingUsage: boolean, // If /v1/responses supports include_usage for streams
8806
+ responsesReqUpdater?: ResponsesReqUpdater<TModel, TResponsesReq> | undefined);
8807
+ getTokenUsage(): Readonly<AxTokenUsage> | undefined;
8808
+ getModelConfig(): Readonly<AxModelConfig>;
8809
+ private mapInternalContentToResponsesInput;
8810
+ private createResponsesReqInternalInput;
8811
+ createChatReq(req: Readonly<AxInternalChatRequest<TModel>>, config: Readonly<AxAIServiceOptions>): [Readonly<AxAPI>, Readonly<AxAIOpenAIResponsesRequest<TModel>>];
8812
+ createChatResp(resp: Readonly<AxAIOpenAIResponsesResponse>): Readonly<AxChatResponse>;
8813
+ createChatStreamResp: (streamEvent: Readonly<AxAIOpenAIResponsesResponseDelta>) => Readonly<AxChatResponse>;
8814
+ createEmbedReq(req: Readonly<AxInternalEmbedRequest<TEmbedModel>>): [AxAPI, AxAIOpenAIEmbedRequest<TEmbedModel>];
8567
8815
  }
8568
8816
 
8817
+ type OpenAICompatibleUsageDetails = {
8818
+ cached_tokens?: number;
8819
+ reasoning_tokens?: number;
8820
+ };
8821
+ type OpenAICompatibleUsage = {
8822
+ prompt_tokens?: number;
8823
+ input_tokens?: number;
8824
+ completion_tokens?: number;
8825
+ output_tokens?: number;
8826
+ total_tokens?: number;
8827
+ prompt_tokens_details?: OpenAICompatibleUsageDetails;
8828
+ input_tokens_details?: OpenAICompatibleUsageDetails;
8829
+ completion_tokens_details?: OpenAICompatibleUsageDetails;
8830
+ output_tokens_details?: OpenAICompatibleUsageDetails;
8831
+ };
8832
+ declare const axNormalizeOpenAIUsage: (usage?: Readonly<OpenAICompatibleUsage> | null) => AxTokenUsage | undefined;
8833
+
8569
8834
  /**
8570
- * WebLLM model information
8571
- * Note: WebLLM runs models locally in the browser, so there are no API costs
8572
- * However, we include context window and capability information
8835
+ * OpenAI: Model information
8573
8836
  */
8574
- declare const axModelInfoWebLLM: AxModelInfo[];
8575
-
8576
- declare enum AxAIGrokModel {
8577
- Grok3 = "grok-3",
8578
- Grok3Mini = "grok-3-mini",
8579
- Grok3Fast = "grok-3-fast",
8580
- Grok3MiniFast = "grok-3-mini-fast"
8581
- }
8582
- declare enum AxAIGrokEmbedModels {
8583
- GrokEmbedSmall = "grok-embed-small"
8584
- }
8837
+ declare const axModelInfoReka: AxModelInfo[];
8585
8838
 
8586
- declare const axAIGrokDefaultConfig: () => AxAIOpenAIConfig<AxAIGrokModel, AxAIGrokEmbedModels>;
8587
- declare const axAIGrokBestConfig: () => AxAIOpenAIConfig<AxAIGrokModel, AxAIGrokEmbedModels>;
8588
- interface AxAIGrokSearchSource {
8589
- type: 'web' | 'x' | 'news' | 'rss';
8590
- country?: string;
8591
- excludedWebsites?: string[];
8592
- allowedWebsites?: string[];
8593
- safeSearch?: boolean;
8594
- xHandles?: string[];
8595
- links?: string[];
8596
- }
8597
- interface AxAIGrokOptionsTools {
8598
- searchParameters?: {
8599
- mode?: 'auto' | 'on' | 'off';
8600
- returnCitations?: boolean;
8601
- fromDate?: string;
8602
- toDate?: string;
8603
- maxSearchResults?: number;
8604
- sources?: AxAIGrokSearchSource[];
8605
- };
8839
+ /**
8840
+ * Services for converting unsupported content types to text or optimized formats
8841
+ */
8842
+ interface AxContentProcessingServices {
8843
+ /** Service to convert images to text descriptions */
8844
+ imageToText?: (imageData: string) => Promise<string>;
8845
+ /** Service to convert audio to text transcriptions */
8846
+ audioToText?: (audioData: string, format?: string) => Promise<string>;
8847
+ /** Service to extract text from files */
8848
+ fileToText?: (fileData: string, mimeType: string) => Promise<string>;
8849
+ /** Service to fetch and extract text from URLs */
8850
+ urlToText?: (url: string) => Promise<string>;
8851
+ /** Service to optimize images for size/quality */
8852
+ imageOptimization?: (imageData: string, options: OptimizationOptions) => Promise<string>;
8606
8853
  }
8607
- type AxAIGrokChatRequest = AxAIOpenAIChatRequest<AxAIGrokModel> & {
8608
- search_parameters?: {
8609
- mode?: 'auto' | 'on' | 'off';
8610
- return_citations?: boolean;
8611
- from_date?: string;
8612
- to_date?: string;
8613
- max_search_results?: number;
8614
- sources?: AxAIGrokSearchSource[];
8615
- };
8616
- };
8617
- type AxAIGrokArgs<TModelKey> = AxAIOpenAIArgs<'grok', AxAIGrokModel, AxAIGrokEmbedModels, TModelKey, AxAIGrokChatRequest> & {
8618
- options?: Readonly<AxAIServiceOptions & AxAIGrokOptionsTools> & {
8619
- tokensPerMinute?: number;
8620
- };
8621
- modelInfo?: AxModelInfo[];
8622
- };
8623
- declare class AxAIGrok<TModelKey> extends AxAIOpenAIBase<AxAIGrokModel, AxAIGrokEmbedModels, TModelKey, AxAIGrokChatRequest> {
8624
- constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIGrokArgs<TModelKey>, 'name'>>);
8854
+ /**
8855
+ * Options for image optimization processing
8856
+ */
8857
+ interface OptimizationOptions {
8858
+ /** Image quality (0-100) */
8859
+ quality?: number;
8860
+ /** Maximum file size in bytes */
8861
+ maxSize?: number;
8862
+ /** Target image format */
8863
+ format?: 'jpeg' | 'png' | 'webp';
8625
8864
  }
8626
-
8627
- type AxAIArgs<TModelKey> = AxAIOpenAIArgs<'openai', AxAIOpenAIModel, AxAIOpenAIEmbedModel, TModelKey> | AxAIOpenAIResponsesArgs<'openai-responses', AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel, TModelKey> | AxAIAzureOpenAIArgs<TModelKey> | AxAITogetherArgs<TModelKey> | AxAIOpenRouterArgs<TModelKey> | AxAIAnthropicArgs<TModelKey> | AxAIGroqArgs<TModelKey> | AxAIGoogleGeminiArgs<TModelKey> | AxAICohereArgs<TModelKey> | AxAIHuggingFaceArgs<TModelKey> | AxAIMistralArgs<TModelKey> | AxAIDeepSeekArgs<TModelKey> | AxAIOllamaArgs<TModelKey> | AxAIRekaArgs<TModelKey> | AxAIGrokArgs<TModelKey> | AxAIWebLLMArgs<TModelKey>;
8628
- type AxAIModels = AxAIOpenAIModel | AxAIAnthropicModel | AxAIGroqModel | AxAIGoogleGeminiModel | AxAICohereModel | AxAIHuggingFaceModel | AxAIMistralModel | AxAIDeepSeekModel | AxAIGrokModel | AxAIWebLLMModel;
8629
- type AxAIEmbedModels = AxAIOpenAIEmbedModel | AxAIGoogleGeminiEmbedModel | AxAICohereEmbedModel;
8630
- type ExtractModelKeysAndValues<T> = T extends readonly {
8631
- key: infer K;
8632
- model: infer M;
8633
- }[] ? K | M : never;
8634
- type InferTModelKey<T> = T extends {
8635
- models: infer M;
8636
- } ? ExtractModelKeysAndValues<M> : string;
8637
8865
  /**
8638
- * Factory function for creating AI service instances with full type safety.
8639
- *
8640
- * This is the recommended way to create AI instances. It automatically selects
8641
- * the appropriate provider implementation based on the `name` field and provides
8642
- * type-safe access to provider-specific models.
8643
- *
8644
- * **Supported Providers:**
8645
- * - `'openai'` - OpenAI (GPT-4, GPT-4o, o1, o3, etc.)
8646
- * - `'openai-responses'` - OpenAI Responses API (for web search, file search)
8647
- * - `'anthropic'` - Anthropic (Claude 3.5 Sonnet, Claude 3 Opus, etc.)
8648
- * - `'google-gemini'` - Google (Gemini 1.5 Pro, Gemini 2.0 Flash, etc.)
8649
- * - `'azure-openai'` - Azure OpenAI Service
8650
- * - `'groq'` - Groq (Llama, Mixtral with fast inference)
8651
- * - `'cohere'` - Cohere (Command R+, embeddings)
8652
- * - `'mistral'` - Mistral AI (Mistral Large, Codestral)
8653
- * - `'deepseek'` - DeepSeek (DeepSeek-V3, DeepSeek-R1)
8654
- * - `'together'` - Together AI (various open models)
8655
- * - `'openrouter'` - OpenRouter (unified API for many providers)
8656
- * - `'ollama'` - Ollama (local models)
8657
- * - `'huggingface'` - Hugging Face Inference API
8658
- * - `'reka'` - Reka AI
8659
- * - `'grok'` - xAI Grok
8660
- * - `'webllm'` - WebLLM (browser-based inference)
8661
- *
8662
- * @param options - Provider-specific configuration. Must include `name` to identify the provider.
8663
- * @param options.name - The provider identifier (see list above)
8664
- * @param options.apiKey - API key for the provider (not needed for Ollama/WebLLM)
8665
- * @param options.config - Optional default model configuration (maxTokens, temperature, etc.)
8666
- * @param options.models - Optional custom model aliases for type-safe model selection
8667
- *
8668
- * @returns A configured AI service instance ready for chat completions and embeddings
8669
- *
8670
- * @see {@link AxModelConfig} for model configuration options
8671
- * @see {@link AxAIServiceOptions} for runtime options like streaming and function calling
8866
+ * Configuration for multi-provider routing with fallback capabilities
8867
+ */
8868
+ interface AxMultiProviderConfig {
8869
+ /** Provider hierarchy for routing */
8870
+ providers: {
8871
+ /** Primary provider to try first */
8872
+ primary: AxAIService;
8873
+ /** Alternative providers for fallback */
8874
+ alternatives: AxAIService[];
8875
+ };
8876
+ /** Routing behavior configuration */
8877
+ routing: {
8878
+ /** Order of preferences when selecting providers */
8879
+ preferenceOrder: ('capability' | 'cost' | 'speed' | 'quality')[];
8880
+ /** Capability matching requirements */
8881
+ capability: {
8882
+ /** Only use providers with full capability support */
8883
+ requireExactMatch: boolean;
8884
+ /** Allow providers that require content processing fallbacks */
8885
+ allowDegradation: boolean;
8886
+ };
8887
+ };
8888
+ /** Content processing services for unsupported media types */
8889
+ processing: AxContentProcessingServices;
8890
+ }
8891
+ /**
8892
+ * Result of the routing process including provider selection and processing information
8893
+ */
8894
+ interface AxRoutingResult {
8895
+ /** The selected AI service provider */
8896
+ provider: AxAIService;
8897
+ /** List of content processing steps that were applied */
8898
+ processingApplied: string[];
8899
+ /** List of capability degradations that occurred */
8900
+ degradations: string[];
8901
+ /** Non-critical warnings about the routing decision */
8902
+ warnings: string[];
8903
+ }
8904
+ /**
8905
+ * Multi-provider router that automatically selects optimal AI providers and handles content processing.
8672
8906
  *
8673
- * @example Basic OpenAI setup
8674
- * ```typescript
8675
- * const ai = ai({
8676
- * name: 'openai',
8677
- * apiKey: process.env.OPENAI_API_KEY
8678
- * });
8679
- * ```
8907
+ * The router analyzes requests to determine capability requirements, scores available providers,
8908
+ * and automatically handles content transformation for unsupported media types. It provides
8909
+ * graceful degradation and fallback mechanisms for robust multi-modal AI applications.
8680
8910
  *
8681
- * @example Anthropic with custom defaults
8911
+ * @example
8682
8912
  * ```typescript
8683
- * const ai = ai({
8684
- * name: 'anthropic',
8685
- * apiKey: process.env.ANTHROPIC_API_KEY,
8686
- * config: {
8687
- * model: 'claude-sonnet-4-20250514',
8688
- * maxTokens: 4096,
8689
- * temperature: 0.7
8913
+ * const router = new AxProviderRouter({
8914
+ * providers: {
8915
+ * primary: openaiProvider,
8916
+ * alternatives: [geminiProvider, cohereProvider]
8917
+ * },
8918
+ * routing: {
8919
+ * preferenceOrder: ['capability', 'quality'],
8920
+ * capability: {
8921
+ * requireExactMatch: false,
8922
+ * allowDegradation: true
8923
+ * }
8924
+ * },
8925
+ * processing: {
8926
+ * imageToText: async (data) => await visionService.describe(data),
8927
+ * audioToText: async (data) => await speechService.transcribe(data)
8690
8928
  * }
8691
8929
  * });
8692
- * ```
8693
- *
8694
- * @example Google Gemini with model aliases
8695
- * ```typescript
8696
- * const ai = ai({
8697
- * name: 'google-gemini',
8698
- * apiKey: process.env.GOOGLE_API_KEY,
8699
- * models: [
8700
- * { key: 'fast', model: 'gemini-2.0-flash' },
8701
- * { key: 'smart', model: 'gemini-1.5-pro' }
8702
- * ]
8703
- * });
8704
- * // Now use ai with model: 'fast' or model: 'smart'
8705
- * ```
8706
8930
  *
8707
- * @example Local models with Ollama
8708
- * ```typescript
8709
- * const ai = ai({
8710
- * name: 'ollama',
8711
- * config: { model: 'llama3.2' }
8712
- * });
8931
+ * const result = await router.chat(multiModalRequest);
8932
+ * console.log(`Used: ${result.routing.provider.getName()}`);
8713
8933
  * ```
8714
8934
  */
8715
- declare function ai<const T extends AxAIArgs<any>>(options: T): AxAI<InferTModelKey<T>>;
8716
- declare class AxAI<TModelKey = string> implements AxAIService<any, any, TModelKey> {
8717
- private ai;
8718
- static create<const T extends AxAIArgs<any>>(options: T): AxAI<InferTModelKey<T>>;
8935
+ declare class AxProviderRouter {
8936
+ private providers;
8937
+ private processingServices;
8938
+ private config;
8719
8939
  /**
8720
- * @deprecated Use `AxAI.create()` or `ai()` function instead for better type safety.
8721
- * This constructor will be removed in v15.0.0.
8940
+ * Creates a new provider router with the specified configuration.
8722
8941
  *
8723
- * Migration timeline:
8724
- * - v13.0.24+: Deprecation warnings (current)
8725
- * - v14.0.0: Runtime console warnings
8726
- * - v15.0.0: Complete removal
8942
+ * @param config - Router configuration including providers, routing preferences, and processing services
8943
+ */
8944
+ constructor(config: AxMultiProviderConfig);
8945
+ /**
8946
+ * Routes a chat request to the most appropriate provider with automatic content processing.
8947
+ *
8948
+ * This method analyzes the request, selects the optimal provider, preprocesses content
8949
+ * for compatibility, and executes the request with fallback support.
8950
+ *
8951
+ * @param request - The chat request to process
8952
+ * @param options - Extended options including fallback providers and routing preferences
8953
+ * @param options.fallbackProviders - Additional providers to try if primary selection fails
8954
+ * @param options.processingOptions - Content processing options and conversion services
8955
+ * @param options.routingOptions - Provider selection and routing behavior options
8956
+ * @param options.routingOptions.requireExactMatch - Only use providers with full capability support
8957
+ * @param options.routingOptions.allowDegradation - Allow content processing for unsupported types
8958
+ * @param options.routingOptions.maxRetries - Maximum number of fallback providers to try
8959
+ * @returns Promise resolving to the AI response and routing information
8960
+ * @throws AxMediaNotSupportedError when no suitable provider can handle the request
8727
8961
  *
8728
8962
  * @example
8729
8963
  * ```typescript
8730
- * // Instead of: new AxAI({ name: 'openai', apiKey: '...' })
8731
- * // Use: AxAI.create({ name: 'openai', apiKey: '...' })
8732
- * // Or: ai({ name: 'openai', apiKey: '...' })
8964
+ * const result = await router.chat(
8965
+ * { chatPrompt: [{ role: 'user', content: [{ type: 'image', image: '...' }] }] },
8966
+ * {
8967
+ * processingOptions: { fallbackBehavior: 'degrade' },
8968
+ * routingOptions: { allowDegradation: true }
8969
+ * }
8970
+ * );
8971
+ *
8972
+ * console.log(`Provider: ${result.routing.provider.getName()}`);
8973
+ * console.log(`Processing applied: ${result.routing.processingApplied}`);
8733
8974
  * ```
8734
8975
  */
8735
- constructor(options: Readonly<AxAIArgs<TModelKey>>);
8736
- getName(): string;
8737
- getId(): string;
8738
- getFeatures(model?: string): AxAIFeatures;
8739
- getModelList(): AxAIModelList<TModelKey> | undefined;
8740
- getLastUsedChatModel(): any;
8741
- getLastUsedEmbedModel(): any;
8742
- getLastUsedModelConfig(): AxModelConfig | undefined;
8743
- getMetrics(): AxAIServiceMetrics;
8744
- getEstimatedCost(modelUsage?: AxModelUsage): number;
8745
- chat(req: Readonly<AxChatRequest<TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxChatResponse | ReadableStream<AxChatResponse>>;
8746
- embed(req: Readonly<AxEmbedRequest<TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxEmbedResponse>;
8747
- setOptions(options: Readonly<AxAIServiceOptions>): void;
8748
- getOptions(): Readonly<AxAIServiceOptions>;
8749
- getLogger(): AxLoggerFunction;
8976
+ chat(request: AxChatRequest, options?: AxAIServiceOptions & {
8977
+ fallbackProviders?: AxAIService[];
8978
+ processingOptions?: ProcessingOptions;
8979
+ routingOptions?: {
8980
+ requireExactMatch?: boolean;
8981
+ allowDegradation?: boolean;
8982
+ maxRetries?: number;
8983
+ };
8984
+ }): Promise<{
8985
+ response: AxChatResponse | ReadableStream<AxChatResponse>;
8986
+ routing: AxRoutingResult;
8987
+ }>;
8988
+ /**
8989
+ * Preprocesses request content for the target provider
8990
+ */
8991
+ private preprocessRequest;
8992
+ /**
8993
+ * Selects provider with graceful degradation
8994
+ */
8995
+ private selectProviderWithDegradation;
8996
+ /**
8997
+ * Tries fallback providers when primary provider fails
8998
+ */
8999
+ private tryFallbackProviders;
9000
+ /**
9001
+ * Gets routing recommendation without executing the request.
9002
+ *
9003
+ * Analyzes the request and returns routing information including which provider
9004
+ * would be selected, what processing would be applied, and any degradations or warnings.
9005
+ *
9006
+ * @param request - The chat request to analyze
9007
+ * @returns Promise resolving to routing result with provider selection and processing info
9008
+ *
9009
+ * @example
9010
+ * ```typescript
9011
+ * const recommendation = await router.getRoutingRecommendation(request);
9012
+ * console.log(`Would use: ${recommendation.provider.getName()}`);
9013
+ * console.log(`Degradations: ${recommendation.degradations.join(', ')}`);
9014
+ * ```
9015
+ */
9016
+ getRoutingRecommendation(request: AxChatRequest): Promise<AxRoutingResult>;
9017
+ /**
9018
+ * Validates whether the configured providers can handle a specific request.
9019
+ *
9020
+ * Performs pre-flight validation to check if the request can be successfully
9021
+ * processed by available providers, identifies potential issues, and provides
9022
+ * recommendations for improving compatibility.
9023
+ *
9024
+ * @param request - The chat request to validate
9025
+ * @returns Promise resolving to validation result with handling capability and recommendations
9026
+ *
9027
+ * @example
9028
+ * ```typescript
9029
+ * const validation = await router.validateRequest(request);
9030
+ * if (!validation.canHandle) {
9031
+ * console.log('Issues:', validation.issues);
9032
+ * console.log('Recommendations:', validation.recommendations);
9033
+ * }
9034
+ * ```
9035
+ */
9036
+ validateRequest(request: AxChatRequest): Promise<{
9037
+ canHandle: boolean;
9038
+ issues: string[];
9039
+ recommendations: string[];
9040
+ }>;
9041
+ /**
9042
+ * Gets detailed statistics about the router's provider capabilities.
9043
+ *
9044
+ * Returns information about available providers, their supported capabilities,
9045
+ * and routing recommendations for analysis and debugging purposes.
9046
+ *
9047
+ * @returns Object containing provider statistics and capability matrix
9048
+ *
9049
+ * @example
9050
+ * ```typescript
9051
+ * const stats = router.getRoutingStats();
9052
+ * console.log(`Total providers: ${stats.totalProviders}`);
9053
+ * console.log('Capabilities:');
9054
+ * for (const [capability, providers] of Object.entries(stats.capabilityMatrix)) {
9055
+ * console.log(` ${capability}: ${providers.join(', ')}`);
9056
+ * }
9057
+ * ```
9058
+ */
9059
+ getRoutingStats(): {
9060
+ totalProviders: number;
9061
+ capabilityMatrix: {
9062
+ [capability: string]: string[];
9063
+ };
9064
+ recommendedProvider: string;
9065
+ };
8750
9066
  }
8751
9067
 
9068
+ declare const axModelInfoTogether: AxModelInfo[];
9069
+
9070
+ type AxChatRequestMessage = AxChatRequest['chatPrompt'][number];
9071
+ /**
9072
+ * Validates a chat request message item to ensure it meets the required criteria
9073
+ * @param item - The chat request message to validate
9074
+ * @throws {Error} When validation fails with a descriptive error message
9075
+ */
9076
+ declare function axValidateChatRequestMessage(item: AxChatRequestMessage): void;
9077
+ /**
9078
+ * Validates a chat response result to ensure it meets the required criteria
9079
+ * @param results - The chat response results to validate (single result or array)
9080
+ * @throws {Error} When validation fails with a descriptive error message
9081
+ */
9082
+ declare function axValidateChatResponseResult(results: Readonly<AxChatResponseResult[]> | Readonly<AxChatResponseResult>): void;
9083
+
9084
+ /**
9085
+ * WebLLM model information
9086
+ * Note: WebLLM runs models locally in the browser, so there are no API costs
9087
+ * However, we include context window and capability information
9088
+ */
9089
+ declare const axModelInfoWebLLM: AxModelInfo[];
9090
+
8752
9091
  declare const axModelInfoGrok: AxModelInfo[];
8753
9092
 
8754
9093
  type AxDBUpsertRequest = {
@@ -8991,6 +9330,11 @@ declare class AxSimpleClassifier {
8991
9330
  }>): void;
8992
9331
  }
8993
9332
 
9333
+ type AxDateRange = {
9334
+ start: Date;
9335
+ end: Date;
9336
+ };
9337
+
8994
9338
  /**
8995
9339
  * Calculates the Exact Match (EM) score between a prediction and ground truth.
8996
9340
  *
@@ -10056,6 +10400,8 @@ declare function s<const T extends string>(signature: T): AxSignature<ParseSigna
10056
10400
  * - `json` - Arbitrary JSON objects
10057
10401
  * - `date` - Date in YYYY-MM-DD format
10058
10402
  * - `datetime` - ISO 8601 datetime
10403
+ * - `dateRange` - date range with start/end dates
10404
+ * - `datetimeRange` - datetime range with start/end datetimes
10059
10405
  * - `code` - Code blocks (preserves formatting)
10060
10406
  * - `image` - Image input (for multimodal models)
10061
10407
  * - `audio` - Audio input
@@ -12396,4 +12742,4 @@ declare class AxRateLimiterTokenUsage {
12396
12742
  acquire(tokens: number): Promise<void>;
12397
12743
  }
12398
12744
 
12399
- export { AxACE, type AxACEBullet, type AxACECuratorOperation, type AxACECuratorOperationType, type AxACECuratorOutput, type AxACEFeedbackEvent, type AxACEGeneratorOutput, type AxACEOptimizationArtifact, AxACEOptimizedProgram, type AxACEOptions, type AxACEPlaybook, type AxACEReflectionOutput, type AxACEResult, AxAI, AxAIAnthropic, type AxAIAnthropicArgs, type AxAIAnthropicChatError, type AxAIAnthropicChatRequest, type AxAIAnthropicChatRequestCacheParam, type AxAIAnthropicChatResponse, type AxAIAnthropicChatResponseDelta, type AxAIAnthropicConfig, type AxAIAnthropicContentBlockDeltaEvent, type AxAIAnthropicContentBlockStartEvent, type AxAIAnthropicContentBlockStopEvent, type AxAIAnthropicEffortLevel, type AxAIAnthropicEffortLevelMapping, type AxAIAnthropicErrorEvent, type AxAIAnthropicFunctionTool, type AxAIAnthropicMessageDeltaEvent, type AxAIAnthropicMessageStartEvent, type AxAIAnthropicMessageStopEvent, AxAIAnthropicModel, type AxAIAnthropicOutputConfig, type AxAIAnthropicPingEvent, type AxAIAnthropicRequestTool, type AxAIAnthropicThinkingConfig, type AxAIAnthropicThinkingTokenBudgetLevels, type AxAIAnthropicThinkingWire, AxAIAnthropicVertexModel, type AxAIAnthropicWebSearchTool, type AxAIArgs, AxAIAzureOpenAI, type AxAIAzureOpenAIArgs, type AxAIAzureOpenAIConfig, AxAICohere, type AxAICohereArgs, type AxAICohereChatRequest, type AxAICohereChatRequestToolResults, type AxAICohereChatResponse, type AxAICohereChatResponseDelta, type AxAICohereChatResponseToolCalls, type AxAICohereConfig, AxAICohereEmbedModel, type AxAICohereEmbedRequest, type AxAICohereEmbedResponse, AxAICohereModel, AxAIDeepSeek, type AxAIDeepSeekArgs, AxAIDeepSeekModel, type AxAIEmbedModels, type AxAIFeatures, AxAIGoogleGemini, type AxAIGoogleGeminiArgs, type AxAIGoogleGeminiBatchEmbedRequest, type AxAIGoogleGeminiBatchEmbedResponse, type AxAIGoogleGeminiCacheCreateRequest, type AxAIGoogleGeminiCacheResponse, type AxAIGoogleGeminiCacheUpdateRequest, type AxAIGoogleGeminiChatRequest, type AxAIGoogleGeminiChatResponse, type AxAIGoogleGeminiChatResponseDelta, type AxAIGoogleGeminiConfig, type AxAIGoogleGeminiContent, type AxAIGoogleGeminiContentPart, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiEmbedTypes, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, type AxAIGoogleGeminiRetrievalConfig, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiThinkingConfig, type AxAIGoogleGeminiThinkingLevel, type AxAIGoogleGeminiThinkingLevelMapping, type AxAIGoogleGeminiThinkingTokenBudgetLevels, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, type AxAIGoogleGeminiToolGoogleMaps, type AxAIGoogleGeminiToolGoogleSearchRetrieval, type AxAIGoogleVertexBatchEmbedRequest, type AxAIGoogleVertexBatchEmbedResponse, AxAIGrok, type AxAIGrokArgs, type AxAIGrokChatRequest, AxAIGrokEmbedModels, AxAIGrokModel, type AxAIGrokOptionsTools, type AxAIGrokSearchSource, AxAIGroq, type AxAIGroqArgs, AxAIGroqModel, AxAIHuggingFace, type AxAIHuggingFaceArgs, type AxAIHuggingFaceConfig, AxAIHuggingFaceModel, type AxAIHuggingFaceRequest, type AxAIHuggingFaceResponse, type AxAIInputModelList, type AxAIMemory, type AxAIMetricsInstruments, AxAIMistral, type AxAIMistralArgs, type AxAIMistralChatRequest, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, type AxAIModelListBase, type AxAIModels, AxAIOllama, type AxAIOllamaAIConfig, type AxAIOllamaArgs, AxAIOpenAI, type AxAIOpenAIAnnotation, type AxAIOpenAIArgs, AxAIOpenAIBase, type AxAIOpenAIBaseArgs, type AxAIOpenAIChatRequest, type AxAIOpenAIChatResponse, type AxAIOpenAIChatResponseDelta, type AxAIOpenAIConfig, AxAIOpenAIEmbedModel, type AxAIOpenAIEmbedRequest, type AxAIOpenAIEmbedResponse, type AxAIOpenAILogprob, AxAIOpenAIModel, type AxAIOpenAIResponseDelta, AxAIOpenAIResponses, type AxAIOpenAIResponsesArgs, AxAIOpenAIResponsesBase, type AxAIOpenAIResponsesCodeInterpreterToolCall, type AxAIOpenAIResponsesComputerToolCall, type AxAIOpenAIResponsesConfig, type AxAIOpenAIResponsesContentPartAddedEvent, type AxAIOpenAIResponsesContentPartDoneEvent, type AxAIOpenAIResponsesDefineFunctionTool, type AxAIOpenAIResponsesErrorEvent, type AxAIOpenAIResponsesFileSearchCallCompletedEvent, type AxAIOpenAIResponsesFileSearchCallInProgressEvent, type AxAIOpenAIResponsesFileSearchCallSearchingEvent, type AxAIOpenAIResponsesFileSearchToolCall, type AxAIOpenAIResponsesFunctionCallArgumentsDeltaEvent, type AxAIOpenAIResponsesFunctionCallArgumentsDoneEvent, type AxAIOpenAIResponsesFunctionCallItem, type AxAIOpenAIResponsesImageGenerationCallCompletedEvent, type AxAIOpenAIResponsesImageGenerationCallGeneratingEvent, type AxAIOpenAIResponsesImageGenerationCallInProgressEvent, type AxAIOpenAIResponsesImageGenerationCallPartialImageEvent, type AxAIOpenAIResponsesImageGenerationToolCall, AxAIOpenAIResponsesImpl, type AxAIOpenAIResponsesInputAudioContentPart, type AxAIOpenAIResponsesInputContentPart, type AxAIOpenAIResponsesInputFunctionCallItem, type AxAIOpenAIResponsesInputFunctionCallOutputItem, type AxAIOpenAIResponsesInputImageUrlContentPart, type AxAIOpenAIResponsesInputItem, type AxAIOpenAIResponsesInputMessageItem, type AxAIOpenAIResponsesInputTextContentPart, type AxAIOpenAIResponsesLocalShellToolCall, type AxAIOpenAIResponsesMCPCallArgumentsDeltaEvent, type AxAIOpenAIResponsesMCPCallArgumentsDoneEvent, type AxAIOpenAIResponsesMCPCallCompletedEvent, type AxAIOpenAIResponsesMCPCallFailedEvent, type AxAIOpenAIResponsesMCPCallInProgressEvent, type AxAIOpenAIResponsesMCPListToolsCompletedEvent, type AxAIOpenAIResponsesMCPListToolsFailedEvent, type AxAIOpenAIResponsesMCPListToolsInProgressEvent, type AxAIOpenAIResponsesMCPToolCall, AxAIOpenAIResponsesModel, type AxAIOpenAIResponsesOutputItem, type AxAIOpenAIResponsesOutputItemAddedEvent, type AxAIOpenAIResponsesOutputItemDoneEvent, type AxAIOpenAIResponsesOutputMessageItem, type AxAIOpenAIResponsesOutputRefusalContentPart, type AxAIOpenAIResponsesOutputTextAnnotationAddedEvent, type AxAIOpenAIResponsesOutputTextContentPart, type AxAIOpenAIResponsesOutputTextDeltaEvent, type AxAIOpenAIResponsesOutputTextDoneEvent, type AxAIOpenAIResponsesReasoningDeltaEvent, type AxAIOpenAIResponsesReasoningDoneEvent, type AxAIOpenAIResponsesReasoningItem, type AxAIOpenAIResponsesReasoningSummaryDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryDoneEvent, type AxAIOpenAIResponsesReasoningSummaryPart, type AxAIOpenAIResponsesReasoningSummaryPartAddedEvent, type AxAIOpenAIResponsesReasoningSummaryPartDoneEvent, type AxAIOpenAIResponsesReasoningSummaryTextDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryTextDoneEvent, type AxAIOpenAIResponsesRefusalDeltaEvent, type AxAIOpenAIResponsesRefusalDoneEvent, type AxAIOpenAIResponsesRequest, type AxAIOpenAIResponsesResponse, type AxAIOpenAIResponsesResponseCompletedEvent, type AxAIOpenAIResponsesResponseCreatedEvent, type AxAIOpenAIResponsesResponseDelta, type AxAIOpenAIResponsesResponseFailedEvent, type AxAIOpenAIResponsesResponseInProgressEvent, type AxAIOpenAIResponsesResponseIncompleteEvent, type AxAIOpenAIResponsesResponseQueuedEvent, type AxAIOpenAIResponsesStreamEvent, type AxAIOpenAIResponsesStreamEventBase, type AxAIOpenAIResponsesToolCall, type AxAIOpenAIResponsesToolCallBase, type AxAIOpenAIResponsesToolChoice, type AxAIOpenAIResponsesToolDefinition, type AxAIOpenAIResponsesWebSearchCallCompletedEvent, type AxAIOpenAIResponsesWebSearchCallInProgressEvent, type AxAIOpenAIResponsesWebSearchCallSearchingEvent, type AxAIOpenAIResponsesWebSearchToolCall, type AxAIOpenAIUrlCitation, type AxAIOpenAIUsage, AxAIOpenRouter, type AxAIOpenRouterArgs, AxAIRefusalError, AxAIReka, type AxAIRekaArgs, type AxAIRekaChatRequest, type AxAIRekaChatResponse, type AxAIRekaChatResponseDelta, type AxAIRekaConfig, AxAIRekaModel, type AxAIRekaUsage, type AxAIService, AxAIServiceAbortedError, type AxAIServiceActionOptions, AxAIServiceAuthenticationError, AxAIServiceError, type AxAIServiceImpl, type AxAIServiceMetrics, type AxAIServiceModelType, AxAIServiceNetworkError, type AxAIServiceOptions, AxAIServiceResponseError, AxAIServiceStatusError, AxAIServiceStreamTerminatedError, AxAIServiceTimeoutError, AxAITogether, type AxAITogetherArgs, type AxAITogetherChatModel, AxAITogetherModel, AxAIWebLLM, type AxAIWebLLMArgs, type AxAIWebLLMChatRequest, type AxAIWebLLMChatResponse, type AxAIWebLLMChatResponseDelta, type AxAIWebLLMConfig, type AxAIWebLLMEmbedModel, type AxAIWebLLMEmbedRequest, type AxAIWebLLMEmbedResponse, AxAIWebLLMModel, type AxAPI, type AxAPIConfig, AxAgent, type AxAgentClarification, type AxAgentClarificationChoice, AxAgentClarificationError, type AxAgentClarificationKind, type AxAgentCompletionProtocol, type AxAgentConfig, type AxAgentDemos, type AxAgentDiscoveryPromptState, type AxAgentEvalDataset, type AxAgentEvalFunctionCall, type AxAgentEvalPrediction, type AxAgentEvalTask, type AxAgentExecutorResultPayload, type AxAgentExecutorTurnCallbackArgs, type AxAgentForwardOptions, type AxAgentFunction, type AxAgentFunctionCall, type AxAgentFunctionCallRecorder, type AxAgentFunctionCollection, type AxAgentFunctionExample, type AxAgentFunctionGroup, type AxAgentFunctionModuleMeta, type AxAgentGuidanceLogEntry, type AxAgentGuidancePayload, type AxAgentGuidanceState, type AxAgentIdentity, type AxAgentInputUpdateCallback, type AxAgentInternalCompletionPayload, type AxAgentJudgeEvalInput, type AxAgentJudgeEvalOutput, type AxAgentJudgeInput, type AxAgentJudgeOptions, type AxAgentJudgeOutput, type AxAgentMemoriesSearchFn, type AxAgentMemoryEntry, type AxAgentMemoryResult, type AxAgentOnFunctionCall, type AxAgentOptimizationTargetDescriptor, type AxAgentOptimizeOptions, type AxAgentOptimizeResult, type AxAgentOptimizeTarget, type AxAgentOptions, AxAgentProtocolCompletionSignal, type AxAgentRecursionOptions, type AxAgentRecursiveExpensiveNode, type AxAgentRecursiveFunctionCall, type AxAgentRecursiveNodeRole, type AxAgentRecursiveStats, type AxAgentRecursiveTargetId, type AxAgentRecursiveTraceNode, type AxAgentRecursiveTurn, type AxAgentRecursiveUsage, type AxAgentRuntimeCompletionState, type AxAgentRuntimeExecutionContext, type AxAgentRuntimeInputState, type AxAgentSkillResult, type AxAgentSkillsPromptState, type AxAgentSkillsSearchFn, type AxAgentState, type AxAgentStateActionLogEntry, type AxAgentStateCheckpointState, type AxAgentStateExecutorModelState, type AxAgentStateRuntimeEntry, type AxAgentStreamingForwardOptions, type AxAgentStructuredClarification, type AxAgentTestCompletionPayload, type AxAgentTestResult, type AxAgentUsage, type AxAgentic, type AxAnyAgentic, AxApacheTika, type AxApacheTikaArgs, type AxApacheTikaConvertOptions, type AxAssertion, AxAssertionError, AxBalancer, type AxBalancerOptions, AxBaseAI, type AxBaseAIArgs, AxBaseOptimizer, AxBootstrapFewShot, type AxBootstrapOptimizerOptions, type AxChatLogEntry, type AxChatLogMessage, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, type AxCheckpoint, type AxCheckpointLoadFn, type AxCheckpointSaveFn, type AxCitation, type AxCodeInterpreter, type AxCodeRuntime, type AxCodeSession, type AxCodeSessionSnapshot, type AxCodeSessionSnapshotEntry, type AxCompileOptions, AxContentProcessingError, type AxContentProcessingServices, type AxContextCacheInfo, type AxContextCacheOperation, type AxContextCacheOptions, type AxContextCacheRegistry, type AxContextCacheRegistryEntry, type AxContextFieldInput, type AxContextFieldPromptConfig, type AxContextPolicyBudget, type AxContextPolicyConfig, type AxContextPolicyPreset, type AxCostTracker, type AxCostTrackerOptions, AxDB, type AxDBArgs, AxDBBase, type AxDBBaseArgs, type AxDBBaseOpOptions, AxDBCloudflare, type AxDBCloudflareArgs, type AxDBCloudflareOpOptions, type AxDBLoaderOptions, AxDBManager, type AxDBManagerArgs, type AxDBMatch, AxDBMemory, type AxDBMemoryArgs, type AxDBMemoryOpOptions, AxDBPinecone, type AxDBPineconeArgs, type AxDBPineconeOpOptions, type AxDBQueryRequest, type AxDBQueryResponse, type AxDBQueryService, type AxDBService, type AxDBState, type AxDBUpsertRequest, type AxDBUpsertResponse, AxDBWeaviate, type AxDBWeaviateArgs, type AxDBWeaviateOpOptions, type AxDataRow, type AxDebugChatResponseUsage, AxDefaultCostTracker, AxDefaultResultReranker, type AxDiscoveryTurnSummary, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, type AxErrorCategory, AxEvalUtil, type AxEvaluateArgs, type AxExample, type AxExamples, type AxExecutorModelPolicy, type AxExecutorModelPolicyEntry, type AxField, type AxFieldOptions, type AxFieldProcessor, type AxFieldProcessorProcess, type AxFieldTemplateFn, type AxFieldType, type AxFieldValue, AxFlow, type AxFlowAutoParallelConfig, type AxFlowBranchContext, type AxFlowBranchEvaluationData, type AxFlowCompleteData, AxFlowDependencyAnalyzer, type AxFlowDynamicContext, type AxFlowErrorData, AxFlowExecutionPlanner, type AxFlowExecutionStep, type AxFlowLogData, type AxFlowLoggerData, type AxFlowLoggerFunction, type AxFlowNodeDefinition, type AxFlowParallelBranch, type AxFlowParallelGroup, type AxFlowParallelGroupCompleteData, type AxFlowParallelGroupStartData, type AxFlowStartData, type AxFlowState, type AxFlowStepCompleteData, type AxFlowStepFunction, type AxFlowStepStartData, type AxFlowSubContext, AxFlowSubContextImpl, type AxFlowTypedParallelBranch, type AxFlowTypedSubContext, AxFlowTypedSubContextImpl, type AxFlowable, type AxFluentFieldInfo, AxFluentFieldType, type AxForwardable, type AxFunction, type AxFunctionCallRecord, type AxFunctionCallTrace, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, type AxFunctionResult, type AxFunctionResultFormatter, AxGEPA, type AxGEPAAdapter, type AxGEPABatchEvaluation, type AxGEPABatchRow, type AxGEPABootstrapOptions, type AxGEPAComponentBanditState, AxGEPAComponentSelector, type AxGEPAComponentTarget, type AxGEPAEvaluationBatch, type AxGEPAEvaluationState, type AxGEPAOptimizationReport, type AxGEPAReflectiveTuple, type AxGEPATraceSummary, type AxGEPATraceSummaryCall, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenInput, type AxGenMetricsInstruments, type AxGenOut, type AxGenOutput, type AxGenStreamingOut, AxGenerateError, type AxGenerateErrorDetails, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSRuntime, type AxJSRuntimeNodePermissionAllowlist, type AxJSRuntimeOutputMode, AxJSRuntimePermission, type AxJSRuntimeResourceLimits, type AxJudgeForwardOptions, type AxJudgeOptions, AxLLMRequestTypeValues, AxLearn, type AxLearnArtifact, type AxLearnCheckpointMode, type AxLearnCheckpointState, type AxLearnContinuousOptions, type AxLearnMode, type AxLearnOptimizeOptions, type AxLearnOptions, type AxLearnPlaybook, type AxLearnPlaybookOptions, type AxLearnPlaybookSummary, type AxLearnProgress, type AxLearnResult, type AxLearnUpdateFeedback, type AxLearnUpdateInput, type AxLearnUpdateOptions, type AxLlmQueryBudgetState, type AxLlmQueryPromptMode, type AxLoggerData, type AxLoggerFunction, type AxMCPBlobResourceContents, AxMCPClient, type AxMCPEmbeddedResource, type AxMCPFunctionDescription, AxMCPHTTPSSETransport, type AxMCPImageContent, type AxMCPInitializeParams, type AxMCPInitializeResult, type AxMCPJSONRPCErrorResponse, type AxMCPJSONRPCNotification, type AxMCPJSONRPCRequest, type AxMCPJSONRPCResponse, type AxMCPJSONRPCSuccessResponse, type AxMCPOAuthOptions, type AxMCPPrompt, type AxMCPPromptArgument, type AxMCPPromptGetResult, type AxMCPPromptMessage, type AxMCPPromptsListResult, type AxMCPResource, type AxMCPResourceReadResult, type AxMCPResourceTemplate, type AxMCPResourceTemplatesListResult, type AxMCPResourcesListResult, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPTextContent, type AxMCPTextResourceContents, type AxMCPToolsListResult, type AxMCPTransport, AxMediaNotSupportedError, AxMemory, type AxMemoryData, type AxMemoryMessageValue, type AxMetricFn, type AxMetricFnArgs, type AxMetricsConfig, AxMockAIService, type AxMockAIServiceConfig, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxModelUsage, type AxMultiMetricFn, type AxMultiProviderConfig, AxMultiServiceRouter, type AxMutableDiscoveryPromptState, type AxMutableSkillsPromptState, type AxNamedProgramInstance, type AxNormalizedAgentEvalDataset, type AxOptimizableComponent, type AxOptimizableValidator, type AxOptimizationCheckpoint, type AxOptimizationProgress, type AxOptimizationStats, type AxOptimizedProgram, AxOptimizedProgramImpl, type AxOptimizer, type AxOptimizerArgs, type AxOptimizerLoggerData, type AxOptimizerLoggerFunction, type AxOptimizerMetricsConfig, type AxOptimizerMetricsInstruments, type AxOptimizerResult, type AxParetoResult, type AxPreparedChatRequest, type AxPreparedRestoredState, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramForwardOptionsWithModels, type AxProgramOptions, type AxProgramStreamingForwardOptions, type AxProgramStreamingForwardOptionsWithModels, type AxProgramTrace, type AxProgramUsage, type AxProgrammable, type AxPromptMetrics, AxPromptTemplate, type AxPromptTemplateOptions, AxProviderRouter, type AxRLMConfig, type AxRateLimiterFunction, AxRateLimiterTokenUsage, type AxRateLimiterTokenUsageOptions, type AxRenderedPrompt, type AxRerankerIn, type AxRerankerOut, type AxResolvedContextPolicy, type AxResolvedExecutorModelPolicy, type AxResolvedExecutorModelPolicyEntry, type AxResponseHandlerArgs, type AxResultPickerFunction, type AxResultPickerFunctionFieldResults, type AxResultPickerFunctionFunctionResults, type AxRewriteIn, type AxRewriteOut, type AxRolloutTrace, type AxRoutingResult, type AxRuntimePrimitive, type AxRuntimePrimitiveStage, type AxSamplePickerOptions, type AxSelfTuningConfig, type AxSerializedOptimizedProgram, type AxSetExamplesOptions, AxSignature, AxSignatureBuilder, type AxSignatureConfig, AxSimpleClassifier, AxSimpleClassifierClass, type AxSimpleClassifierForwardOptions, AxSpanKindValues, type AxStageDefinitionBuildOptions, type AxStageOptions, type AxStepContext, AxStepContextImpl, type AxStepHooks, type AxStepUsage, AxStopFunctionCallException, type AxStorage, type AxStorageQuery, type AxStreamingAssertion, type AxStreamingEvent, type AxStreamingFieldProcessorProcess, AxStringUtil, AxSynth, type AxSynthExample, type AxSynthOptions, type AxSynthResult, type AxSynthesizerInit, type AxSynthesizerOptions, type AxSynthesizerRole, AxTestPrompt, type AxThoughtBlockItem, AxTokenLimitError, type AxTokenUsage, type AxTrace, AxTraceLogger, type AxTraceLoggerOptions, type AxTunable, type AxTypedExample, type AxUsable, type AxWorkerRuntimeConfig, agent, ai, ax, axAIAnthropicDefaultConfig, axAIAnthropicVertexDefaultConfig, axAIAzureOpenAIBestConfig, axAIAzureOpenAICreativeConfig, axAIAzureOpenAIDefaultConfig, axAIAzureOpenAIFastConfig, axAICohereCreativeConfig, axAICohereDefaultConfig, axAIDeepSeekCodeConfig, axAIDeepSeekDefaultConfig, axAIGoogleGeminiDefaultConfig, axAIGoogleGeminiDefaultCreativeConfig, axAIGrokBestConfig, axAIGrokDefaultConfig, axAIHuggingFaceCreativeConfig, axAIHuggingFaceDefaultConfig, axAIMistralBestConfig, axAIMistralDefaultConfig, axAIOllamaDefaultConfig, axAIOllamaDefaultCreativeConfig, axAIOpenAIBestConfig, axAIOpenAICreativeConfig, axAIOpenAIDefaultConfig, axAIOpenAIFastConfig, axAIOpenAIResponsesBestConfig, axAIOpenAIResponsesCreativeConfig, axAIOpenAIResponsesDefaultConfig, axAIOpenRouterDefaultConfig, axAIRekaBestConfig, axAIRekaCreativeConfig, axAIRekaDefaultConfig, axAIRekaFastConfig, axAITogetherDefaultConfig, axAIWebLLMCreativeConfig, axAIWebLLMDefaultConfig, axAnalyzeChatPromptRequirements, axAnalyzeRequestRequirements, axBaseAIDefaultConfig, axBaseAIDefaultCreativeConfig, axBuildDistillerDefinition, axBuildExecutorDefinition, axBuildResponderDefinition, axCheckMetricsHealth, axCreateDefaultColorLogger, axCreateDefaultOptimizerColorLogger, axCreateDefaultOptimizerTextLogger, axCreateDefaultTextLogger, axCreateFlowColorLogger, axCreateFlowTextLogger, axCreateJSRuntime, axDefaultFlowLogger, axDefaultMetricsConfig, axDefaultOptimizerLogger, axDefaultOptimizerMetricsConfig, axDeserializeOptimizedProgram, axGetCompatibilityReport, axGetFormatCompatibility, axGetMetricsConfig, axGetOptimizerMetricsConfig, axGetProvidersWithMediaSupport, axGlobals, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoOpenAIResponses, axModelInfoReka, axModelInfoTogether, axModelInfoWebLLM, axOptimizableValidators, axProcessContentForProvider, axRAG, axRuntimePrimitives, axScoreProvidersForRequest, axSelectOptimalProvider, axSerializeOptimizedProgram, axSpanAttributes, axSpanEvents, axUpdateMetricsConfig, axUpdateOptimizerMetricsConfig, axValidateChatRequestMessage, axValidateChatResponseResult, axValidateProviderCapabilities, axWorkerRuntime, f, flow, fn, s };
12745
+ export { AxACE, type AxACEBullet, type AxACECuratorOperation, type AxACECuratorOperationType, type AxACECuratorOutput, type AxACEFeedbackEvent, type AxACEGeneratorOutput, type AxACEOptimizationArtifact, AxACEOptimizedProgram, type AxACEOptions, type AxACEPlaybook, type AxACEReflectionOutput, type AxACEResult, AxAI, AxAIAnthropic, type AxAIAnthropicArgs, type AxAIAnthropicChatError, type AxAIAnthropicChatRequest, type AxAIAnthropicChatRequestCacheParam, type AxAIAnthropicChatResponse, type AxAIAnthropicChatResponseDelta, type AxAIAnthropicConfig, type AxAIAnthropicContentBlockDeltaEvent, type AxAIAnthropicContentBlockStartEvent, type AxAIAnthropicContentBlockStopEvent, type AxAIAnthropicEffortLevel, type AxAIAnthropicEffortLevelMapping, type AxAIAnthropicErrorEvent, type AxAIAnthropicFunctionTool, type AxAIAnthropicMessageDeltaEvent, type AxAIAnthropicMessageStartEvent, type AxAIAnthropicMessageStopEvent, AxAIAnthropicModel, type AxAIAnthropicOutputConfig, type AxAIAnthropicPingEvent, type AxAIAnthropicRequestTool, type AxAIAnthropicThinkingConfig, type AxAIAnthropicThinkingTokenBudgetLevels, type AxAIAnthropicThinkingWire, AxAIAnthropicVertexModel, type AxAIAnthropicWebSearchTool, type AxAIArgs, AxAIAzureOpenAI, type AxAIAzureOpenAIArgs, type AxAIAzureOpenAIConfig, AxAICohere, type AxAICohereArgs, type AxAICohereChatRequest, type AxAICohereChatRequestToolResults, type AxAICohereChatResponse, type AxAICohereChatResponseDelta, type AxAICohereChatResponseToolCalls, type AxAICohereConfig, AxAICohereEmbedModel, type AxAICohereEmbedRequest, type AxAICohereEmbedResponse, AxAICohereModel, AxAIDeepSeek, type AxAIDeepSeekArgs, AxAIDeepSeekModel, type AxAIEmbedModels, type AxAIFeatures, AxAIGoogleGemini, type AxAIGoogleGeminiArgs, type AxAIGoogleGeminiBatchEmbedRequest, type AxAIGoogleGeminiBatchEmbedResponse, type AxAIGoogleGeminiCacheCreateRequest, type AxAIGoogleGeminiCacheResponse, type AxAIGoogleGeminiCacheUpdateRequest, type AxAIGoogleGeminiChatRequest, type AxAIGoogleGeminiChatResponse, type AxAIGoogleGeminiChatResponseDelta, type AxAIGoogleGeminiConfig, type AxAIGoogleGeminiContent, type AxAIGoogleGeminiContentPart, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiEmbedTypes, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, type AxAIGoogleGeminiRetrievalConfig, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiThinkingConfig, type AxAIGoogleGeminiThinkingLevel, type AxAIGoogleGeminiThinkingLevelMapping, type AxAIGoogleGeminiThinkingTokenBudgetLevels, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, type AxAIGoogleGeminiToolGoogleMaps, type AxAIGoogleGeminiToolGoogleSearchRetrieval, type AxAIGoogleVertexBatchEmbedRequest, type AxAIGoogleVertexBatchEmbedResponse, AxAIGrok, type AxAIGrokArgs, type AxAIGrokChatRequest, AxAIGrokEmbedModels, AxAIGrokModel, type AxAIGrokOptionsTools, type AxAIGrokSearchSource, AxAIGroq, type AxAIGroqArgs, AxAIGroqModel, AxAIHuggingFace, type AxAIHuggingFaceArgs, type AxAIHuggingFaceConfig, AxAIHuggingFaceModel, type AxAIHuggingFaceRequest, type AxAIHuggingFaceResponse, type AxAIInputModelList, type AxAIMemory, type AxAIMetricsInstruments, AxAIMistral, type AxAIMistralArgs, type AxAIMistralChatRequest, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelCatalogAudioSupport, type AxAIModelCatalogFilter, type AxAIModelCatalogModel, type AxAIModelCatalogModelCapabilities, type AxAIModelCatalogModelType, type AxAIModelCatalogOptions, type AxAIModelCatalogProvider, type AxAIModelCatalogProviderName, type AxAIModelList, type AxAIModelListBase, type AxAIModels, AxAIOllama, type AxAIOllamaAIConfig, type AxAIOllamaArgs, AxAIOpenAI, type AxAIOpenAIAnnotation, type AxAIOpenAIArgs, AxAIOpenAIBase, type AxAIOpenAIBaseArgs, type AxAIOpenAIChatRequest, type AxAIOpenAIChatResponse, type AxAIOpenAIChatResponseDelta, type AxAIOpenAIConfig, AxAIOpenAIEmbedModel, type AxAIOpenAIEmbedRequest, type AxAIOpenAIEmbedResponse, type AxAIOpenAILogprob, AxAIOpenAIModel, type AxAIOpenAIResponseDelta, AxAIOpenAIResponses, type AxAIOpenAIResponsesArgs, AxAIOpenAIResponsesBase, type AxAIOpenAIResponsesCodeInterpreterToolCall, type AxAIOpenAIResponsesComputerToolCall, type AxAIOpenAIResponsesConfig, type AxAIOpenAIResponsesContentPartAddedEvent, type AxAIOpenAIResponsesContentPartDoneEvent, type AxAIOpenAIResponsesDefineFunctionTool, type AxAIOpenAIResponsesErrorEvent, type AxAIOpenAIResponsesFileSearchCallCompletedEvent, type AxAIOpenAIResponsesFileSearchCallInProgressEvent, type AxAIOpenAIResponsesFileSearchCallSearchingEvent, type AxAIOpenAIResponsesFileSearchToolCall, type AxAIOpenAIResponsesFunctionCallArgumentsDeltaEvent, type AxAIOpenAIResponsesFunctionCallArgumentsDoneEvent, type AxAIOpenAIResponsesFunctionCallItem, type AxAIOpenAIResponsesImageGenerationCallCompletedEvent, type AxAIOpenAIResponsesImageGenerationCallGeneratingEvent, type AxAIOpenAIResponsesImageGenerationCallInProgressEvent, type AxAIOpenAIResponsesImageGenerationCallPartialImageEvent, type AxAIOpenAIResponsesImageGenerationToolCall, AxAIOpenAIResponsesImpl, type AxAIOpenAIResponsesInputAudioContentPart, type AxAIOpenAIResponsesInputContentPart, type AxAIOpenAIResponsesInputFunctionCallItem, type AxAIOpenAIResponsesInputFunctionCallOutputItem, type AxAIOpenAIResponsesInputImageUrlContentPart, type AxAIOpenAIResponsesInputItem, type AxAIOpenAIResponsesInputMessageItem, type AxAIOpenAIResponsesInputTextContentPart, type AxAIOpenAIResponsesLocalShellToolCall, type AxAIOpenAIResponsesMCPCallArgumentsDeltaEvent, type AxAIOpenAIResponsesMCPCallArgumentsDoneEvent, type AxAIOpenAIResponsesMCPCallCompletedEvent, type AxAIOpenAIResponsesMCPCallFailedEvent, type AxAIOpenAIResponsesMCPCallInProgressEvent, type AxAIOpenAIResponsesMCPListToolsCompletedEvent, type AxAIOpenAIResponsesMCPListToolsFailedEvent, type AxAIOpenAIResponsesMCPListToolsInProgressEvent, type AxAIOpenAIResponsesMCPToolCall, AxAIOpenAIResponsesModel, type AxAIOpenAIResponsesOutputItem, type AxAIOpenAIResponsesOutputItemAddedEvent, type AxAIOpenAIResponsesOutputItemDoneEvent, type AxAIOpenAIResponsesOutputMessageItem, type AxAIOpenAIResponsesOutputRefusalContentPart, type AxAIOpenAIResponsesOutputTextAnnotationAddedEvent, type AxAIOpenAIResponsesOutputTextContentPart, type AxAIOpenAIResponsesOutputTextDeltaEvent, type AxAIOpenAIResponsesOutputTextDoneEvent, type AxAIOpenAIResponsesReasoningDeltaEvent, type AxAIOpenAIResponsesReasoningDoneEvent, type AxAIOpenAIResponsesReasoningItem, type AxAIOpenAIResponsesReasoningSummaryDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryDoneEvent, type AxAIOpenAIResponsesReasoningSummaryPart, type AxAIOpenAIResponsesReasoningSummaryPartAddedEvent, type AxAIOpenAIResponsesReasoningSummaryPartDoneEvent, type AxAIOpenAIResponsesReasoningSummaryTextDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryTextDoneEvent, type AxAIOpenAIResponsesRefusalDeltaEvent, type AxAIOpenAIResponsesRefusalDoneEvent, type AxAIOpenAIResponsesRequest, type AxAIOpenAIResponsesResponse, type AxAIOpenAIResponsesResponseCompletedEvent, type AxAIOpenAIResponsesResponseCreatedEvent, type AxAIOpenAIResponsesResponseDelta, type AxAIOpenAIResponsesResponseFailedEvent, type AxAIOpenAIResponsesResponseInProgressEvent, type AxAIOpenAIResponsesResponseIncompleteEvent, type AxAIOpenAIResponsesResponseQueuedEvent, type AxAIOpenAIResponsesStreamEvent, type AxAIOpenAIResponsesStreamEventBase, type AxAIOpenAIResponsesToolCall, type AxAIOpenAIResponsesToolCallBase, type AxAIOpenAIResponsesToolChoice, type AxAIOpenAIResponsesToolDefinition, type AxAIOpenAIResponsesWebSearchCallCompletedEvent, type AxAIOpenAIResponsesWebSearchCallInProgressEvent, type AxAIOpenAIResponsesWebSearchCallSearchingEvent, type AxAIOpenAIResponsesWebSearchToolCall, type AxAIOpenAIUrlCitation, type AxAIOpenAIUsage, AxAIOpenRouter, type AxAIOpenRouterArgs, AxAIRefusalError, AxAIReka, type AxAIRekaArgs, type AxAIRekaChatRequest, type AxAIRekaChatResponse, type AxAIRekaChatResponseDelta, type AxAIRekaConfig, AxAIRekaModel, type AxAIRekaUsage, type AxAIService, AxAIServiceAbortedError, type AxAIServiceActionOptions, AxAIServiceAuthenticationError, AxAIServiceError, type AxAIServiceImpl, type AxAIServiceMetrics, type AxAIServiceModelType, AxAIServiceNetworkError, type AxAIServiceOptions, AxAIServiceResponseError, AxAIServiceStatusError, AxAIServiceStreamTerminatedError, AxAIServiceTimeoutError, AxAITogether, type AxAITogetherArgs, type AxAITogetherChatModel, AxAITogetherModel, AxAIWebLLM, type AxAIWebLLMArgs, type AxAIWebLLMChatRequest, type AxAIWebLLMChatResponse, type AxAIWebLLMChatResponseDelta, type AxAIWebLLMConfig, type AxAIWebLLMEmbedModel, type AxAIWebLLMEmbedRequest, type AxAIWebLLMEmbedResponse, AxAIWebLLMModel, type AxAPI, type AxAPIConfig, AxAgent, type AxAgentClarification, type AxAgentClarificationChoice, AxAgentClarificationError, type AxAgentClarificationKind, type AxAgentCompletionProtocol, type AxAgentConfig, type AxAgentDemos, type AxAgentDiscoveryPromptState, type AxAgentEvalDataset, type AxAgentEvalFunctionCall, type AxAgentEvalPrediction, type AxAgentEvalTask, type AxAgentExecutorResultPayload, type AxAgentExecutorTurnCallbackArgs, type AxAgentForwardOptions, type AxAgentFunction, type AxAgentFunctionCall, type AxAgentFunctionCallRecorder, type AxAgentFunctionCollection, type AxAgentFunctionExample, type AxAgentFunctionGroup, type AxAgentFunctionModuleMeta, type AxAgentGuidanceLogEntry, type AxAgentGuidancePayload, type AxAgentGuidanceState, type AxAgentIdentity, type AxAgentInputUpdateCallback, type AxAgentInternalCompletionPayload, type AxAgentJudgeEvalInput, type AxAgentJudgeEvalOutput, type AxAgentJudgeInput, type AxAgentJudgeOptions, type AxAgentJudgeOutput, type AxAgentMemoriesSearchFn, type AxAgentMemoryEntry, type AxAgentMemoryResult, type AxAgentOnFunctionCall, type AxAgentOptimizationTargetDescriptor, type AxAgentOptimizeOptions, type AxAgentOptimizeResult, type AxAgentOptimizeTarget, type AxAgentOptions, AxAgentProtocolCompletionSignal, type AxAgentRecursionOptions, type AxAgentRecursiveExpensiveNode, type AxAgentRecursiveFunctionCall, type AxAgentRecursiveNodeRole, type AxAgentRecursiveStats, type AxAgentRecursiveTargetId, type AxAgentRecursiveTraceNode, type AxAgentRecursiveTurn, type AxAgentRecursiveUsage, type AxAgentRuntimeCompletionState, type AxAgentRuntimeExecutionContext, type AxAgentRuntimeInputState, type AxAgentSkillResult, type AxAgentSkillsPromptState, type AxAgentSkillsSearchFn, type AxAgentState, type AxAgentStateActionLogEntry, type AxAgentStateCheckpointState, type AxAgentStateExecutorModelState, type AxAgentStateRuntimeEntry, type AxAgentStreamingForwardOptions, type AxAgentStructuredClarification, type AxAgentTestCompletionPayload, type AxAgentTestResult, type AxAgentUsage, type AxAgentic, type AxAnyAgentic, AxApacheTika, type AxApacheTikaArgs, type AxApacheTikaConvertOptions, type AxAssertion, AxAssertionError, type AxAudioFormat, AxBalancer, type AxBalancerOptions, AxBaseAI, type AxBaseAIArgs, AxBaseOptimizer, AxBootstrapFewShot, type AxBootstrapOptimizerOptions, type AxChatAudioConfig, type AxChatAudioOutput, type AxChatLogEntry, type AxChatLogMessage, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, type AxCheckpoint, type AxCheckpointLoadFn, type AxCheckpointSaveFn, type AxCitation, type AxCodeInterpreter, type AxCodeRuntime, type AxCodeSession, type AxCodeSessionSnapshot, type AxCodeSessionSnapshotEntry, type AxCompileOptions, AxContentProcessingError, type AxContentProcessingServices, type AxContextCacheInfo, type AxContextCacheOperation, type AxContextCacheOptions, type AxContextCacheRegistry, type AxContextCacheRegistryEntry, type AxContextFieldInput, type AxContextFieldPromptConfig, type AxContextPolicyBudget, type AxContextPolicyConfig, type AxContextPolicyPreset, type AxCostTracker, type AxCostTrackerOptions, AxDB, type AxDBArgs, AxDBBase, type AxDBBaseArgs, type AxDBBaseOpOptions, AxDBCloudflare, type AxDBCloudflareArgs, type AxDBCloudflareOpOptions, type AxDBLoaderOptions, AxDBManager, type AxDBManagerArgs, type AxDBMatch, AxDBMemory, type AxDBMemoryArgs, type AxDBMemoryOpOptions, AxDBPinecone, type AxDBPineconeArgs, type AxDBPineconeOpOptions, type AxDBQueryRequest, type AxDBQueryResponse, type AxDBQueryService, type AxDBService, type AxDBState, type AxDBUpsertRequest, type AxDBUpsertResponse, AxDBWeaviate, type AxDBWeaviateArgs, type AxDBWeaviateOpOptions, type AxDataRow, type AxDateRange, type AxDateRangeValue, type AxDebugChatResponseUsage, AxDefaultCostTracker, AxDefaultResultReranker, type AxDiscoveryTurnSummary, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, type AxErrorCategory, AxEvalUtil, type AxEvaluateArgs, type AxExample, type AxExamples, type AxExecutorModelPolicy, type AxExecutorModelPolicyEntry, type AxField, type AxFieldOptions, type AxFieldProcessor, type AxFieldProcessorProcess, type AxFieldTemplateFn, type AxFieldType, type AxFieldValue, AxFlow, type AxFlowAutoParallelConfig, type AxFlowBranchContext, type AxFlowBranchEvaluationData, type AxFlowCompleteData, AxFlowDependencyAnalyzer, type AxFlowDynamicContext, type AxFlowErrorData, AxFlowExecutionPlanner, type AxFlowExecutionStep, type AxFlowLogData, type AxFlowLoggerData, type AxFlowLoggerFunction, type AxFlowNodeDefinition, type AxFlowParallelBranch, type AxFlowParallelGroup, type AxFlowParallelGroupCompleteData, type AxFlowParallelGroupStartData, type AxFlowStartData, type AxFlowState, type AxFlowStepCompleteData, type AxFlowStepFunction, type AxFlowStepStartData, type AxFlowSubContext, AxFlowSubContextImpl, type AxFlowTypedParallelBranch, type AxFlowTypedSubContext, AxFlowTypedSubContextImpl, type AxFlowable, type AxFluentFieldInfo, AxFluentFieldType, type AxForwardable, type AxFunction, type AxFunctionCallRecord, type AxFunctionCallTrace, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, type AxFunctionResult, type AxFunctionResultFormatter, AxGEPA, type AxGEPAAdapter, type AxGEPABatchEvaluation, type AxGEPABatchRow, type AxGEPABootstrapOptions, type AxGEPAComponentBanditState, AxGEPAComponentSelector, type AxGEPAComponentTarget, type AxGEPAEvaluationBatch, type AxGEPAEvaluationState, type AxGEPAOptimizationReport, type AxGEPAReflectiveTuple, type AxGEPATraceSummary, type AxGEPATraceSummaryCall, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenInput, type AxGenMetricsInstruments, type AxGenOut, type AxGenOutput, type AxGenStreamingOut, AxGenerateError, type AxGenerateErrorDetails, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSRuntime, type AxJSRuntimeNodePermissionAllowlist, type AxJSRuntimeOutputMode, AxJSRuntimePermission, type AxJSRuntimeResourceLimits, type AxJudgeForwardOptions, type AxJudgeOptions, AxLLMRequestTypeValues, AxLearn, type AxLearnArtifact, type AxLearnCheckpointMode, type AxLearnCheckpointState, type AxLearnContinuousOptions, type AxLearnMode, type AxLearnOptimizeOptions, type AxLearnOptions, type AxLearnPlaybook, type AxLearnPlaybookOptions, type AxLearnPlaybookSummary, type AxLearnProgress, type AxLearnResult, type AxLearnUpdateFeedback, type AxLearnUpdateInput, type AxLearnUpdateOptions, type AxLlmQueryBudgetState, type AxLlmQueryPromptMode, type AxLoggerData, type AxLoggerFunction, type AxMCPBlobResourceContents, AxMCPClient, type AxMCPEmbeddedResource, type AxMCPFunctionDescription, AxMCPHTTPSSETransport, type AxMCPImageContent, type AxMCPInitializeParams, type AxMCPInitializeResult, type AxMCPJSONRPCErrorResponse, type AxMCPJSONRPCNotification, type AxMCPJSONRPCRequest, type AxMCPJSONRPCResponse, type AxMCPJSONRPCSuccessResponse, type AxMCPOAuthOptions, type AxMCPPrompt, type AxMCPPromptArgument, type AxMCPPromptGetResult, type AxMCPPromptMessage, type AxMCPPromptsListResult, type AxMCPResource, type AxMCPResourceReadResult, type AxMCPResourceTemplate, type AxMCPResourceTemplatesListResult, type AxMCPResourcesListResult, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPTextContent, type AxMCPTextResourceContents, type AxMCPToolsListResult, type AxMCPTransport, AxMediaNotSupportedError, AxMemory, type AxMemoryData, type AxMemoryMessageValue, type AxMetricFn, type AxMetricFnArgs, type AxMetricsConfig, AxMockAIService, type AxMockAIServiceConfig, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxModelUsage, type AxMultiMetricFn, type AxMultiProviderConfig, AxMultiServiceRouter, type AxMutableDiscoveryPromptState, type AxMutableSkillsPromptState, type AxNamedProgramInstance, type AxNormalizedAgentEvalDataset, type AxOptimizableComponent, type AxOptimizableValidator, type AxOptimizationCheckpoint, type AxOptimizationProgress, type AxOptimizationStats, type AxOptimizedProgram, AxOptimizedProgramImpl, type AxOptimizer, type AxOptimizerArgs, type AxOptimizerLoggerData, type AxOptimizerLoggerFunction, type AxOptimizerMetricsConfig, type AxOptimizerMetricsInstruments, type AxOptimizerResult, type AxParetoResult, type AxPreparedChatRequest, type AxPreparedRestoredState, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramForwardOptionsWithModels, type AxProgramOptions, type AxProgramStreamingForwardOptions, type AxProgramStreamingForwardOptionsWithModels, type AxProgramTrace, type AxProgramUsage, type AxProgrammable, type AxPromptMetrics, AxPromptTemplate, type AxPromptTemplateOptions, AxProviderRouter, type AxRLMConfig, type AxRateLimiterFunction, AxRateLimiterTokenUsage, type AxRateLimiterTokenUsageOptions, type AxRenderedPrompt, type AxRerankerIn, type AxRerankerOut, type AxResolvedContextPolicy, type AxResolvedExecutorModelPolicy, type AxResolvedExecutorModelPolicyEntry, type AxResponseHandlerArgs, type AxResultPickerFunction, type AxResultPickerFunctionFieldResults, type AxResultPickerFunctionFunctionResults, type AxRewriteIn, type AxRewriteOut, type AxRolloutTrace, type AxRoutingResult, type AxRuntimePrimitive, type AxRuntimePrimitiveStage, type AxSamplePickerOptions, type AxSelfTuningConfig, type AxSerializedOptimizedProgram, type AxSetExamplesOptions, AxSignature, AxSignatureBuilder, type AxSignatureConfig, AxSimpleClassifier, AxSimpleClassifierClass, type AxSimpleClassifierForwardOptions, AxSpanKindValues, type AxStageDefinitionBuildOptions, type AxStageOptions, type AxStepContext, AxStepContextImpl, type AxStepHooks, type AxStepUsage, AxStopFunctionCallException, type AxStorage, type AxStorageQuery, type AxStreamingAssertion, type AxStreamingEvent, type AxStreamingFieldProcessorProcess, AxStringUtil, AxSynth, type AxSynthExample, type AxSynthOptions, type AxSynthResult, type AxSynthesizerInit, type AxSynthesizerOptions, type AxSynthesizerRole, AxTestPrompt, type AxThoughtBlockItem, AxTokenLimitError, type AxTokenUsage, type AxTrace, AxTraceLogger, type AxTraceLoggerOptions, type AxTunable, type AxTypedExample, type AxUsable, type AxWorkerRuntimeConfig, agent, ai, ax, axAIAnthropicDefaultConfig, axAIAnthropicVertexDefaultConfig, axAIAzureOpenAIBestConfig, axAIAzureOpenAICreativeConfig, axAIAzureOpenAIDefaultConfig, axAIAzureOpenAIFastConfig, axAICohereCreativeConfig, axAICohereDefaultConfig, axAIDeepSeekCodeConfig, axAIDeepSeekDefaultConfig, axAIGoogleGeminiDefaultConfig, axAIGoogleGeminiDefaultCreativeConfig, axAIGoogleGeminiLiveAudioDefaultConfig, axAIGrokBestConfig, axAIGrokDefaultConfig, axAIGrokVoiceDefaultConfig, axAIHuggingFaceCreativeConfig, axAIHuggingFaceDefaultConfig, axAIMistralBestConfig, axAIMistralDefaultConfig, axAIOllamaDefaultConfig, axAIOllamaDefaultCreativeConfig, axAIOpenAIAudioDefaultConfig, axAIOpenAIBestConfig, axAIOpenAICreativeConfig, axAIOpenAIDefaultConfig, axAIOpenAIFastConfig, axAIOpenAIRealtimeDefaultConfig, axAIOpenAIRealtimeTranscriptionDefaultConfig, axAIOpenAIResponsesBestConfig, axAIOpenAIResponsesCreativeConfig, axAIOpenAIResponsesDefaultConfig, axAIOpenRouterDefaultConfig, axAIRekaBestConfig, axAIRekaCreativeConfig, axAIRekaDefaultConfig, axAIRekaFastConfig, axAITogetherDefaultConfig, axAIWebLLMCreativeConfig, axAIWebLLMDefaultConfig, axAnalyzeChatPromptRequirements, axAnalyzeRequestRequirements, axApplyOpenAIChatAudioRequest, axAudioFormatFromMimeType, axAudioMimeType, axBaseAIDefaultConfig, axBaseAIDefaultCreativeConfig, axBuildDistillerDefinition, axBuildExecutorDefinition, axBuildResponderDefinition, axCheckMetricsHealth, axConcatBase64, axCreateDefaultColorLogger, axCreateDefaultOptimizerColorLogger, axCreateDefaultOptimizerTextLogger, axCreateDefaultTextLogger, axCreateFlowColorLogger, axCreateFlowTextLogger, axCreateGeminiLiveAudioApi, axCreateGrokRealtimeApi, axCreateJSRuntime, axCreateOpenAIRealtimeApi, axDefaultFlowLogger, axDefaultMetricsConfig, axDefaultOptimizerLogger, axDefaultOptimizerMetricsConfig, axDeserializeOptimizedProgram, axGetCompatibilityReport, axGetFormatCompatibility, axGetMetricsConfig, axGetOptimizerMetricsConfig, axGetProvidersWithMediaSupport, axGetSupportedAIModels, axGlobals, axGoogleGeminiLiveAudioDefaults, axIsAudioOutputEnabled, axIsGeminiLiveAudioModel, axIsGrokVoiceModel, axIsOpenAIChatAudioModel, axIsOpenAIRealtimeModel, axIsOpenAIRealtimeTranscriptionModel, axMapGeminiLiveAudioPart, axMapOpenAIChatAudioDelta, axMapOpenAIChatAudioResponse, axMapOpenAIInputAudioPart, axMergeChatAudioConfig, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoOpenAIResponses, axModelInfoReka, axModelInfoTogether, axModelInfoWebLLM, axNormalizeOpenAIUsage, axOpenAIChatAudioDefaults, axOptimizableValidators, axProcessContentForProvider, axRAG, axResolveGeminiLiveAudioConfig, axResolveGrokRealtimeAudioConfig, axResolveOpenAIChatAudioConfig, axResolveOpenAIRealtimeAudioConfig, axRuntimePrimitives, axScoreProvidersForRequest, axSelectOptimalProvider, axSerializeOptimizedProgram, axShouldUseGeminiLiveAudio, axShouldUseGrokRealtime, axShouldUseOpenAIRealtime, axSpanAttributes, axSpanEvents, axUpdateMetricsConfig, axUpdateOptimizerMetricsConfig, axValidateChatRequestMessage, axValidateChatResponseResult, axValidateGeminiLiveAudioInput, axValidateProviderCapabilities, axWorkerRuntime, f, flow, fn, s };