@ax-llm/ax 21.0.4 → 21.0.5

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.cts CHANGED
@@ -2427,6 +2427,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
2427
2427
  private calculatePercentile;
2428
2428
  private updateLatencyMetrics;
2429
2429
  private updateErrorMetrics;
2430
+ private recordEstimatedCost;
2430
2431
  private recordTokenUsage;
2431
2432
  private calculateRequestSize;
2432
2433
  private calculateResponseSize;
@@ -2535,6 +2536,9 @@ type AxModelInfo = {
2535
2536
  maxTokens?: number;
2536
2537
  isExpensive?: boolean;
2537
2538
  contextWindow?: number;
2539
+ isDeprecated?: boolean;
2540
+ /** ISO date (YYYY-MM-DD) the upstream provider will stop serving this model. */
2541
+ deprecatedOn?: string;
2538
2542
  };
2539
2543
  type AxTokenUsage = {
2540
2544
  promptTokens: number;
@@ -2755,6 +2759,10 @@ type AxCitation = {
2755
2759
  license?: string;
2756
2760
  publicationDate?: string;
2757
2761
  snippet?: string;
2762
+ /** File Search multimodal (Gemini, May 2026): media chunk id. */
2763
+ mediaId?: string;
2764
+ /** File Search multimodal (Gemini, May 2026): page numbers cited within the source. */
2765
+ pageNumbers?: number[];
2758
2766
  };
2759
2767
  type AxModelUsage = {
2760
2768
  ai: string;
@@ -5709,6 +5717,10 @@ type AxAIAnthropicThinkingWire = {
5709
5717
  type AxAIAnthropicEffortLevel = 'low' | 'medium' | 'high' | 'max';
5710
5718
  type AxAIAnthropicOutputConfig = {
5711
5719
  effort?: AxAIAnthropicEffortLevel;
5720
+ format?: {
5721
+ type: 'json_schema';
5722
+ schema: object;
5723
+ };
5712
5724
  };
5713
5725
  type AxAIAnthropicEffortLevelMapping = {
5714
5726
  minimal?: AxAIAnthropicEffortLevel;
@@ -5771,7 +5783,7 @@ type AxAIAnthropicChatRequest = {
5771
5783
  media_type: string;
5772
5784
  data: string;
5773
5785
  };
5774
- } & AxAIAnthropicChatRequestCacheParam) | {
5786
+ } & AxAIAnthropicChatRequestCacheParam) | ({
5775
5787
  type: 'tool_result';
5776
5788
  is_error?: boolean;
5777
5789
  tool_use_id: string;
@@ -5786,7 +5798,7 @@ type AxAIAnthropicChatRequest = {
5786
5798
  data: string;
5787
5799
  };
5788
5800
  } & AxAIAnthropicChatRequestCacheParam))[];
5789
- })[];
5801
+ } & AxAIAnthropicChatRequestCacheParam))[];
5790
5802
  } | {
5791
5803
  role: 'assistant';
5792
5804
  content: string | (({
@@ -5826,10 +5838,6 @@ type AxAIAnthropicChatRequest = {
5826
5838
  top_k?: number;
5827
5839
  thinking?: AxAIAnthropicThinkingWire;
5828
5840
  output_config?: AxAIAnthropicOutputConfig;
5829
- output_format?: {
5830
- type: 'json_schema';
5831
- schema: object;
5832
- };
5833
5841
  metadata?: {
5834
5842
  user_id: string;
5835
5843
  };
@@ -6003,8 +6011,11 @@ declare enum AxAIOpenAIModel {
6003
6011
  GPT4OMini = "gpt-4o-mini",
6004
6012
  GPTAudio = "gpt-audio",
6005
6013
  GPTAudioMini = "gpt-audio-mini",
6014
+ GPTAudio15 = "gpt-audio-1.5",
6015
+ GPTRealtime15 = "gpt-realtime-1.5",
6006
6016
  GPTRealtime2 = "gpt-realtime-2",
6007
6017
  GPTRealtimeWhisper = "gpt-realtime-whisper",
6018
+ GPTRealtimeTranslate = "gpt-realtime-translate",
6008
6019
  GPT4ChatGPT4O = "chatgpt-4o-latest",
6009
6020
  GPT4Turbo = "gpt-4-turbo",
6010
6021
  GPT35Turbo = "gpt-3.5-turbo",
@@ -6031,6 +6042,8 @@ declare enum AxAIOpenAIModel {
6031
6042
  GPT54 = "gpt-5.4",
6032
6043
  GPT54Mini = "gpt-5.4-mini",
6033
6044
  GPT54Nano = "gpt-5.4-nano",
6045
+ GPT55 = "gpt-5.5",
6046
+ GPT55Pro = "gpt-5.5-pro",
6034
6047
  O1 = "o1",
6035
6048
  O1Mini = "o1-mini",
6036
6049
  O3 = "o3",
@@ -6063,7 +6076,7 @@ type AxAIOpenAIConfig<TModel, TEmbedModel> = Omit<AxModelConfig, 'topK'> & {
6063
6076
  logprobs?: number;
6064
6077
  echo?: boolean;
6065
6078
  dimensions?: number;
6066
- reasoningEffort?: 'minimal' | 'low' | 'medium' | 'high';
6079
+ reasoningEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
6067
6080
  store?: boolean;
6068
6081
  serviceTier?: 'auto' | 'default' | 'flex';
6069
6082
  webSearchOptions?: {
@@ -6111,7 +6124,7 @@ interface AxAIOpenAIResponseDelta<T> {
6111
6124
  }
6112
6125
  type AxAIOpenAIChatRequest<TModel> = {
6113
6126
  model: TModel;
6114
- reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high';
6127
+ reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
6115
6128
  store?: boolean;
6116
6129
  modalities?: readonly ('text' | 'audio')[];
6117
6130
  audio?: {
@@ -6946,6 +6959,10 @@ declare enum AxAIGoogleGeminiModel {
6946
6959
  Gemini3Flash = "gemini-3-flash-preview",
6947
6960
  Gemini3Pro = "gemini-3.1-pro-preview",
6948
6961
  Gemini3ProImage = "gemini-3-pro-image-preview",
6962
+ Gemini31FlashImage = "gemini-3.1-flash-image-preview",
6963
+ Gemini31FlashTTS = "gemini-3.1-flash-tts-preview",
6964
+ NanoBanana2 = "nano-banana-2",
6965
+ GeminiRoboticsER16 = "gemini-robotics-er-1.6-preview",
6949
6966
  Gemini25Pro = "gemini-2.5-pro",
6950
6967
  Gemini25Flash = "gemini-2.5-flash",
6951
6968
  Gemini25FlashNativeAudio = "gemini-2.5-flash-native-audio-preview-12-2025",
@@ -6967,7 +6984,6 @@ declare enum AxAIGoogleGeminiEmbedModel {
6967
6984
  GeminiEmbedding001 = "gemini-embedding-001",
6968
6985
  GeminiEmbedding = "gemini-embedding-exp",
6969
6986
  TextEmbeddingLarge = "text-embedding-large-exp-03-07",
6970
- TextEmbedding004 = "text-embedding-004",
6971
6987
  TextEmbedding005 = "text-embedding-005"
6972
6988
  }
6973
6989
  declare enum AxAIGoogleGeminiSafetyCategory {
@@ -7123,6 +7139,14 @@ type AxAIGoogleGeminiChatResponse = {
7123
7139
  title?: string;
7124
7140
  uri?: string;
7125
7141
  };
7142
+ retrievedContext?: {
7143
+ title?: string;
7144
+ uri?: string;
7145
+ /** File Search multimodal (May 2026): id of the file/media chunk. */
7146
+ media_id?: string;
7147
+ /** File Search multimodal (May 2026): page numbers cited within the source. */
7148
+ page_numbers?: number[];
7149
+ };
7126
7150
  }[];
7127
7151
  googleMapsWidgetContextToken?: string;
7128
7152
  };
@@ -7527,6 +7551,8 @@ declare enum AxAIOpenAIResponsesModel {
7527
7551
  GPT54 = "gpt-5.4",
7528
7552
  GPT54Mini = "gpt-5.4-mini",
7529
7553
  GPT54Nano = "gpt-5.4-nano",
7554
+ GPT55 = "gpt-5.5",
7555
+ GPT55Pro = "gpt-5.5-pro",
7530
7556
  O1Pro = "o1-pro",
7531
7557
  O1 = "o1",
7532
7558
  O1Mini = "o1-mini",
@@ -7592,14 +7618,14 @@ interface AxAIOpenAIResponsesRequest<TModel = AxAIOpenAIResponsesModel> {
7592
7618
  readonly input: string | ReadonlyArray<AxAIOpenAIResponsesInputItem>;
7593
7619
  readonly model: TModel;
7594
7620
  readonly background?: boolean | null;
7595
- readonly include?: ReadonlyArray<'file_search_call.results' | 'message.input_image.image_url' | 'computer_call_output.output.image_url' | 'reasoning.encrypted_content' | 'code_interpreter_call.outputs'> | null;
7621
+ readonly include?: ReadonlyArray<'file_search_call.results' | 'message.input_image.image_url' | 'computer_call_output.output.image_url' | 'reasoning.encrypted_content' | 'code_interpreter_call.outputs' | 'web_search_call.action.return_token_budget'> | null;
7596
7622
  readonly instructions?: string | null;
7597
7623
  readonly max_output_tokens?: number | null;
7598
7624
  readonly metadata?: Readonly<Record<string, string>> | null;
7599
7625
  readonly parallel_tool_calls?: boolean | null;
7600
7626
  readonly previous_response_id?: string | null;
7601
7627
  readonly reasoning?: {
7602
- readonly effort?: 'minimal' | 'low' | 'medium' | 'high' | null;
7628
+ readonly effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | null;
7603
7629
  readonly summary?: 'auto' | 'concise' | 'detailed' | null;
7604
7630
  } | null;
7605
7631
  readonly service_tier?: 'auto' | 'default' | 'flex' | null;
@@ -7629,6 +7655,7 @@ interface AxAIOpenAIResponsesOutputMessageItem {
7629
7655
  role: 'assistant';
7630
7656
  content: ReadonlyArray<AxAIOpenAIResponsesOutputTextContentPart | AxAIOpenAIResponsesOutputRefusalContentPart>;
7631
7657
  status: 'in_progress' | 'completed' | 'incomplete';
7658
+ phase?: 'commentary' | 'final_answer';
7632
7659
  }
7633
7660
  interface AxAIOpenAIResponsesFunctionCallItem {
7634
7661
  type: 'function_call';
@@ -7978,7 +8005,7 @@ type AxAIOpenAIResponsesConfig<TModel, TEmbedModel> = Omit<AxModelConfig, 'topK'
7978
8005
  logprobs?: number;
7979
8006
  echo?: boolean;
7980
8007
  dimensions?: number;
7981
- reasoningEffort?: 'minimal' | 'low' | 'medium' | 'high';
8008
+ reasoningEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
7982
8009
  reasoningSummary?: 'auto' | 'concise' | 'detailed';
7983
8010
  store?: boolean;
7984
8011
  systemPrompt?: string;
package/index.d.ts CHANGED
@@ -2427,6 +2427,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
2427
2427
  private calculatePercentile;
2428
2428
  private updateLatencyMetrics;
2429
2429
  private updateErrorMetrics;
2430
+ private recordEstimatedCost;
2430
2431
  private recordTokenUsage;
2431
2432
  private calculateRequestSize;
2432
2433
  private calculateResponseSize;
@@ -2535,6 +2536,9 @@ type AxModelInfo = {
2535
2536
  maxTokens?: number;
2536
2537
  isExpensive?: boolean;
2537
2538
  contextWindow?: number;
2539
+ isDeprecated?: boolean;
2540
+ /** ISO date (YYYY-MM-DD) the upstream provider will stop serving this model. */
2541
+ deprecatedOn?: string;
2538
2542
  };
2539
2543
  type AxTokenUsage = {
2540
2544
  promptTokens: number;
@@ -2755,6 +2759,10 @@ type AxCitation = {
2755
2759
  license?: string;
2756
2760
  publicationDate?: string;
2757
2761
  snippet?: string;
2762
+ /** File Search multimodal (Gemini, May 2026): media chunk id. */
2763
+ mediaId?: string;
2764
+ /** File Search multimodal (Gemini, May 2026): page numbers cited within the source. */
2765
+ pageNumbers?: number[];
2758
2766
  };
2759
2767
  type AxModelUsage = {
2760
2768
  ai: string;
@@ -5709,6 +5717,10 @@ type AxAIAnthropicThinkingWire = {
5709
5717
  type AxAIAnthropicEffortLevel = 'low' | 'medium' | 'high' | 'max';
5710
5718
  type AxAIAnthropicOutputConfig = {
5711
5719
  effort?: AxAIAnthropicEffortLevel;
5720
+ format?: {
5721
+ type: 'json_schema';
5722
+ schema: object;
5723
+ };
5712
5724
  };
5713
5725
  type AxAIAnthropicEffortLevelMapping = {
5714
5726
  minimal?: AxAIAnthropicEffortLevel;
@@ -5771,7 +5783,7 @@ type AxAIAnthropicChatRequest = {
5771
5783
  media_type: string;
5772
5784
  data: string;
5773
5785
  };
5774
- } & AxAIAnthropicChatRequestCacheParam) | {
5786
+ } & AxAIAnthropicChatRequestCacheParam) | ({
5775
5787
  type: 'tool_result';
5776
5788
  is_error?: boolean;
5777
5789
  tool_use_id: string;
@@ -5786,7 +5798,7 @@ type AxAIAnthropicChatRequest = {
5786
5798
  data: string;
5787
5799
  };
5788
5800
  } & AxAIAnthropicChatRequestCacheParam))[];
5789
- })[];
5801
+ } & AxAIAnthropicChatRequestCacheParam))[];
5790
5802
  } | {
5791
5803
  role: 'assistant';
5792
5804
  content: string | (({
@@ -5826,10 +5838,6 @@ type AxAIAnthropicChatRequest = {
5826
5838
  top_k?: number;
5827
5839
  thinking?: AxAIAnthropicThinkingWire;
5828
5840
  output_config?: AxAIAnthropicOutputConfig;
5829
- output_format?: {
5830
- type: 'json_schema';
5831
- schema: object;
5832
- };
5833
5841
  metadata?: {
5834
5842
  user_id: string;
5835
5843
  };
@@ -6003,8 +6011,11 @@ declare enum AxAIOpenAIModel {
6003
6011
  GPT4OMini = "gpt-4o-mini",
6004
6012
  GPTAudio = "gpt-audio",
6005
6013
  GPTAudioMini = "gpt-audio-mini",
6014
+ GPTAudio15 = "gpt-audio-1.5",
6015
+ GPTRealtime15 = "gpt-realtime-1.5",
6006
6016
  GPTRealtime2 = "gpt-realtime-2",
6007
6017
  GPTRealtimeWhisper = "gpt-realtime-whisper",
6018
+ GPTRealtimeTranslate = "gpt-realtime-translate",
6008
6019
  GPT4ChatGPT4O = "chatgpt-4o-latest",
6009
6020
  GPT4Turbo = "gpt-4-turbo",
6010
6021
  GPT35Turbo = "gpt-3.5-turbo",
@@ -6031,6 +6042,8 @@ declare enum AxAIOpenAIModel {
6031
6042
  GPT54 = "gpt-5.4",
6032
6043
  GPT54Mini = "gpt-5.4-mini",
6033
6044
  GPT54Nano = "gpt-5.4-nano",
6045
+ GPT55 = "gpt-5.5",
6046
+ GPT55Pro = "gpt-5.5-pro",
6034
6047
  O1 = "o1",
6035
6048
  O1Mini = "o1-mini",
6036
6049
  O3 = "o3",
@@ -6063,7 +6076,7 @@ type AxAIOpenAIConfig<TModel, TEmbedModel> = Omit<AxModelConfig, 'topK'> & {
6063
6076
  logprobs?: number;
6064
6077
  echo?: boolean;
6065
6078
  dimensions?: number;
6066
- reasoningEffort?: 'minimal' | 'low' | 'medium' | 'high';
6079
+ reasoningEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
6067
6080
  store?: boolean;
6068
6081
  serviceTier?: 'auto' | 'default' | 'flex';
6069
6082
  webSearchOptions?: {
@@ -6111,7 +6124,7 @@ interface AxAIOpenAIResponseDelta<T> {
6111
6124
  }
6112
6125
  type AxAIOpenAIChatRequest<TModel> = {
6113
6126
  model: TModel;
6114
- reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high';
6127
+ reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
6115
6128
  store?: boolean;
6116
6129
  modalities?: readonly ('text' | 'audio')[];
6117
6130
  audio?: {
@@ -6946,6 +6959,10 @@ declare enum AxAIGoogleGeminiModel {
6946
6959
  Gemini3Flash = "gemini-3-flash-preview",
6947
6960
  Gemini3Pro = "gemini-3.1-pro-preview",
6948
6961
  Gemini3ProImage = "gemini-3-pro-image-preview",
6962
+ Gemini31FlashImage = "gemini-3.1-flash-image-preview",
6963
+ Gemini31FlashTTS = "gemini-3.1-flash-tts-preview",
6964
+ NanoBanana2 = "nano-banana-2",
6965
+ GeminiRoboticsER16 = "gemini-robotics-er-1.6-preview",
6949
6966
  Gemini25Pro = "gemini-2.5-pro",
6950
6967
  Gemini25Flash = "gemini-2.5-flash",
6951
6968
  Gemini25FlashNativeAudio = "gemini-2.5-flash-native-audio-preview-12-2025",
@@ -6967,7 +6984,6 @@ declare enum AxAIGoogleGeminiEmbedModel {
6967
6984
  GeminiEmbedding001 = "gemini-embedding-001",
6968
6985
  GeminiEmbedding = "gemini-embedding-exp",
6969
6986
  TextEmbeddingLarge = "text-embedding-large-exp-03-07",
6970
- TextEmbedding004 = "text-embedding-004",
6971
6987
  TextEmbedding005 = "text-embedding-005"
6972
6988
  }
6973
6989
  declare enum AxAIGoogleGeminiSafetyCategory {
@@ -7123,6 +7139,14 @@ type AxAIGoogleGeminiChatResponse = {
7123
7139
  title?: string;
7124
7140
  uri?: string;
7125
7141
  };
7142
+ retrievedContext?: {
7143
+ title?: string;
7144
+ uri?: string;
7145
+ /** File Search multimodal (May 2026): id of the file/media chunk. */
7146
+ media_id?: string;
7147
+ /** File Search multimodal (May 2026): page numbers cited within the source. */
7148
+ page_numbers?: number[];
7149
+ };
7126
7150
  }[];
7127
7151
  googleMapsWidgetContextToken?: string;
7128
7152
  };
@@ -7527,6 +7551,8 @@ declare enum AxAIOpenAIResponsesModel {
7527
7551
  GPT54 = "gpt-5.4",
7528
7552
  GPT54Mini = "gpt-5.4-mini",
7529
7553
  GPT54Nano = "gpt-5.4-nano",
7554
+ GPT55 = "gpt-5.5",
7555
+ GPT55Pro = "gpt-5.5-pro",
7530
7556
  O1Pro = "o1-pro",
7531
7557
  O1 = "o1",
7532
7558
  O1Mini = "o1-mini",
@@ -7592,14 +7618,14 @@ interface AxAIOpenAIResponsesRequest<TModel = AxAIOpenAIResponsesModel> {
7592
7618
  readonly input: string | ReadonlyArray<AxAIOpenAIResponsesInputItem>;
7593
7619
  readonly model: TModel;
7594
7620
  readonly background?: boolean | null;
7595
- readonly include?: ReadonlyArray<'file_search_call.results' | 'message.input_image.image_url' | 'computer_call_output.output.image_url' | 'reasoning.encrypted_content' | 'code_interpreter_call.outputs'> | null;
7621
+ readonly include?: ReadonlyArray<'file_search_call.results' | 'message.input_image.image_url' | 'computer_call_output.output.image_url' | 'reasoning.encrypted_content' | 'code_interpreter_call.outputs' | 'web_search_call.action.return_token_budget'> | null;
7596
7622
  readonly instructions?: string | null;
7597
7623
  readonly max_output_tokens?: number | null;
7598
7624
  readonly metadata?: Readonly<Record<string, string>> | null;
7599
7625
  readonly parallel_tool_calls?: boolean | null;
7600
7626
  readonly previous_response_id?: string | null;
7601
7627
  readonly reasoning?: {
7602
- readonly effort?: 'minimal' | 'low' | 'medium' | 'high' | null;
7628
+ readonly effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | null;
7603
7629
  readonly summary?: 'auto' | 'concise' | 'detailed' | null;
7604
7630
  } | null;
7605
7631
  readonly service_tier?: 'auto' | 'default' | 'flex' | null;
@@ -7629,6 +7655,7 @@ interface AxAIOpenAIResponsesOutputMessageItem {
7629
7655
  role: 'assistant';
7630
7656
  content: ReadonlyArray<AxAIOpenAIResponsesOutputTextContentPart | AxAIOpenAIResponsesOutputRefusalContentPart>;
7631
7657
  status: 'in_progress' | 'completed' | 'incomplete';
7658
+ phase?: 'commentary' | 'final_answer';
7632
7659
  }
7633
7660
  interface AxAIOpenAIResponsesFunctionCallItem {
7634
7661
  type: 'function_call';
@@ -7978,7 +8005,7 @@ type AxAIOpenAIResponsesConfig<TModel, TEmbedModel> = Omit<AxModelConfig, 'topK'
7978
8005
  logprobs?: number;
7979
8006
  echo?: boolean;
7980
8007
  dimensions?: number;
7981
- reasoningEffort?: 'minimal' | 'low' | 'medium' | 'high';
8008
+ reasoningEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
7982
8009
  reasoningSummary?: 'auto' | 'concise' | 'detailed';
7983
8010
  store?: boolean;
7984
8011
  systemPrompt?: string;