@ax-llm/ax 12.0.13 → 12.0.15

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
@@ -2911,14 +2911,15 @@ interface AxMiPROOptimizerOptions {
2911
2911
  bayesianOptimization?: boolean;
2912
2912
  acquisitionFunction?: 'expected_improvement' | 'upper_confidence_bound' | 'probability_improvement';
2913
2913
  explorationWeight?: number;
2914
+ sampleCount?: number;
2914
2915
  }
2915
2916
  interface AxBootstrapCompileOptions extends AxCompileOptions {
2916
- valset?: readonly AxExample[];
2917
+ validationExamples?: readonly AxExample[];
2917
2918
  maxDemos?: number;
2918
2919
  teacherProgram?: Readonly<AxProgram<AxGenIn, AxGenOut>>;
2919
2920
  }
2920
2921
  interface AxMiPROCompileOptions extends AxCompileOptions {
2921
- valset?: readonly AxExample[];
2922
+ validationExamples?: readonly AxExample[];
2922
2923
  teacher?: Readonly<AxProgram<AxGenIn, AxGenOut>>;
2923
2924
  auto?: 'light' | 'medium' | 'heavy';
2924
2925
  instructionCandidates?: string[];
@@ -3745,6 +3746,9 @@ declare class AxMiPRO<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGen
3745
3746
  private bayesianOptimization;
3746
3747
  private acquisitionFunction;
3747
3748
  private explorationWeight;
3749
+ private sampleCount;
3750
+ private miproConfigHistory;
3751
+ private surrogateModel;
3748
3752
  constructor(args: Readonly<AxOptimizerArgs & {
3749
3753
  options?: AxMiPROOptimizerOptions;
3750
3754
  }>);
@@ -3758,12 +3762,23 @@ declare class AxMiPRO<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGen
3758
3762
  */
3759
3763
  private generateTips;
3760
3764
  /**
3761
- * Generates instruction candidates using the teacher model if available
3765
+ * Generates program summary for context-aware instruction generation
3766
+ */
3767
+ private generateProgramSummary;
3768
+ /**
3769
+ * Generates dataset summary for context-aware instruction generation
3770
+ */
3771
+ private generateDatasetSummary;
3772
+ /**
3773
+ * Enhanced instruction generation using AI with program and data awareness
3774
+ */
3775
+ private generateInstruction;
3776
+ /**
3777
+ * Generates instruction candidates using enhanced AI-powered generation
3762
3778
  * @param options Optional compile options that may override teacher AI
3763
3779
  * @returns Array of generated instruction candidates
3764
3780
  */
3765
3781
  private proposeInstructionCandidates;
3766
- private generateInstruction;
3767
3782
  /**
3768
3783
  * Bootstraps few-shot examples for the program
3769
3784
  */
@@ -3777,6 +3792,10 @@ declare class AxMiPRO<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGen
3777
3792
  */
3778
3793
  private runOptimization;
3779
3794
  private evaluateConfig;
3795
+ /**
3796
+ * Fisher-Yates shuffle for stochastic evaluation
3797
+ */
3798
+ private shuffleArray;
3780
3799
  private applyConfigToProgram;
3781
3800
  /**
3782
3801
  * The main compile method to run MIPROv2 optimization
@@ -3810,6 +3829,30 @@ declare class AxMiPRO<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGen
3810
3829
  issues: string[];
3811
3830
  suggestions: string[];
3812
3831
  };
3832
+ /**
3833
+ * Encodes a configuration into a string key for surrogate model lookup
3834
+ */
3835
+ private encodeConfiguration;
3836
+ /**
3837
+ * Updates the surrogate model with a new configuration-score pair
3838
+ */
3839
+ private updateSurrogateModel;
3840
+ /**
3841
+ * Predicts performance using the surrogate model
3842
+ */
3843
+ private predictPerformance;
3844
+ /**
3845
+ * Calculates acquisition function value for Bayesian optimization
3846
+ */
3847
+ private calculateAcquisitionValue;
3848
+ /**
3849
+ * Error function approximation for acquisition function calculations
3850
+ */
3851
+ private erf;
3852
+ /**
3853
+ * Selects the next configuration to evaluate using Bayesian optimization
3854
+ */
3855
+ private selectConfigurationViaBayesianOptimization;
3813
3856
  }
3814
3857
 
3815
3858
  type AxMockAIServiceConfig = {
package/index.d.ts CHANGED
@@ -2911,14 +2911,15 @@ interface AxMiPROOptimizerOptions {
2911
2911
  bayesianOptimization?: boolean;
2912
2912
  acquisitionFunction?: 'expected_improvement' | 'upper_confidence_bound' | 'probability_improvement';
2913
2913
  explorationWeight?: number;
2914
+ sampleCount?: number;
2914
2915
  }
2915
2916
  interface AxBootstrapCompileOptions extends AxCompileOptions {
2916
- valset?: readonly AxExample[];
2917
+ validationExamples?: readonly AxExample[];
2917
2918
  maxDemos?: number;
2918
2919
  teacherProgram?: Readonly<AxProgram<AxGenIn, AxGenOut>>;
2919
2920
  }
2920
2921
  interface AxMiPROCompileOptions extends AxCompileOptions {
2921
- valset?: readonly AxExample[];
2922
+ validationExamples?: readonly AxExample[];
2922
2923
  teacher?: Readonly<AxProgram<AxGenIn, AxGenOut>>;
2923
2924
  auto?: 'light' | 'medium' | 'heavy';
2924
2925
  instructionCandidates?: string[];
@@ -3745,6 +3746,9 @@ declare class AxMiPRO<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGen
3745
3746
  private bayesianOptimization;
3746
3747
  private acquisitionFunction;
3747
3748
  private explorationWeight;
3749
+ private sampleCount;
3750
+ private miproConfigHistory;
3751
+ private surrogateModel;
3748
3752
  constructor(args: Readonly<AxOptimizerArgs & {
3749
3753
  options?: AxMiPROOptimizerOptions;
3750
3754
  }>);
@@ -3758,12 +3762,23 @@ declare class AxMiPRO<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGen
3758
3762
  */
3759
3763
  private generateTips;
3760
3764
  /**
3761
- * Generates instruction candidates using the teacher model if available
3765
+ * Generates program summary for context-aware instruction generation
3766
+ */
3767
+ private generateProgramSummary;
3768
+ /**
3769
+ * Generates dataset summary for context-aware instruction generation
3770
+ */
3771
+ private generateDatasetSummary;
3772
+ /**
3773
+ * Enhanced instruction generation using AI with program and data awareness
3774
+ */
3775
+ private generateInstruction;
3776
+ /**
3777
+ * Generates instruction candidates using enhanced AI-powered generation
3762
3778
  * @param options Optional compile options that may override teacher AI
3763
3779
  * @returns Array of generated instruction candidates
3764
3780
  */
3765
3781
  private proposeInstructionCandidates;
3766
- private generateInstruction;
3767
3782
  /**
3768
3783
  * Bootstraps few-shot examples for the program
3769
3784
  */
@@ -3777,6 +3792,10 @@ declare class AxMiPRO<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGen
3777
3792
  */
3778
3793
  private runOptimization;
3779
3794
  private evaluateConfig;
3795
+ /**
3796
+ * Fisher-Yates shuffle for stochastic evaluation
3797
+ */
3798
+ private shuffleArray;
3780
3799
  private applyConfigToProgram;
3781
3800
  /**
3782
3801
  * The main compile method to run MIPROv2 optimization
@@ -3810,6 +3829,30 @@ declare class AxMiPRO<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGen
3810
3829
  issues: string[];
3811
3830
  suggestions: string[];
3812
3831
  };
3832
+ /**
3833
+ * Encodes a configuration into a string key for surrogate model lookup
3834
+ */
3835
+ private encodeConfiguration;
3836
+ /**
3837
+ * Updates the surrogate model with a new configuration-score pair
3838
+ */
3839
+ private updateSurrogateModel;
3840
+ /**
3841
+ * Predicts performance using the surrogate model
3842
+ */
3843
+ private predictPerformance;
3844
+ /**
3845
+ * Calculates acquisition function value for Bayesian optimization
3846
+ */
3847
+ private calculateAcquisitionValue;
3848
+ /**
3849
+ * Error function approximation for acquisition function calculations
3850
+ */
3851
+ private erf;
3852
+ /**
3853
+ * Selects the next configuration to evaluate using Bayesian optimization
3854
+ */
3855
+ private selectConfigurationViaBayesianOptimization;
3813
3856
  }
3814
3857
 
3815
3858
  type AxMockAIServiceConfig = {