@ax-llm/ax 14.0.25 → 14.0.27

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
@@ -2265,8 +2265,8 @@ interface AxBaseAIArgs<TModel, TEmbedModel, TModelKey> {
2265
2265
  declare const axBaseAIDefaultConfig: () => AxModelConfig;
2266
2266
  declare const axBaseAIDefaultCreativeConfig: () => AxModelConfig;
2267
2267
  declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse, TModelKey> implements AxAIService<TModel, TEmbedModel, TModelKey> {
2268
+ #private;
2268
2269
  private readonly aiImpl;
2269
- private debug;
2270
2270
  private rt?;
2271
2271
  private fetch?;
2272
2272
  private tracer?;
@@ -2296,6 +2296,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
2296
2296
  getId(): string;
2297
2297
  setAPIURL(apiURL: string): void;
2298
2298
  setHeaders(headers: () => Promise<Record<string, string>>): void;
2299
+ get debug(): boolean;
2299
2300
  setOptions(options: Readonly<AxAIServiceOptions>): void;
2300
2301
  getOptions(): Readonly<AxAIServiceOptions>;
2301
2302
  getLogger(): AxLoggerFunction;
@@ -3380,8 +3381,20 @@ type AxAICohereEmbedResponse = {
3380
3381
  embeddings: number[][];
3381
3382
  };
3382
3383
 
3384
+ /**
3385
+ * Creates the default configuration for Cohere AI service
3386
+ * @returns A deep clone of the default Cohere configuration with CommandRPlus model and EmbedEnglishV30 embed model
3387
+ */
3383
3388
  declare const axAICohereDefaultConfig: () => AxAICohereConfig;
3389
+ /**
3390
+ * Creates a creative configuration for Cohere AI service with more flexible parameters
3391
+ * @returns A deep clone of the creative Cohere configuration with CommandR model and EmbedEnglishV30 embed model
3392
+ */
3384
3393
  declare const axAICohereCreativeConfig: () => AxAICohereConfig;
3394
+ /**
3395
+ * Configuration arguments for initializing the Cohere AI service
3396
+ * @template TModelKey - The type of model keys supported
3397
+ */
3385
3398
  interface AxAICohereArgs<TModelKey> {
3386
3399
  name: 'cohere';
3387
3400
  apiKey: string;
@@ -3389,7 +3402,15 @@ interface AxAICohereArgs<TModelKey> {
3389
3402
  options?: Readonly<AxAIServiceOptions>;
3390
3403
  models?: AxAIInputModelList<AxAICohereModel, AxAICohereEmbedModel, TModelKey>;
3391
3404
  }
3405
+ /**
3406
+ * Main Cohere AI service class that extends the base AI implementation
3407
+ * @template TModelKey - The type of model keys supported
3408
+ */
3392
3409
  declare class AxAICohere<TModelKey> extends AxBaseAI<AxAICohereModel, AxAICohereEmbedModel, AxAICohereChatRequest, AxAICohereEmbedRequest, AxAICohereChatResponse, AxAICohereChatResponseDelta, AxAICohereEmbedResponse, TModelKey> {
3410
+ /**
3411
+ * Creates a new instance of AxAICohere
3412
+ * @param args - Configuration arguments including API key, config, options, and models
3413
+ */
3393
3414
  constructor({ apiKey, config, options, models, }: Readonly<Omit<AxAICohereArgs<TModelKey>, 'name'>>);
3394
3415
  }
3395
3416
 
@@ -3404,11 +3425,41 @@ declare enum AxAIDeepSeekModel {
3404
3425
  DeepSeekReasoner = "deepseek-reasoner"
3405
3426
  }
3406
3427
 
3428
+ /**
3429
+ * Configuration type for DeepSeek AI models
3430
+ */
3407
3431
  type DeepSeekConfig = AxAIOpenAIConfig<AxAIDeepSeekModel, undefined>;
3432
+ /**
3433
+ * Creates the default configuration for DeepSeek AI with the chat model
3434
+ * @returns Default DeepSeek configuration with chat model settings
3435
+ */
3408
3436
  declare const axAIDeepSeekDefaultConfig: () => DeepSeekConfig;
3437
+ /**
3438
+ * Creates a configuration optimized for code generation tasks using DeepSeek Coder
3439
+ * @returns DeepSeek configuration with creative settings for coding tasks
3440
+ */
3409
3441
  declare const axAIDeepSeekCodeConfig: () => DeepSeekConfig;
3442
+ /**
3443
+ * Arguments type for initializing DeepSeek AI instances
3444
+ * @template TModelKey - The model key type for type safety
3445
+ */
3410
3446
  type AxAIDeepSeekArgs<TModelKey> = AxAIOpenAIArgs<'deepseek', AxAIDeepSeekModel, undefined, TModelKey>;
3447
+ /**
3448
+ * DeepSeek AI client implementation extending OpenAI base functionality
3449
+ * Provides access to DeepSeek's language models through OpenAI-compatible API
3450
+ * @template TModelKey - The model key type for type safety
3451
+ */
3411
3452
  declare class AxAIDeepSeek<TModelKey> extends AxAIOpenAIBase<AxAIDeepSeekModel, undefined, TModelKey> {
3453
+ /**
3454
+ * Creates a new DeepSeek AI client instance
3455
+ * @param args - Configuration arguments for the DeepSeek client
3456
+ * @param args.apiKey - DeepSeek API key for authentication
3457
+ * @param args.config - Optional configuration overrides
3458
+ * @param args.options - Optional client options
3459
+ * @param args.models - Optional model definitions
3460
+ * @param args.modelInfo - Optional additional model information
3461
+ * @throws {Error} When API key is not provided or empty
3462
+ */
3412
3463
  constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIDeepSeekArgs<TModelKey>, 'name'>>);
3413
3464
  }
3414
3465
 
@@ -3424,7 +3475,10 @@ declare enum AxAIGoogleGeminiModel {
3424
3475
  Gemini15Flash = "gemini-1.5-flash",
3425
3476
  Gemini15Flash002 = "gemini-1.5-flash-002",
3426
3477
  Gemini15Flash8B = "gemini-1.5-flash-8b",
3427
- Gemini15Pro = "gemini-1.5-pro"
3478
+ Gemini15Pro = "gemini-1.5-pro",
3479
+ GeminiFlashLatest = "gemini-flash-latest",
3480
+ GeminiFlashLiteLatest = "gemini-flash-lite-latest",
3481
+ GeminiProLatest = "gemini-pro-latest"
3428
3482
  }
3429
3483
  declare enum AxAIGoogleGeminiEmbedModel {
3430
3484
  GeminiEmbedding = "gemini-embedding-exp",
@@ -3967,18 +4021,44 @@ declare class AxMultiServiceRouter<TServices extends readonly (AxAIService | AxA
3967
4021
  }): void;
3968
4022
  }
3969
4023
 
4024
+ /**
4025
+ * Configuration type for Ollama AI service
4026
+ */
3970
4027
  type AxAIOllamaAIConfig = AxAIOpenAIConfig<string, string>;
4028
+ /**
4029
+ * Creates default configuration for Ollama AI service
4030
+ * @returns Default configuration object with nous-hermes2 model and all-minilm embed model
4031
+ */
3971
4032
  declare const axAIOllamaDefaultConfig: () => AxAIOllamaAIConfig;
4033
+ /**
4034
+ * Creates default creative configuration for Ollama AI service
4035
+ * @returns Creative configuration object with nous-hermes2 model and all-minilm embed model
4036
+ */
3972
4037
  declare const axAIOllamaDefaultCreativeConfig: () => AxAIOllamaAIConfig;
4038
+ /**
4039
+ * Arguments type for initializing Ollama AI service
4040
+ * @template TModelKey - Type for model key
4041
+ */
3973
4042
  type AxAIOllamaArgs<TModelKey> = AxAIOpenAIArgs<'ollama', string, string, TModelKey> & {
3974
4043
  model?: string;
3975
4044
  embedModel?: string;
3976
4045
  url?: string;
3977
4046
  };
3978
4047
  /**
3979
- * OllamaAI: AI Service
4048
+ * Ollama AI service implementation that extends OpenAI base functionality
4049
+ * Provides access to locally hosted Ollama models with OpenAI-compatible API
4050
+ * @template TModelKey - Type for model key
3980
4051
  */
3981
4052
  declare class AxAIOllama<TModelKey> extends AxAIOpenAIBase<string, string, TModelKey> {
4053
+ /**
4054
+ * Creates a new Ollama AI service instance
4055
+ * @param args - Configuration arguments for the Ollama service
4056
+ * @param args.apiKey - API key for authentication (defaults to 'not-set')
4057
+ * @param args.url - Base URL for the Ollama API (defaults to 'http://localhost:11434/v1')
4058
+ * @param args.config - Additional configuration options
4059
+ * @param args.options - Service options
4060
+ * @param args.models - Available models configuration
4061
+ */
3982
4062
  constructor({ apiKey, url, config, options, models, }: Readonly<Omit<AxAIOllamaArgs<TModelKey>, 'name'>>);
3983
4063
  }
3984
4064
 
@@ -5517,6 +5597,7 @@ declare const axGlobals: {
5517
5597
  meter: Meter | undefined;
5518
5598
  logger: AxLoggerFunction | undefined;
5519
5599
  optimizerLogger: AxOptimizerLoggerFunction | undefined;
5600
+ debug: boolean | undefined;
5520
5601
  functionResultFormatter: AxFunctionResultFormatter;
5521
5602
  };
5522
5603
 
@@ -5674,6 +5755,7 @@ declare class AxGEPA extends AxBaseOptimizer {
5674
5755
  private updateSamplerShuffled;
5675
5756
  private nextMinibatchIndices;
5676
5757
  private rand;
5758
+ private generateOptimizationReport;
5677
5759
  private mergeInstructions;
5678
5760
  }
5679
5761
 
@@ -5832,6 +5914,7 @@ declare class AxMiPRO extends AxBaseOptimizer {
5832
5914
  * parameter optimization rather than full MiPRO functionality.
5833
5915
  */
5834
5916
  private compilePython;
5917
+ private generateOptimizationReport;
5835
5918
  /**
5836
5919
  * Simplified evaluation method for Python optimization
5837
5920
  */
package/index.d.ts CHANGED
@@ -2265,8 +2265,8 @@ interface AxBaseAIArgs<TModel, TEmbedModel, TModelKey> {
2265
2265
  declare const axBaseAIDefaultConfig: () => AxModelConfig;
2266
2266
  declare const axBaseAIDefaultCreativeConfig: () => AxModelConfig;
2267
2267
  declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse, TModelKey> implements AxAIService<TModel, TEmbedModel, TModelKey> {
2268
+ #private;
2268
2269
  private readonly aiImpl;
2269
- private debug;
2270
2270
  private rt?;
2271
2271
  private fetch?;
2272
2272
  private tracer?;
@@ -2296,6 +2296,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
2296
2296
  getId(): string;
2297
2297
  setAPIURL(apiURL: string): void;
2298
2298
  setHeaders(headers: () => Promise<Record<string, string>>): void;
2299
+ get debug(): boolean;
2299
2300
  setOptions(options: Readonly<AxAIServiceOptions>): void;
2300
2301
  getOptions(): Readonly<AxAIServiceOptions>;
2301
2302
  getLogger(): AxLoggerFunction;
@@ -3380,8 +3381,20 @@ type AxAICohereEmbedResponse = {
3380
3381
  embeddings: number[][];
3381
3382
  };
3382
3383
 
3384
+ /**
3385
+ * Creates the default configuration for Cohere AI service
3386
+ * @returns A deep clone of the default Cohere configuration with CommandRPlus model and EmbedEnglishV30 embed model
3387
+ */
3383
3388
  declare const axAICohereDefaultConfig: () => AxAICohereConfig;
3389
+ /**
3390
+ * Creates a creative configuration for Cohere AI service with more flexible parameters
3391
+ * @returns A deep clone of the creative Cohere configuration with CommandR model and EmbedEnglishV30 embed model
3392
+ */
3384
3393
  declare const axAICohereCreativeConfig: () => AxAICohereConfig;
3394
+ /**
3395
+ * Configuration arguments for initializing the Cohere AI service
3396
+ * @template TModelKey - The type of model keys supported
3397
+ */
3385
3398
  interface AxAICohereArgs<TModelKey> {
3386
3399
  name: 'cohere';
3387
3400
  apiKey: string;
@@ -3389,7 +3402,15 @@ interface AxAICohereArgs<TModelKey> {
3389
3402
  options?: Readonly<AxAIServiceOptions>;
3390
3403
  models?: AxAIInputModelList<AxAICohereModel, AxAICohereEmbedModel, TModelKey>;
3391
3404
  }
3405
+ /**
3406
+ * Main Cohere AI service class that extends the base AI implementation
3407
+ * @template TModelKey - The type of model keys supported
3408
+ */
3392
3409
  declare class AxAICohere<TModelKey> extends AxBaseAI<AxAICohereModel, AxAICohereEmbedModel, AxAICohereChatRequest, AxAICohereEmbedRequest, AxAICohereChatResponse, AxAICohereChatResponseDelta, AxAICohereEmbedResponse, TModelKey> {
3410
+ /**
3411
+ * Creates a new instance of AxAICohere
3412
+ * @param args - Configuration arguments including API key, config, options, and models
3413
+ */
3393
3414
  constructor({ apiKey, config, options, models, }: Readonly<Omit<AxAICohereArgs<TModelKey>, 'name'>>);
3394
3415
  }
3395
3416
 
@@ -3404,11 +3425,41 @@ declare enum AxAIDeepSeekModel {
3404
3425
  DeepSeekReasoner = "deepseek-reasoner"
3405
3426
  }
3406
3427
 
3428
+ /**
3429
+ * Configuration type for DeepSeek AI models
3430
+ */
3407
3431
  type DeepSeekConfig = AxAIOpenAIConfig<AxAIDeepSeekModel, undefined>;
3432
+ /**
3433
+ * Creates the default configuration for DeepSeek AI with the chat model
3434
+ * @returns Default DeepSeek configuration with chat model settings
3435
+ */
3408
3436
  declare const axAIDeepSeekDefaultConfig: () => DeepSeekConfig;
3437
+ /**
3438
+ * Creates a configuration optimized for code generation tasks using DeepSeek Coder
3439
+ * @returns DeepSeek configuration with creative settings for coding tasks
3440
+ */
3409
3441
  declare const axAIDeepSeekCodeConfig: () => DeepSeekConfig;
3442
+ /**
3443
+ * Arguments type for initializing DeepSeek AI instances
3444
+ * @template TModelKey - The model key type for type safety
3445
+ */
3410
3446
  type AxAIDeepSeekArgs<TModelKey> = AxAIOpenAIArgs<'deepseek', AxAIDeepSeekModel, undefined, TModelKey>;
3447
+ /**
3448
+ * DeepSeek AI client implementation extending OpenAI base functionality
3449
+ * Provides access to DeepSeek's language models through OpenAI-compatible API
3450
+ * @template TModelKey - The model key type for type safety
3451
+ */
3411
3452
  declare class AxAIDeepSeek<TModelKey> extends AxAIOpenAIBase<AxAIDeepSeekModel, undefined, TModelKey> {
3453
+ /**
3454
+ * Creates a new DeepSeek AI client instance
3455
+ * @param args - Configuration arguments for the DeepSeek client
3456
+ * @param args.apiKey - DeepSeek API key for authentication
3457
+ * @param args.config - Optional configuration overrides
3458
+ * @param args.options - Optional client options
3459
+ * @param args.models - Optional model definitions
3460
+ * @param args.modelInfo - Optional additional model information
3461
+ * @throws {Error} When API key is not provided or empty
3462
+ */
3412
3463
  constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIDeepSeekArgs<TModelKey>, 'name'>>);
3413
3464
  }
3414
3465
 
@@ -3424,7 +3475,10 @@ declare enum AxAIGoogleGeminiModel {
3424
3475
  Gemini15Flash = "gemini-1.5-flash",
3425
3476
  Gemini15Flash002 = "gemini-1.5-flash-002",
3426
3477
  Gemini15Flash8B = "gemini-1.5-flash-8b",
3427
- Gemini15Pro = "gemini-1.5-pro"
3478
+ Gemini15Pro = "gemini-1.5-pro",
3479
+ GeminiFlashLatest = "gemini-flash-latest",
3480
+ GeminiFlashLiteLatest = "gemini-flash-lite-latest",
3481
+ GeminiProLatest = "gemini-pro-latest"
3428
3482
  }
3429
3483
  declare enum AxAIGoogleGeminiEmbedModel {
3430
3484
  GeminiEmbedding = "gemini-embedding-exp",
@@ -3967,18 +4021,44 @@ declare class AxMultiServiceRouter<TServices extends readonly (AxAIService | AxA
3967
4021
  }): void;
3968
4022
  }
3969
4023
 
4024
+ /**
4025
+ * Configuration type for Ollama AI service
4026
+ */
3970
4027
  type AxAIOllamaAIConfig = AxAIOpenAIConfig<string, string>;
4028
+ /**
4029
+ * Creates default configuration for Ollama AI service
4030
+ * @returns Default configuration object with nous-hermes2 model and all-minilm embed model
4031
+ */
3971
4032
  declare const axAIOllamaDefaultConfig: () => AxAIOllamaAIConfig;
4033
+ /**
4034
+ * Creates default creative configuration for Ollama AI service
4035
+ * @returns Creative configuration object with nous-hermes2 model and all-minilm embed model
4036
+ */
3972
4037
  declare const axAIOllamaDefaultCreativeConfig: () => AxAIOllamaAIConfig;
4038
+ /**
4039
+ * Arguments type for initializing Ollama AI service
4040
+ * @template TModelKey - Type for model key
4041
+ */
3973
4042
  type AxAIOllamaArgs<TModelKey> = AxAIOpenAIArgs<'ollama', string, string, TModelKey> & {
3974
4043
  model?: string;
3975
4044
  embedModel?: string;
3976
4045
  url?: string;
3977
4046
  };
3978
4047
  /**
3979
- * OllamaAI: AI Service
4048
+ * Ollama AI service implementation that extends OpenAI base functionality
4049
+ * Provides access to locally hosted Ollama models with OpenAI-compatible API
4050
+ * @template TModelKey - Type for model key
3980
4051
  */
3981
4052
  declare class AxAIOllama<TModelKey> extends AxAIOpenAIBase<string, string, TModelKey> {
4053
+ /**
4054
+ * Creates a new Ollama AI service instance
4055
+ * @param args - Configuration arguments for the Ollama service
4056
+ * @param args.apiKey - API key for authentication (defaults to 'not-set')
4057
+ * @param args.url - Base URL for the Ollama API (defaults to 'http://localhost:11434/v1')
4058
+ * @param args.config - Additional configuration options
4059
+ * @param args.options - Service options
4060
+ * @param args.models - Available models configuration
4061
+ */
3982
4062
  constructor({ apiKey, url, config, options, models, }: Readonly<Omit<AxAIOllamaArgs<TModelKey>, 'name'>>);
3983
4063
  }
3984
4064
 
@@ -5517,6 +5597,7 @@ declare const axGlobals: {
5517
5597
  meter: Meter | undefined;
5518
5598
  logger: AxLoggerFunction | undefined;
5519
5599
  optimizerLogger: AxOptimizerLoggerFunction | undefined;
5600
+ debug: boolean | undefined;
5520
5601
  functionResultFormatter: AxFunctionResultFormatter;
5521
5602
  };
5522
5603
 
@@ -5674,6 +5755,7 @@ declare class AxGEPA extends AxBaseOptimizer {
5674
5755
  private updateSamplerShuffled;
5675
5756
  private nextMinibatchIndices;
5676
5757
  private rand;
5758
+ private generateOptimizationReport;
5677
5759
  private mergeInstructions;
5678
5760
  }
5679
5761
 
@@ -5832,6 +5914,7 @@ declare class AxMiPRO extends AxBaseOptimizer {
5832
5914
  * parameter optimization rather than full MiPRO functionality.
5833
5915
  */
5834
5916
  private compilePython;
5917
+ private generateOptimizationReport;
5835
5918
  /**
5836
5919
  * Simplified evaluation method for Python optimization
5837
5920
  */