@ax-llm/ax 12.0.6 → 12.0.8
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.cjs +1348 -727
- package/index.cjs.map +1 -1
- package/index.d.cts +525 -195
- package/index.d.ts +525 -195
- package/index.js +1350 -731
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.cts
CHANGED
|
@@ -715,7 +715,14 @@ type AxAIOpenAIChatRequest<TModel> = {
|
|
|
715
715
|
text: string;
|
|
716
716
|
};
|
|
717
717
|
name?: string;
|
|
718
|
-
|
|
718
|
+
} | {
|
|
719
|
+
role: 'assistant';
|
|
720
|
+
content?: string | {
|
|
721
|
+
type: string;
|
|
722
|
+
text: string;
|
|
723
|
+
};
|
|
724
|
+
name?: string;
|
|
725
|
+
tool_calls: {
|
|
719
726
|
type: 'function';
|
|
720
727
|
function: {
|
|
721
728
|
name: string;
|
|
@@ -2101,7 +2108,7 @@ interface AxField {
|
|
|
2101
2108
|
description?: string;
|
|
2102
2109
|
type?: {
|
|
2103
2110
|
name: 'string' | 'number' | 'boolean' | 'json' | 'image' | 'audio' | 'date' | 'datetime' | 'class' | 'code';
|
|
2104
|
-
isArray
|
|
2111
|
+
isArray?: boolean;
|
|
2105
2112
|
options?: string[];
|
|
2106
2113
|
};
|
|
2107
2114
|
isOptional?: boolean;
|
|
@@ -2110,6 +2117,11 @@ interface AxField {
|
|
|
2110
2117
|
type AxIField = Omit<AxField, 'title'> & {
|
|
2111
2118
|
title: string;
|
|
2112
2119
|
};
|
|
2120
|
+
interface AxSignatureConfig {
|
|
2121
|
+
description?: string;
|
|
2122
|
+
inputs: readonly AxField[];
|
|
2123
|
+
outputs: readonly AxField[];
|
|
2124
|
+
}
|
|
2113
2125
|
declare class AxSignature {
|
|
2114
2126
|
private description?;
|
|
2115
2127
|
private inputFields;
|
|
@@ -2117,7 +2129,7 @@ declare class AxSignature {
|
|
|
2117
2129
|
private sigHash;
|
|
2118
2130
|
private sigString;
|
|
2119
2131
|
private validatedAtHash?;
|
|
2120
|
-
constructor(signature?: Readonly<AxSignature | string>);
|
|
2132
|
+
constructor(signature?: Readonly<AxSignature | string | AxSignatureConfig>);
|
|
2121
2133
|
private parseParsedField;
|
|
2122
2134
|
private parseField;
|
|
2123
2135
|
setDescription: (desc: string) => void;
|
|
@@ -2316,7 +2328,9 @@ type AxFieldValue = string | string[] | number | boolean | object | null | undef
|
|
|
2316
2328
|
type AxGenIn = {
|
|
2317
2329
|
[key: string]: AxFieldValue;
|
|
2318
2330
|
};
|
|
2319
|
-
type AxGenOut =
|
|
2331
|
+
type AxGenOut = {
|
|
2332
|
+
[key: string]: AxFieldValue;
|
|
2333
|
+
};
|
|
2320
2334
|
type AxMessage<IN extends AxGenIn> = {
|
|
2321
2335
|
role: 'user';
|
|
2322
2336
|
values: IN;
|
|
@@ -2374,15 +2388,15 @@ declare class AxPromptTemplate {
|
|
|
2374
2388
|
private defaultRenderInField;
|
|
2375
2389
|
}
|
|
2376
2390
|
|
|
2377
|
-
type AxProgramTrace = {
|
|
2378
|
-
trace:
|
|
2391
|
+
type AxProgramTrace<IN extends AxGenIn, OUT extends AxGenOut> = {
|
|
2392
|
+
trace: OUT & IN;
|
|
2379
2393
|
programId: string;
|
|
2380
2394
|
};
|
|
2381
|
-
type AxProgramDemos = {
|
|
2382
|
-
traces:
|
|
2395
|
+
type AxProgramDemos<IN extends AxGenIn, OUT extends AxGenOut> = {
|
|
2396
|
+
traces: (OUT & IN)[];
|
|
2383
2397
|
programId: string;
|
|
2384
2398
|
};
|
|
2385
|
-
type AxProgramExamples = AxProgramDemos | AxProgramDemos['traces'];
|
|
2399
|
+
type AxProgramExamples<IN extends AxGenIn, OUT extends AxGenOut> = AxProgramDemos<IN, OUT> | AxProgramDemos<IN, OUT>['traces'];
|
|
2386
2400
|
type AxProgramForwardOptions = {
|
|
2387
2401
|
maxRetries?: number;
|
|
2388
2402
|
maxSteps?: number;
|
|
@@ -2420,12 +2434,12 @@ type AxGenDeltaOut<OUT extends AxGenOut> = {
|
|
|
2420
2434
|
};
|
|
2421
2435
|
type AxGenStreamingOut<OUT extends AxGenOut> = AsyncGenerator<AxGenDeltaOut<OUT>, void | OUT, unknown>;
|
|
2422
2436
|
type AxSetExamplesOptions = {};
|
|
2423
|
-
interface AxTunable {
|
|
2424
|
-
setExamples: (examples: Readonly<AxProgramExamples
|
|
2437
|
+
interface AxTunable<IN extends AxGenIn, OUT extends AxGenOut> {
|
|
2438
|
+
setExamples: (examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>) => void;
|
|
2425
2439
|
setId: (id: string) => void;
|
|
2426
2440
|
setParentId: (parentId: string) => void;
|
|
2427
|
-
getTraces: () => AxProgramTrace[];
|
|
2428
|
-
setDemos: (demos: readonly AxProgramDemos[]) => void;
|
|
2441
|
+
getTraces: () => AxProgramTrace<IN, OUT>[];
|
|
2442
|
+
setDemos: (demos: readonly AxProgramDemos<IN, OUT>[]) => void;
|
|
2429
2443
|
}
|
|
2430
2444
|
interface AxUsable {
|
|
2431
2445
|
getUsage: () => AxProgramUsage[];
|
|
@@ -2438,53 +2452,53 @@ type AxProgramUsage = AxChatResponse['modelUsage'] & {
|
|
|
2438
2452
|
interface AxProgramWithSignatureOptions {
|
|
2439
2453
|
description?: string;
|
|
2440
2454
|
}
|
|
2441
|
-
declare class AxProgramWithSignature<IN extends AxGenIn, OUT extends AxGenOut> implements AxTunable, AxUsable {
|
|
2455
|
+
declare class AxProgramWithSignature<IN extends AxGenIn, OUT extends AxGenOut> implements AxTunable<IN, OUT>, AxUsable {
|
|
2442
2456
|
protected signature: AxSignature;
|
|
2443
2457
|
protected sigHash: string;
|
|
2444
|
-
protected examples?:
|
|
2458
|
+
protected examples?: OUT[];
|
|
2445
2459
|
protected examplesOptions?: AxSetExamplesOptions;
|
|
2446
|
-
protected demos?:
|
|
2447
|
-
protected trace?:
|
|
2460
|
+
protected demos?: OUT[];
|
|
2461
|
+
protected trace?: OUT;
|
|
2448
2462
|
protected usage: AxProgramUsage[];
|
|
2449
2463
|
private key;
|
|
2450
2464
|
private children;
|
|
2451
|
-
constructor(signature:
|
|
2465
|
+
constructor(signature: NonNullable<ConstructorParameters<typeof AxSignature>[0]>, options?: Readonly<AxProgramWithSignatureOptions>);
|
|
2452
2466
|
getSignature(): AxSignature;
|
|
2453
|
-
register(prog: Readonly<AxTunable & AxUsable>): void;
|
|
2467
|
+
register(prog: Readonly<AxTunable<IN, OUT> & AxUsable>): void;
|
|
2454
2468
|
forward(_ai: Readonly<AxAIService>, _values: IN | AxMessage<IN>[], _options?: Readonly<AxProgramForwardOptions>): Promise<OUT>;
|
|
2455
2469
|
streamingForward(_ai: Readonly<AxAIService>, _values: IN | AxMessage<IN>[], _options?: Readonly<AxProgramStreamingForwardOptions>): AxGenStreamingOut<OUT>;
|
|
2456
2470
|
setId(id: string): void;
|
|
2457
2471
|
setParentId(parentId: string): void;
|
|
2458
|
-
setExamples(examples: Readonly<AxProgramExamples
|
|
2472
|
+
setExamples(examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>): void;
|
|
2459
2473
|
private _setExamples;
|
|
2460
|
-
getTraces(): AxProgramTrace[];
|
|
2474
|
+
getTraces(): AxProgramTrace<IN, OUT>[];
|
|
2461
2475
|
getUsage(): AxProgramUsage[];
|
|
2462
2476
|
resetUsage(): void;
|
|
2463
|
-
setDemos(demos: readonly AxProgramDemos[]): void;
|
|
2477
|
+
setDemos(demos: readonly AxProgramDemos<IN, OUT>[]): void;
|
|
2464
2478
|
}
|
|
2465
|
-
declare class AxProgram<IN extends AxGenIn, OUT extends AxGenOut> implements AxTunable, AxUsable {
|
|
2466
|
-
protected trace?:
|
|
2479
|
+
declare class AxProgram<IN extends AxGenIn, OUT extends AxGenOut> implements AxTunable<IN, OUT>, AxUsable {
|
|
2480
|
+
protected trace?: OUT;
|
|
2467
2481
|
protected usage: AxProgramUsage[];
|
|
2468
2482
|
private key;
|
|
2469
2483
|
private children;
|
|
2470
2484
|
constructor();
|
|
2471
|
-
register(prog: Readonly<AxTunable & AxUsable>): void;
|
|
2485
|
+
register(prog: Readonly<AxTunable<IN, OUT> & AxUsable>): void;
|
|
2472
2486
|
forward(_ai: Readonly<AxAIService>, _values: IN | AxMessage<IN>[], _options?: Readonly<AxProgramForwardOptions>): Promise<OUT>;
|
|
2473
2487
|
streamingForward(_ai: Readonly<AxAIService>, _values: IN | AxMessage<IN>[], _options?: Readonly<AxProgramStreamingForwardOptions>): AxGenStreamingOut<OUT>;
|
|
2474
2488
|
setId(id: string): void;
|
|
2475
2489
|
setParentId(parentId: string): void;
|
|
2476
|
-
setExamples(examples: Readonly<AxProgramExamples
|
|
2477
|
-
getTraces(): AxProgramTrace[];
|
|
2490
|
+
setExamples(examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>): void;
|
|
2491
|
+
getTraces(): AxProgramTrace<IN, OUT>[];
|
|
2478
2492
|
getUsage(): AxProgramUsage[];
|
|
2479
2493
|
resetUsage(): void;
|
|
2480
|
-
setDemos(demos: readonly AxProgramDemos[]): void;
|
|
2494
|
+
setDemos(demos: readonly AxProgramDemos<IN, OUT>[]): void;
|
|
2481
2495
|
}
|
|
2482
2496
|
|
|
2483
2497
|
/**
|
|
2484
2498
|
* Interface for agents that can be used as child agents.
|
|
2485
2499
|
* Provides methods to get the agent's function definition and features.
|
|
2486
2500
|
*/
|
|
2487
|
-
interface AxAgentic extends AxTunable, AxUsable {
|
|
2501
|
+
interface AxAgentic<IN extends AxGenIn, OUT extends AxGenOut> extends AxTunable<IN, OUT>, AxUsable {
|
|
2488
2502
|
getFunction(): AxFunction;
|
|
2489
2503
|
getFeatures(): AxAgentFeatures;
|
|
2490
2504
|
}
|
|
@@ -2504,7 +2518,7 @@ interface AxAgentFeatures {
|
|
|
2504
2518
|
* An AI agent that can process inputs using an AI service and coordinate with child agents.
|
|
2505
2519
|
* Supports features like smart model routing and automatic input field passing to child agents.
|
|
2506
2520
|
*/
|
|
2507
|
-
declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut
|
|
2521
|
+
declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut> implements AxAgentic<IN, OUT> {
|
|
2508
2522
|
private ai?;
|
|
2509
2523
|
private program;
|
|
2510
2524
|
private functions?;
|
|
@@ -2519,15 +2533,15 @@ declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut = AxGenOut> imple
|
|
|
2519
2533
|
name: string;
|
|
2520
2534
|
description: string;
|
|
2521
2535
|
definition?: string;
|
|
2522
|
-
signature: AxSignature
|
|
2523
|
-
agents?: AxAgentic[];
|
|
2536
|
+
signature: NonNullable<ConstructorParameters<typeof AxSignature>[0]>;
|
|
2537
|
+
agents?: AxAgentic<IN, OUT>[];
|
|
2524
2538
|
functions?: AxInputFunctionType;
|
|
2525
2539
|
}>, options?: Readonly<AxAgentOptions>);
|
|
2526
|
-
setExamples(examples: Readonly<AxProgramExamples
|
|
2540
|
+
setExamples(examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>): void;
|
|
2527
2541
|
setId(id: string): void;
|
|
2528
2542
|
setParentId(parentId: string): void;
|
|
2529
|
-
getTraces(): AxProgramTrace[];
|
|
2530
|
-
setDemos(demos: readonly AxProgramDemos[]): void;
|
|
2543
|
+
getTraces(): AxProgramTrace<IN, OUT>[];
|
|
2544
|
+
setDemos(demos: readonly AxProgramDemos<IN, OUT>[]): void;
|
|
2531
2545
|
getUsage(): (AxModelUsage & {
|
|
2532
2546
|
ai: string;
|
|
2533
2547
|
model: string;
|
|
@@ -2622,6 +2636,434 @@ declare class AxBalancer implements AxAIService<unknown, unknown> {
|
|
|
2622
2636
|
getLogger(): AxLoggerFunction;
|
|
2623
2637
|
}
|
|
2624
2638
|
|
|
2639
|
+
type AxExample = Record<string, AxFieldValue>;
|
|
2640
|
+
type AxMetricFn = <T extends AxGenOut = AxGenOut>(arg0: Readonly<{
|
|
2641
|
+
prediction: T;
|
|
2642
|
+
example: AxExample;
|
|
2643
|
+
}>) => number | Promise<number>;
|
|
2644
|
+
type AxMetricFnArgs = Parameters<AxMetricFn>[0];
|
|
2645
|
+
type AxMultiMetricFn = <T extends AxGenOut = AxGenOut>(arg0: Readonly<{
|
|
2646
|
+
prediction: T;
|
|
2647
|
+
example: AxExample;
|
|
2648
|
+
}>) => Record<string, number>;
|
|
2649
|
+
interface AxOptimizationProgress {
|
|
2650
|
+
round: number;
|
|
2651
|
+
totalRounds: number;
|
|
2652
|
+
currentScore: number;
|
|
2653
|
+
bestScore: number;
|
|
2654
|
+
tokensUsed: number;
|
|
2655
|
+
timeElapsed: number;
|
|
2656
|
+
successfulExamples: number;
|
|
2657
|
+
totalExamples: number;
|
|
2658
|
+
currentConfiguration?: Record<string, unknown>;
|
|
2659
|
+
convergenceInfo?: {
|
|
2660
|
+
improvement: number;
|
|
2661
|
+
stagnationRounds: number;
|
|
2662
|
+
isConverging: boolean;
|
|
2663
|
+
};
|
|
2664
|
+
}
|
|
2665
|
+
interface AxCostTracker {
|
|
2666
|
+
trackTokens(count: number, model: string): void;
|
|
2667
|
+
getCurrentCost(): number;
|
|
2668
|
+
getTokenUsage(): Record<string, number>;
|
|
2669
|
+
getTotalTokens(): number;
|
|
2670
|
+
isLimitReached(): boolean;
|
|
2671
|
+
reset(): void;
|
|
2672
|
+
}
|
|
2673
|
+
interface AxOptimizationCheckpoint {
|
|
2674
|
+
version: string;
|
|
2675
|
+
timestamp: number;
|
|
2676
|
+
optimizerType: string;
|
|
2677
|
+
optimizerConfig: Record<string, unknown>;
|
|
2678
|
+
currentRound: number;
|
|
2679
|
+
totalRounds: number;
|
|
2680
|
+
bestScore: number;
|
|
2681
|
+
bestConfiguration?: Record<string, unknown>;
|
|
2682
|
+
scoreHistory: number[];
|
|
2683
|
+
configurationHistory: Record<string, unknown>[];
|
|
2684
|
+
stats: AxOptimizationStats;
|
|
2685
|
+
optimizerState: Record<string, unknown>;
|
|
2686
|
+
examples: readonly AxExample[];
|
|
2687
|
+
validationSet?: readonly AxExample[];
|
|
2688
|
+
}
|
|
2689
|
+
type AxCheckpointSaveFn = (checkpoint: Readonly<AxOptimizationCheckpoint>) => Promise<string>;
|
|
2690
|
+
type AxCheckpointLoadFn = (checkpointId: string) => Promise<AxOptimizationCheckpoint | null>;
|
|
2691
|
+
interface AxCostTrackerOptions {
|
|
2692
|
+
costPerModel?: Record<string, number>;
|
|
2693
|
+
maxCost?: number;
|
|
2694
|
+
maxTokens?: number;
|
|
2695
|
+
}
|
|
2696
|
+
type AxOptimizerArgs = {
|
|
2697
|
+
studentAI: AxAIService;
|
|
2698
|
+
teacherAI?: AxAIService;
|
|
2699
|
+
examples: readonly AxExample[];
|
|
2700
|
+
validationSet?: readonly AxExample[];
|
|
2701
|
+
minSuccessRate?: number;
|
|
2702
|
+
targetScore?: number;
|
|
2703
|
+
onProgress?: (progress: Readonly<AxOptimizationProgress>) => void;
|
|
2704
|
+
onEarlyStop?: (reason: string, stats: Readonly<AxOptimizationStats>) => void;
|
|
2705
|
+
costTracker?: AxCostTracker;
|
|
2706
|
+
checkpointSave?: AxCheckpointSaveFn;
|
|
2707
|
+
checkpointLoad?: AxCheckpointLoadFn;
|
|
2708
|
+
checkpointInterval?: number;
|
|
2709
|
+
resumeFromCheckpoint?: string;
|
|
2710
|
+
seed?: number;
|
|
2711
|
+
};
|
|
2712
|
+
interface AxOptimizationStats {
|
|
2713
|
+
totalCalls: number;
|
|
2714
|
+
successfulDemos: number;
|
|
2715
|
+
estimatedTokenUsage: number;
|
|
2716
|
+
earlyStopped: boolean;
|
|
2717
|
+
earlyStopping?: {
|
|
2718
|
+
bestScoreRound: number;
|
|
2719
|
+
patienceExhausted: boolean;
|
|
2720
|
+
reason: string;
|
|
2721
|
+
};
|
|
2722
|
+
resourceUsage: {
|
|
2723
|
+
totalTokens: number;
|
|
2724
|
+
totalTime: number;
|
|
2725
|
+
avgLatencyPerEval: number;
|
|
2726
|
+
peakMemoryUsage?: number;
|
|
2727
|
+
costByModel: Record<string, number>;
|
|
2728
|
+
};
|
|
2729
|
+
convergenceInfo: {
|
|
2730
|
+
converged: boolean;
|
|
2731
|
+
finalImprovement: number;
|
|
2732
|
+
stagnationRounds: number;
|
|
2733
|
+
convergenceThreshold: number;
|
|
2734
|
+
};
|
|
2735
|
+
evaluationBreakdown?: {
|
|
2736
|
+
trainingScore: number;
|
|
2737
|
+
validationScore: number;
|
|
2738
|
+
crossValidationScores?: number[];
|
|
2739
|
+
standardDeviation?: number;
|
|
2740
|
+
};
|
|
2741
|
+
}
|
|
2742
|
+
interface AxOptimizerResult<OUT extends AxGenOut> {
|
|
2743
|
+
demos?: AxProgramDemos<AxGenIn, OUT>[];
|
|
2744
|
+
stats: AxOptimizationStats;
|
|
2745
|
+
bestScore: number;
|
|
2746
|
+
finalConfiguration?: Record<string, unknown>;
|
|
2747
|
+
scoreHistory?: number[];
|
|
2748
|
+
configurationHistory?: Record<string, unknown>[];
|
|
2749
|
+
}
|
|
2750
|
+
interface AxParetoResult<OUT extends AxGenOut = AxGenOut> extends AxOptimizerResult<OUT> {
|
|
2751
|
+
paretoFront: ReadonlyArray<{
|
|
2752
|
+
demos: readonly AxProgramDemos<AxGenIn, OUT>[];
|
|
2753
|
+
scores: Readonly<Record<string, number>>;
|
|
2754
|
+
configuration: Readonly<Record<string, unknown>>;
|
|
2755
|
+
dominatedSolutions: number;
|
|
2756
|
+
}>;
|
|
2757
|
+
hypervolume?: number;
|
|
2758
|
+
paretoFrontSize: number;
|
|
2759
|
+
convergenceMetrics?: Record<string, number>;
|
|
2760
|
+
}
|
|
2761
|
+
interface AxCompileOptions {
|
|
2762
|
+
maxIterations?: number;
|
|
2763
|
+
earlyStoppingPatience?: number;
|
|
2764
|
+
verbose?: boolean;
|
|
2765
|
+
overrideValidationSet?: readonly AxExample[];
|
|
2766
|
+
overrideTargetScore?: number;
|
|
2767
|
+
overrideCostTracker?: AxCostTracker;
|
|
2768
|
+
overrideTeacherAI?: AxAIService;
|
|
2769
|
+
overrideOnProgress?: (progress: Readonly<AxOptimizationProgress>) => void;
|
|
2770
|
+
overrideOnEarlyStop?: (reason: string, stats: Readonly<AxOptimizationStats>) => void;
|
|
2771
|
+
overrideCheckpointSave?: AxCheckpointSaveFn;
|
|
2772
|
+
overrideCheckpointLoad?: AxCheckpointLoadFn;
|
|
2773
|
+
overrideCheckpointInterval?: number;
|
|
2774
|
+
saveCheckpointOnComplete?: boolean;
|
|
2775
|
+
}
|
|
2776
|
+
interface AxOptimizer<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOut> {
|
|
2777
|
+
/**
|
|
2778
|
+
* Optimize a program using the provided metric function
|
|
2779
|
+
* @param program The program to optimize (moved from constructor)
|
|
2780
|
+
* @param metricFn Evaluation metric function to assess program performance
|
|
2781
|
+
* @param options Optional configuration options that can override constructor settings
|
|
2782
|
+
* @returns Optimization result containing demos, stats, and configuration
|
|
2783
|
+
*/
|
|
2784
|
+
compile(program: Readonly<AxProgram<IN, OUT>>, metricFn: AxMetricFn, options?: AxCompileOptions): Promise<AxOptimizerResult<OUT>>;
|
|
2785
|
+
/**
|
|
2786
|
+
* Optimize a program with real-time streaming updates
|
|
2787
|
+
* @param program The program to optimize
|
|
2788
|
+
* @param metricFn Evaluation metric function
|
|
2789
|
+
* @param options Optional configuration options
|
|
2790
|
+
* @returns Async iterator yielding optimization progress
|
|
2791
|
+
*/
|
|
2792
|
+
compileStream?(program: Readonly<AxProgram<IN, OUT>>, metricFn: AxMetricFn, options?: AxCompileOptions): AsyncIterableIterator<AxOptimizationProgress>;
|
|
2793
|
+
/**
|
|
2794
|
+
* Multi-objective optimization using Pareto frontier
|
|
2795
|
+
* @param program The program to optimize
|
|
2796
|
+
* @param metricFn Multi-objective metric function
|
|
2797
|
+
* @param options Optional configuration options
|
|
2798
|
+
* @returns Pareto optimization result
|
|
2799
|
+
*/
|
|
2800
|
+
compilePareto?(program: Readonly<AxProgram<IN, OUT>>, metricFn: AxMultiMetricFn, options?: AxCompileOptions): Promise<AxParetoResult<OUT>>;
|
|
2801
|
+
/**
|
|
2802
|
+
* Get current optimization statistics
|
|
2803
|
+
* @returns Current optimization statistics
|
|
2804
|
+
*/
|
|
2805
|
+
getStats(): AxOptimizationStats;
|
|
2806
|
+
/**
|
|
2807
|
+
* Cancel ongoing optimization gracefully
|
|
2808
|
+
* @returns Promise that resolves when cancellation is complete
|
|
2809
|
+
*/
|
|
2810
|
+
cancel?(): Promise<void>;
|
|
2811
|
+
/**
|
|
2812
|
+
* Reset optimizer state for reuse with different programs
|
|
2813
|
+
*/
|
|
2814
|
+
reset?(): void;
|
|
2815
|
+
/**
|
|
2816
|
+
* Get optimizer-specific configuration
|
|
2817
|
+
* @returns Current optimizer configuration
|
|
2818
|
+
*/
|
|
2819
|
+
getConfiguration?(): Record<string, unknown>;
|
|
2820
|
+
/**
|
|
2821
|
+
* Update optimizer configuration
|
|
2822
|
+
* @param config New configuration to merge with existing
|
|
2823
|
+
*/
|
|
2824
|
+
updateConfiguration?(config: Readonly<Record<string, unknown>>): void;
|
|
2825
|
+
/**
|
|
2826
|
+
* Validate that the optimizer can handle the given program
|
|
2827
|
+
* @param program Program to validate
|
|
2828
|
+
* @returns Validation result with any issues found
|
|
2829
|
+
*/
|
|
2830
|
+
validateProgram?(program: Readonly<AxProgram<IN, OUT>>): {
|
|
2831
|
+
isValid: boolean;
|
|
2832
|
+
issues: string[];
|
|
2833
|
+
suggestions: string[];
|
|
2834
|
+
};
|
|
2835
|
+
}
|
|
2836
|
+
interface AxBootstrapOptimizerOptions {
|
|
2837
|
+
maxRounds?: number;
|
|
2838
|
+
maxExamples?: number;
|
|
2839
|
+
maxDemos?: number;
|
|
2840
|
+
batchSize?: number;
|
|
2841
|
+
earlyStoppingPatience?: number;
|
|
2842
|
+
teacherAI?: AxAIService;
|
|
2843
|
+
costMonitoring?: boolean;
|
|
2844
|
+
maxTokensPerGeneration?: number;
|
|
2845
|
+
verboseMode?: boolean;
|
|
2846
|
+
debugMode?: boolean;
|
|
2847
|
+
adaptiveBatching?: boolean;
|
|
2848
|
+
dynamicTemperature?: boolean;
|
|
2849
|
+
qualityThreshold?: number;
|
|
2850
|
+
diversityWeight?: number;
|
|
2851
|
+
}
|
|
2852
|
+
interface AxMiPROOptimizerOptions {
|
|
2853
|
+
numCandidates?: number;
|
|
2854
|
+
initTemperature?: number;
|
|
2855
|
+
maxBootstrappedDemos?: number;
|
|
2856
|
+
maxLabeledDemos?: number;
|
|
2857
|
+
numTrials?: number;
|
|
2858
|
+
minibatch?: boolean;
|
|
2859
|
+
minibatchSize?: number;
|
|
2860
|
+
minibatchFullEvalSteps?: number;
|
|
2861
|
+
programAwareProposer?: boolean;
|
|
2862
|
+
dataAwareProposer?: boolean;
|
|
2863
|
+
viewDataBatchSize?: number;
|
|
2864
|
+
tipAwareProposer?: boolean;
|
|
2865
|
+
fewshotAwareProposer?: boolean;
|
|
2866
|
+
verbose?: boolean;
|
|
2867
|
+
earlyStoppingTrials?: number;
|
|
2868
|
+
minImprovementThreshold?: number;
|
|
2869
|
+
bayesianOptimization?: boolean;
|
|
2870
|
+
acquisitionFunction?: 'expected_improvement' | 'upper_confidence_bound' | 'probability_improvement';
|
|
2871
|
+
explorationWeight?: number;
|
|
2872
|
+
}
|
|
2873
|
+
interface AxBootstrapCompileOptions extends AxCompileOptions {
|
|
2874
|
+
valset?: readonly AxExample[];
|
|
2875
|
+
maxDemos?: number;
|
|
2876
|
+
teacherProgram?: Readonly<AxProgram<AxGenIn, AxGenOut>>;
|
|
2877
|
+
}
|
|
2878
|
+
interface AxMiPROCompileOptions extends AxCompileOptions {
|
|
2879
|
+
valset?: readonly AxExample[];
|
|
2880
|
+
teacher?: Readonly<AxProgram<AxGenIn, AxGenOut>>;
|
|
2881
|
+
auto?: 'light' | 'medium' | 'heavy';
|
|
2882
|
+
instructionCandidates?: string[];
|
|
2883
|
+
customProposer?: (context: Readonly<{
|
|
2884
|
+
programSummary: string;
|
|
2885
|
+
dataSummary: string;
|
|
2886
|
+
previousInstructions: string[];
|
|
2887
|
+
}>) => Promise<string[]>;
|
|
2888
|
+
}
|
|
2889
|
+
declare class AxDefaultCostTracker implements AxCostTracker {
|
|
2890
|
+
private tokenUsage;
|
|
2891
|
+
private totalTokens;
|
|
2892
|
+
private readonly costPerModel;
|
|
2893
|
+
private readonly maxCost?;
|
|
2894
|
+
private readonly maxTokens?;
|
|
2895
|
+
constructor(options?: AxCostTrackerOptions);
|
|
2896
|
+
trackTokens(count: number, model: string): void;
|
|
2897
|
+
getCurrentCost(): number;
|
|
2898
|
+
getTokenUsage(): Record<string, number>;
|
|
2899
|
+
getTotalTokens(): number;
|
|
2900
|
+
isLimitReached(): boolean;
|
|
2901
|
+
reset(): void;
|
|
2902
|
+
}
|
|
2903
|
+
/**
|
|
2904
|
+
* Abstract base class for optimizers that provides common functionality
|
|
2905
|
+
* and standardized handling of AxOptimizerArgs
|
|
2906
|
+
*/
|
|
2907
|
+
declare abstract class AxBaseOptimizer<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOut> implements AxOptimizer<IN, OUT> {
|
|
2908
|
+
protected readonly studentAI: AxAIService;
|
|
2909
|
+
protected readonly teacherAI?: AxAIService;
|
|
2910
|
+
protected readonly examples: readonly AxExample[];
|
|
2911
|
+
protected readonly validationSet?: readonly AxExample[];
|
|
2912
|
+
protected readonly targetScore?: number;
|
|
2913
|
+
protected readonly minSuccessRate?: number;
|
|
2914
|
+
protected readonly onProgress?: (progress: Readonly<AxOptimizationProgress>) => void;
|
|
2915
|
+
protected readonly onEarlyStop?: (reason: string, stats: Readonly<AxOptimizationStats>) => void;
|
|
2916
|
+
protected readonly costTracker?: AxCostTracker;
|
|
2917
|
+
protected readonly seed?: number;
|
|
2918
|
+
protected readonly checkpointSave?: AxCheckpointSaveFn;
|
|
2919
|
+
protected readonly checkpointLoad?: AxCheckpointLoadFn;
|
|
2920
|
+
protected readonly checkpointInterval?: number;
|
|
2921
|
+
protected readonly resumeFromCheckpoint?: string;
|
|
2922
|
+
private currentRound;
|
|
2923
|
+
private scoreHistory;
|
|
2924
|
+
private configurationHistory;
|
|
2925
|
+
protected stats: AxOptimizationStats;
|
|
2926
|
+
constructor(args: Readonly<AxOptimizerArgs>);
|
|
2927
|
+
/**
|
|
2928
|
+
* Initialize the optimization statistics structure
|
|
2929
|
+
*/
|
|
2930
|
+
protected initializeStats(): AxOptimizationStats;
|
|
2931
|
+
/**
|
|
2932
|
+
* Set up reproducible random seed if provided
|
|
2933
|
+
*/
|
|
2934
|
+
protected setupRandomSeed(): void;
|
|
2935
|
+
/**
|
|
2936
|
+
* Check if optimization should stop early due to cost limits
|
|
2937
|
+
*/
|
|
2938
|
+
protected checkCostLimits(): boolean;
|
|
2939
|
+
/**
|
|
2940
|
+
* Check if target score has been reached
|
|
2941
|
+
*/
|
|
2942
|
+
protected checkTargetScore(currentScore: number): boolean;
|
|
2943
|
+
/**
|
|
2944
|
+
* Update resource usage statistics
|
|
2945
|
+
*/
|
|
2946
|
+
protected updateResourceUsage(startTime: number, tokensUsed?: number): void;
|
|
2947
|
+
/**
|
|
2948
|
+
* Trigger early stopping with appropriate callbacks
|
|
2949
|
+
*/
|
|
2950
|
+
protected triggerEarlyStopping(reason: string, bestScoreRound: number): void;
|
|
2951
|
+
/**
|
|
2952
|
+
* Get the validation set, with fallback to a split of examples
|
|
2953
|
+
*/
|
|
2954
|
+
protected getValidationSet(options?: AxCompileOptions): readonly AxExample[];
|
|
2955
|
+
/**
|
|
2956
|
+
* Get the AI service to use for a specific task, preferring teacher when available
|
|
2957
|
+
* @param preferTeacher Whether to prefer teacher AI over student AI
|
|
2958
|
+
* @param options Optional compile options that may override teacher AI
|
|
2959
|
+
* @returns The appropriate AI service to use
|
|
2960
|
+
*/
|
|
2961
|
+
protected getAIService(preferTeacher?: boolean, options?: AxCompileOptions): AxAIService;
|
|
2962
|
+
/**
|
|
2963
|
+
* Check if teacher AI is available (including overrides)
|
|
2964
|
+
* @param options Optional compile options that may override teacher AI
|
|
2965
|
+
* @returns True if teacher AI is configured or overridden
|
|
2966
|
+
*/
|
|
2967
|
+
protected hasTeacherAI(options?: AxCompileOptions): boolean;
|
|
2968
|
+
/**
|
|
2969
|
+
* Get teacher AI if available, otherwise return student AI
|
|
2970
|
+
* @param options Optional compile options that may override teacher AI
|
|
2971
|
+
* @returns Teacher AI if available, otherwise student AI
|
|
2972
|
+
*/
|
|
2973
|
+
protected getTeacherOrStudentAI(options?: AxCompileOptions): AxAIService;
|
|
2974
|
+
/**
|
|
2975
|
+
* Execute a task with teacher AI if available, otherwise use student AI
|
|
2976
|
+
* @param task Function that takes an AI service and returns a promise
|
|
2977
|
+
* @param preferTeacher Whether to prefer teacher AI (default: true)
|
|
2978
|
+
* @param options Optional compile options that may override teacher AI
|
|
2979
|
+
* @returns Result of the task execution
|
|
2980
|
+
*/
|
|
2981
|
+
protected executeWithTeacher<T>(task: (ai: AxAIService) => Promise<T>, preferTeacher?: boolean, options?: AxCompileOptions): Promise<T>;
|
|
2982
|
+
/**
|
|
2983
|
+
* Abstract method that must be implemented by concrete optimizers
|
|
2984
|
+
*/
|
|
2985
|
+
abstract compile(program: Readonly<AxProgram<IN, OUT>>, metricFn: AxMetricFn, options?: AxCompileOptions): Promise<AxOptimizerResult<OUT>>;
|
|
2986
|
+
/**
|
|
2987
|
+
* Get current optimization statistics
|
|
2988
|
+
*/
|
|
2989
|
+
getStats(): AxOptimizationStats;
|
|
2990
|
+
/**
|
|
2991
|
+
* Reset optimizer state for reuse with different programs
|
|
2992
|
+
*/
|
|
2993
|
+
reset(): void;
|
|
2994
|
+
/**
|
|
2995
|
+
* Basic program validation that can be extended by concrete optimizers
|
|
2996
|
+
*/
|
|
2997
|
+
validateProgram(program: Readonly<AxProgram<IN, OUT>>): {
|
|
2998
|
+
isValid: boolean;
|
|
2999
|
+
issues: string[];
|
|
3000
|
+
suggestions: string[];
|
|
3001
|
+
};
|
|
3002
|
+
/**
|
|
3003
|
+
* Multi-objective optimization using Pareto frontier
|
|
3004
|
+
* Default implementation that leverages the single-objective compile method
|
|
3005
|
+
* @param program The program to optimize
|
|
3006
|
+
* @param metricFn Multi-objective metric function that returns multiple scores
|
|
3007
|
+
* @param options Optional configuration options
|
|
3008
|
+
* @returns Pareto optimization result with frontier of non-dominated solutions
|
|
3009
|
+
*/
|
|
3010
|
+
compilePareto(program: Readonly<AxProgram<IN, OUT>>, metricFn: AxMultiMetricFn, options?: AxCompileOptions): Promise<AxParetoResult<OUT>>;
|
|
3011
|
+
/**
|
|
3012
|
+
* Generate solutions using different weighted combinations of objectives
|
|
3013
|
+
*/
|
|
3014
|
+
private generateWeightedSolutions;
|
|
3015
|
+
/**
|
|
3016
|
+
* Generate solutions using constraint-based optimization
|
|
3017
|
+
*/
|
|
3018
|
+
private generateConstraintSolutions;
|
|
3019
|
+
/**
|
|
3020
|
+
* Generate different weight combinations for objectives
|
|
3021
|
+
*/
|
|
3022
|
+
private generateWeightCombinations;
|
|
3023
|
+
/**
|
|
3024
|
+
* Evaluate a single-objective result with multi-objective metrics
|
|
3025
|
+
*/
|
|
3026
|
+
private evaluateWithMultiObjective;
|
|
3027
|
+
/**
|
|
3028
|
+
* Find the Pareto frontier from a set of solutions
|
|
3029
|
+
*/
|
|
3030
|
+
private findParetoFrontier;
|
|
3031
|
+
/**
|
|
3032
|
+
* Check if solution A dominates solution B
|
|
3033
|
+
* A dominates B if A is better or equal in all objectives and strictly better in at least one
|
|
3034
|
+
*/
|
|
3035
|
+
private dominates;
|
|
3036
|
+
/**
|
|
3037
|
+
* Calculate hypervolume of the Pareto frontier
|
|
3038
|
+
* Simplified implementation using reference point at origin
|
|
3039
|
+
*/
|
|
3040
|
+
private calculateHypervolume;
|
|
3041
|
+
/**
|
|
3042
|
+
* Save current optimization state to checkpoint
|
|
3043
|
+
*/
|
|
3044
|
+
protected saveCheckpoint(optimizerType: string, optimizerConfig: Record<string, unknown>, bestScore: number, bestConfiguration?: Record<string, unknown>, optimizerState?: Record<string, unknown>, options?: AxCompileOptions): Promise<string | undefined>;
|
|
3045
|
+
/**
|
|
3046
|
+
* Load optimization state from checkpoint
|
|
3047
|
+
*/
|
|
3048
|
+
protected loadCheckpoint(checkpointId: string, options?: AxCompileOptions): Promise<AxOptimizationCheckpoint | null>;
|
|
3049
|
+
/**
|
|
3050
|
+
* Restore optimizer state from checkpoint
|
|
3051
|
+
*/
|
|
3052
|
+
protected restoreFromCheckpoint(checkpoint: Readonly<AxOptimizationCheckpoint>): void;
|
|
3053
|
+
/**
|
|
3054
|
+
* Check if checkpoint should be saved
|
|
3055
|
+
*/
|
|
3056
|
+
protected shouldSaveCheckpoint(round: number, options?: AxCompileOptions): boolean;
|
|
3057
|
+
/**
|
|
3058
|
+
* Update optimization progress and handle checkpointing
|
|
3059
|
+
*/
|
|
3060
|
+
protected updateOptimizationProgress(round: number, score: number, configuration: Record<string, unknown>, optimizerType: string, optimizerConfig: Record<string, unknown>, bestScore: number, bestConfiguration?: Record<string, unknown>, optimizerState?: Record<string, unknown>, options?: AxCompileOptions): Promise<void>;
|
|
3061
|
+
/**
|
|
3062
|
+
* Save final checkpoint on completion
|
|
3063
|
+
*/
|
|
3064
|
+
protected saveFinalCheckpoint(optimizerType: string, optimizerConfig: Record<string, unknown>, bestScore: number, bestConfiguration?: Record<string, unknown>, optimizerState?: Record<string, unknown>, options?: AxCompileOptions): Promise<void>;
|
|
3065
|
+
}
|
|
3066
|
+
|
|
2625
3067
|
type AxDBUpsertRequest = {
|
|
2626
3068
|
id: string;
|
|
2627
3069
|
text?: string;
|
|
@@ -2868,8 +3310,7 @@ declare class AxGen<IN extends AxGenIn, OUT extends AxGenerateResult<AxGenOut> =
|
|
|
2868
3310
|
private values;
|
|
2869
3311
|
private excludeContentFromTrace;
|
|
2870
3312
|
private thoughtFieldName;
|
|
2871
|
-
|
|
2872
|
-
constructor(signature: Readonly<AxSignature | string>, options?: Readonly<AxProgramForwardOptions>);
|
|
3313
|
+
constructor(signature: NonNullable<ConstructorParameters<typeof AxSignature>[0]>, options?: Readonly<AxProgramForwardOptions>);
|
|
2873
3314
|
addAssert: (fn: AxAssertion["fn"], message?: string) => void;
|
|
2874
3315
|
addStreamingAssert: (fieldName: string, fn: AxStreamingAssertion["fn"], message?: string) => void;
|
|
2875
3316
|
private addFieldProcessorInternal;
|
|
@@ -2890,7 +3331,9 @@ declare class AxGen<IN extends AxGenIn, OUT extends AxGenerateResult<AxGenOut> =
|
|
|
2890
3331
|
version: number;
|
|
2891
3332
|
delta: Partial<OUT>;
|
|
2892
3333
|
}, void, unknown>;
|
|
2893
|
-
setExamples(examples: Readonly<AxProgramExamples
|
|
3334
|
+
setExamples(examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>): void;
|
|
3335
|
+
private isDebug;
|
|
3336
|
+
private getLogger;
|
|
2894
3337
|
}
|
|
2895
3338
|
type AxGenerateErrorDetails = {
|
|
2896
3339
|
model?: string;
|
|
@@ -3238,111 +3681,10 @@ declare class AxMCPStreambleHTTPTransport implements AxMCPTransport {
|
|
|
3238
3681
|
close(): void;
|
|
3239
3682
|
}
|
|
3240
3683
|
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
prediction: T;
|
|
3244
|
-
example: AxExample;
|
|
3245
|
-
}>) => number;
|
|
3246
|
-
type AxMetricFnArgs = Parameters<AxMetricFn>[0];
|
|
3247
|
-
type AxOptimizerArgs<IN extends AxGenIn, OUT extends AxGenOut> = {
|
|
3248
|
-
ai: AxAIService;
|
|
3249
|
-
program: Readonly<AxProgram<IN, OUT>>;
|
|
3250
|
-
examples: Readonly<AxExample[]>;
|
|
3251
|
-
options?: Record<string, unknown>;
|
|
3252
|
-
};
|
|
3253
|
-
interface AxOptimizationStats {
|
|
3254
|
-
totalCalls: number;
|
|
3255
|
-
successfulDemos: number;
|
|
3256
|
-
estimatedTokenUsage: number;
|
|
3257
|
-
earlyStopped: boolean;
|
|
3258
|
-
earlyStopping?: {
|
|
3259
|
-
bestScoreRound: number;
|
|
3260
|
-
patienceExhausted: boolean;
|
|
3261
|
-
};
|
|
3262
|
-
}
|
|
3263
|
-
interface AxOptimizerResult<IN extends AxGenIn, OUT extends AxGenOut> {
|
|
3264
|
-
program?: Readonly<AxProgram<IN, OUT>>;
|
|
3265
|
-
demos?: AxProgramDemos[];
|
|
3266
|
-
stats?: AxOptimizationStats;
|
|
3267
|
-
}
|
|
3268
|
-
interface AxOptimizer<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOut> {
|
|
3269
|
-
/**
|
|
3270
|
-
* Main optimization method that optimizes the program using the provided metric function
|
|
3271
|
-
* @param metricFn Evaluation metric function to assess program performance
|
|
3272
|
-
* @param options Optional configuration options specific to the optimizer
|
|
3273
|
-
* @returns Optimization result containing the optimized program, demos, and/or stats
|
|
3274
|
-
*/
|
|
3275
|
-
compile(metricFn: AxMetricFn, options?: Record<string, unknown>): Promise<AxOptimizerResult<IN, OUT>>;
|
|
3276
|
-
/**
|
|
3277
|
-
* Get optimization statistics if available
|
|
3278
|
-
* @returns Optimization statistics or undefined if not supported
|
|
3279
|
-
*/
|
|
3280
|
-
getStats?(): AxOptimizationStats | undefined;
|
|
3281
|
-
}
|
|
3282
|
-
interface AxBootstrapOptimizerOptions {
|
|
3283
|
-
maxRounds?: number;
|
|
3284
|
-
maxExamples?: number;
|
|
3285
|
-
maxDemos?: number;
|
|
3286
|
-
batchSize?: number;
|
|
3287
|
-
earlyStoppingPatience?: number;
|
|
3288
|
-
teacherAI?: AxAIService;
|
|
3289
|
-
costMonitoring?: boolean;
|
|
3290
|
-
maxTokensPerGeneration?: number;
|
|
3291
|
-
verboseMode?: boolean;
|
|
3292
|
-
debugMode?: boolean;
|
|
3684
|
+
interface AxMiPROResult<IN extends AxGenIn, OUT extends AxGenOut> extends AxOptimizerResult<OUT> {
|
|
3685
|
+
optimizedGen?: AxGen<IN, OUT>;
|
|
3293
3686
|
}
|
|
3294
|
-
|
|
3295
|
-
numCandidates?: number;
|
|
3296
|
-
initTemperature?: number;
|
|
3297
|
-
maxBootstrappedDemos?: number;
|
|
3298
|
-
maxLabeledDemos?: number;
|
|
3299
|
-
numTrials?: number;
|
|
3300
|
-
minibatch?: boolean;
|
|
3301
|
-
minibatchSize?: number;
|
|
3302
|
-
minibatchFullEvalSteps?: number;
|
|
3303
|
-
programAwareProposer?: boolean;
|
|
3304
|
-
dataAwareProposer?: boolean;
|
|
3305
|
-
viewDataBatchSize?: number;
|
|
3306
|
-
tipAwareProposer?: boolean;
|
|
3307
|
-
fewshotAwareProposer?: boolean;
|
|
3308
|
-
seed?: number;
|
|
3309
|
-
verbose?: boolean;
|
|
3310
|
-
earlyStoppingTrials?: number;
|
|
3311
|
-
minImprovementThreshold?: number;
|
|
3312
|
-
}
|
|
3313
|
-
interface AxBootstrapCompileOptions {
|
|
3314
|
-
valset?: readonly AxExample[];
|
|
3315
|
-
maxDemos?: number;
|
|
3316
|
-
}
|
|
3317
|
-
interface AxMiPROCompileOptions {
|
|
3318
|
-
valset?: readonly AxExample[];
|
|
3319
|
-
teacher?: Readonly<AxProgram<AxGenIn, AxGenOut>>;
|
|
3320
|
-
auto?: 'light' | 'medium' | 'heavy';
|
|
3321
|
-
}
|
|
3322
|
-
|
|
3323
|
-
interface AxMiPROOptions {
|
|
3324
|
-
numCandidates?: number;
|
|
3325
|
-
initTemperature?: number;
|
|
3326
|
-
maxBootstrappedDemos?: number;
|
|
3327
|
-
maxLabeledDemos?: number;
|
|
3328
|
-
numTrials?: number;
|
|
3329
|
-
minibatch?: boolean;
|
|
3330
|
-
minibatchSize?: number;
|
|
3331
|
-
minibatchFullEvalSteps?: number;
|
|
3332
|
-
programAwareProposer?: boolean;
|
|
3333
|
-
dataAwareProposer?: boolean;
|
|
3334
|
-
viewDataBatchSize?: number;
|
|
3335
|
-
tipAwareProposer?: boolean;
|
|
3336
|
-
fewshotAwareProposer?: boolean;
|
|
3337
|
-
seed?: number;
|
|
3338
|
-
verbose?: boolean;
|
|
3339
|
-
earlyStoppingTrials?: number;
|
|
3340
|
-
minImprovementThreshold?: number;
|
|
3341
|
-
}
|
|
3342
|
-
declare class AxMiPRO<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOut> implements AxOptimizer<IN, OUT> {
|
|
3343
|
-
private ai;
|
|
3344
|
-
private program;
|
|
3345
|
-
private examples;
|
|
3687
|
+
declare class AxMiPRO<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOut> extends AxBaseOptimizer<IN, OUT> {
|
|
3346
3688
|
private maxBootstrappedDemos;
|
|
3347
3689
|
private maxLabeledDemos;
|
|
3348
3690
|
private numCandidates;
|
|
@@ -3356,14 +3698,15 @@ declare class AxMiPRO<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGen
|
|
|
3356
3698
|
private viewDataBatchSize;
|
|
3357
3699
|
private tipAwareProposer;
|
|
3358
3700
|
private fewshotAwareProposer;
|
|
3359
|
-
private seed?;
|
|
3360
3701
|
private verbose;
|
|
3361
|
-
private bootstrapper;
|
|
3362
3702
|
private earlyStoppingTrials;
|
|
3363
3703
|
private minImprovementThreshold;
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3704
|
+
private bayesianOptimization;
|
|
3705
|
+
private acquisitionFunction;
|
|
3706
|
+
private explorationWeight;
|
|
3707
|
+
constructor(args: Readonly<AxOptimizerArgs & {
|
|
3708
|
+
options?: AxMiPROOptimizerOptions;
|
|
3709
|
+
}>);
|
|
3367
3710
|
/**
|
|
3368
3711
|
* Configures the optimizer for light, medium, or heavy optimization
|
|
3369
3712
|
* @param level The optimization level: "light", "medium", or "heavy"
|
|
@@ -3374,21 +3717,11 @@ declare class AxMiPRO<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGen
|
|
|
3374
3717
|
*/
|
|
3375
3718
|
private generateTips;
|
|
3376
3719
|
/**
|
|
3377
|
-
* Generates instruction candidates
|
|
3720
|
+
* Generates instruction candidates using the teacher model if available
|
|
3721
|
+
* @param options Optional compile options that may override teacher AI
|
|
3378
3722
|
* @returns Array of generated instruction candidates
|
|
3379
3723
|
*/
|
|
3380
3724
|
private proposeInstructionCandidates;
|
|
3381
|
-
/**
|
|
3382
|
-
* Generates a summary of the program structure for instruction proposal
|
|
3383
|
-
*/
|
|
3384
|
-
private generateProgramSummary;
|
|
3385
|
-
/**
|
|
3386
|
-
* Generates a summary of the dataset for instruction proposal
|
|
3387
|
-
*/
|
|
3388
|
-
private generateDataSummary;
|
|
3389
|
-
/**
|
|
3390
|
-
* Generates a specific instruction candidate
|
|
3391
|
-
*/
|
|
3392
3725
|
private generateInstruction;
|
|
3393
3726
|
/**
|
|
3394
3727
|
* Bootstraps few-shot examples for the program
|
|
@@ -3399,43 +3732,43 @@ declare class AxMiPRO<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGen
|
|
|
3399
3732
|
*/
|
|
3400
3733
|
private selectLabeledExamples;
|
|
3401
3734
|
/**
|
|
3402
|
-
* Runs
|
|
3403
|
-
*/
|
|
3404
|
-
private runBayesianOptimization;
|
|
3405
|
-
/**
|
|
3406
|
-
* Evaluates a configuration on the validation set
|
|
3735
|
+
* Runs optimization to find the best combination of few-shot examples and instructions
|
|
3407
3736
|
*/
|
|
3737
|
+
private runOptimization;
|
|
3408
3738
|
private evaluateConfig;
|
|
3739
|
+
private applyConfigToProgram;
|
|
3409
3740
|
/**
|
|
3410
|
-
*
|
|
3741
|
+
* The main compile method to run MIPROv2 optimization
|
|
3411
3742
|
*/
|
|
3412
|
-
|
|
3743
|
+
compile(program: Readonly<AxProgram<IN, OUT>>, metricFn: AxMetricFn, options?: AxCompileOptions): Promise<AxMiPROResult<IN, OUT>>;
|
|
3413
3744
|
/**
|
|
3414
|
-
*
|
|
3415
|
-
* This is a simplified version using Upper Confidence Bound (UCB) strategy
|
|
3745
|
+
* Applies a configuration to an AxGen instance
|
|
3416
3746
|
*/
|
|
3417
|
-
private
|
|
3747
|
+
private applyConfigToAxGen;
|
|
3418
3748
|
/**
|
|
3419
|
-
*
|
|
3749
|
+
* Get optimizer-specific configuration
|
|
3750
|
+
* @returns Current optimizer configuration
|
|
3420
3751
|
*/
|
|
3421
|
-
|
|
3752
|
+
getConfiguration(): Record<string, unknown>;
|
|
3422
3753
|
/**
|
|
3423
|
-
*
|
|
3424
|
-
*
|
|
3754
|
+
* Update optimizer configuration
|
|
3755
|
+
* @param config New configuration to merge with existing
|
|
3425
3756
|
*/
|
|
3426
|
-
|
|
3757
|
+
updateConfiguration(config: Readonly<Record<string, unknown>>): void;
|
|
3427
3758
|
/**
|
|
3428
|
-
*
|
|
3429
|
-
* @param metricFn Evaluation metric function
|
|
3430
|
-
* @param options Optional configuration options
|
|
3431
|
-
* @returns The optimization result
|
|
3759
|
+
* Reset optimizer state for reuse with different programs
|
|
3432
3760
|
*/
|
|
3433
|
-
|
|
3761
|
+
reset(): void;
|
|
3434
3762
|
/**
|
|
3435
|
-
*
|
|
3436
|
-
* @
|
|
3763
|
+
* Validate that the optimizer can handle the given program
|
|
3764
|
+
* @param program Program to validate
|
|
3765
|
+
* @returns Validation result with any issues found
|
|
3437
3766
|
*/
|
|
3438
|
-
|
|
3767
|
+
validateProgram(program: Readonly<AxProgram<IN, OUT>>): {
|
|
3768
|
+
isValid: boolean;
|
|
3769
|
+
issues: string[];
|
|
3770
|
+
suggestions: string[];
|
|
3771
|
+
};
|
|
3439
3772
|
}
|
|
3440
3773
|
|
|
3441
3774
|
type AxMockAIServiceConfig = {
|
|
@@ -3595,11 +3928,7 @@ Readonly<AxAIOpenAIEmbedResponse>> {
|
|
|
3595
3928
|
createEmbedReq(req: Readonly<AxInternalEmbedRequest<TEmbedModel>>): [AxAPI, AxAIOpenAIEmbedRequest<TEmbedModel>];
|
|
3596
3929
|
}
|
|
3597
3930
|
|
|
3598
|
-
declare class AxBootstrapFewShot<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOut>
|
|
3599
|
-
private ai;
|
|
3600
|
-
private teacherAI?;
|
|
3601
|
-
private program;
|
|
3602
|
-
private examples;
|
|
3931
|
+
declare class AxBootstrapFewShot<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOut> extends AxBaseOptimizer<IN, OUT> {
|
|
3603
3932
|
private maxRounds;
|
|
3604
3933
|
private maxDemos;
|
|
3605
3934
|
private maxExamples;
|
|
@@ -3610,11 +3939,11 @@ declare class AxBootstrapFewShot<IN extends AxGenIn = AxGenIn, OUT extends AxGen
|
|
|
3610
3939
|
private verboseMode;
|
|
3611
3940
|
private debugMode;
|
|
3612
3941
|
private traces;
|
|
3613
|
-
|
|
3614
|
-
|
|
3942
|
+
constructor(args: Readonly<AxOptimizerArgs & {
|
|
3943
|
+
options?: AxBootstrapOptimizerOptions;
|
|
3944
|
+
}>);
|
|
3615
3945
|
private compileRound;
|
|
3616
|
-
compile(metricFn: AxMetricFn, options?:
|
|
3617
|
-
getStats(): AxOptimizationStats;
|
|
3946
|
+
compile(program: Readonly<AxProgram<IN, OUT>>, metricFn: AxMetricFn, options?: AxBootstrapCompileOptions): Promise<AxOptimizerResult<OUT>>;
|
|
3618
3947
|
}
|
|
3619
3948
|
|
|
3620
3949
|
declare class AxChainOfThought<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOut> extends AxGen<IN, OUT> {
|
|
@@ -3688,11 +4017,12 @@ declare const AxEvalUtil: {
|
|
|
3688
4017
|
novelF1ScoreOptimized: typeof novelF1ScoreOptimized;
|
|
3689
4018
|
};
|
|
3690
4019
|
|
|
3691
|
-
|
|
4020
|
+
type AxInstanceRegistryItem<T extends AxTunable<IN, OUT>, IN extends AxGenIn, OUT extends AxGenOut> = T & AxUsable;
|
|
4021
|
+
declare class AxInstanceRegistry<T extends AxTunable<IN, OUT>, IN extends AxGenIn, OUT extends AxGenOut> {
|
|
3692
4022
|
private reg;
|
|
3693
4023
|
constructor();
|
|
3694
|
-
register(instance: T): void;
|
|
3695
|
-
[Symbol.iterator](): Generator<T, void, unknown>;
|
|
4024
|
+
register(instance: AxInstanceRegistryItem<T, IN, OUT>): void;
|
|
4025
|
+
[Symbol.iterator](): Generator<AxInstanceRegistryItem<T, IN, OUT> | undefined, void, unknown>;
|
|
3696
4026
|
}
|
|
3697
4027
|
|
|
3698
4028
|
/**
|
|
@@ -3915,4 +4245,4 @@ declare const axModelInfoReka: AxModelInfo[];
|
|
|
3915
4245
|
|
|
3916
4246
|
declare const axModelInfoTogether: AxModelInfo[];
|
|
3917
4247
|
|
|
3918
|
-
export { AxAI, AxAIAnthropic, type AxAIAnthropicArgs, type AxAIAnthropicChatError, type AxAIAnthropicChatRequest, type AxAIAnthropicChatRequestCacheParam, type AxAIAnthropicChatResponse, type AxAIAnthropicChatResponseDelta, type AxAIAnthropicConfig, type AxAIAnthropicContentBlockDeltaEvent, type AxAIAnthropicContentBlockStartEvent, type AxAIAnthropicContentBlockStopEvent, type AxAIAnthropicErrorEvent, type AxAIAnthropicMessageDeltaEvent, type AxAIAnthropicMessageStartEvent, type AxAIAnthropicMessageStopEvent, AxAIAnthropicModel, type AxAIAnthropicPingEvent, AxAIAnthropicVertexModel, 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 AxAIGoogleGeminiChatRequest, type AxAIGoogleGeminiChatResponse, type AxAIGoogleGeminiChatResponseDelta, type AxAIGoogleGeminiConfig, type AxAIGoogleGeminiContent, type AxAIGoogleGeminiContentPart, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiEmbedTypes, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiThinkingConfig, type AxAIGoogleGeminiThinkingTokenBudgetLevels, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, 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, AxAIMistral, type AxAIMistralArgs, type AxAIMistralChatRequest, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, type AxAIModelListBase, type AxAIModels, AxAIOllama, type AxAIOllamaAIConfig, type AxAIOllamaArgs, AxAIOpenAI, 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 AxAIOpenAIUsage, type AxAIPromptConfig, 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, AxAIServiceNetworkError, type AxAIServiceOptions, AxAIServiceResponseError, AxAIServiceStatusError, AxAIServiceStreamTerminatedError, AxAIServiceTimeoutError, AxAITogether, type AxAITogetherArgs, type AxAPI, type AxAPIConfig, AxAgent, type AxAgentFeatures, type AxAgentOptions, type AxAgentic, AxApacheTika, type AxApacheTikaArgs, type AxApacheTikaConvertOptions, type AxAssertion, AxAssertionError, AxBalancer, type AxBalancerOptions, AxBaseAI, type AxBaseAIArgs, type AxBootstrapCompileOptions, AxBootstrapFewShot, type AxBootstrapOptimizerOptions, AxChainOfThought, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, 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, AxDefaultQueryRewriter, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, AxEvalUtil, type AxEvaluateArgs, type AxExample, type AxField, type AxFieldDescriptor, type AxFieldProcessor, type AxFieldProcessorProcess, type AxFieldTemplateFn, type AxFieldType, type AxFieldValue, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenOut, type AxGenStreamingOut, AxGenerateError, type AxGenerateErrorDetails, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSInterpreter, AxJSInterpreterPermission, AxLLMRequestTypeValues, type AxLoggerFunction, type AxLoggerTag, AxMCPClient, AxMCPHTTPSSETransport, AxMCPStdioTransport, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPTransport, AxMemory, type AxMessage, type AxMetricFn, type AxMetricFnArgs, AxMiPRO, type AxMiPROCompileOptions, type AxMiPROOptimizerOptions, type AxMiPROOptions, AxMockAIService, type AxMockAIServiceConfig, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxModelUsage, AxMultiServiceRouter, type AxOptimizationStats, type AxOptimizer, type AxOptimizerArgs, type AxOptimizerResult, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramStreamingForwardOptions, type AxProgramTrace, type AxProgramUsage, AxProgramWithSignature, type AxProgramWithSignatureOptions, AxPromptTemplate, type AxPromptTemplateOptions, AxRAG, type AxRateLimiterFunction, AxRateLimiterTokenUsage, type AxRateLimiterTokenUsageOptions, type AxRerankerIn, type AxRerankerOut, type AxResponseHandlerArgs, type AxRewriteIn, type AxRewriteOut, AxRewriter, type AxSetExamplesOptions, AxSignature, type AxSignatureTemplateValue, AxSimpleClassifier, AxSimpleClassifierClass, type AxSimpleClassifierForwardOptions, AxSpanKindValues, type AxStreamingAssertion, type AxStreamingEvent, type AxStreamingFieldProcessorProcess, AxStringUtil, AxTestPrompt, type AxTokenUsage, type AxTunable, type AxUsable, 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, axAIRekaBestConfig, axAIRekaCreativeConfig, axAIRekaDefaultConfig, axAIRekaFastConfig, axAITogetherDefaultConfig, axBaseAIDefaultConfig, axBaseAIDefaultCreativeConfig, axGlobals, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoReka, axModelInfoTogether, axSpanAttributes, axSpanEvents, f, s };
|
|
4248
|
+
export { AxAI, AxAIAnthropic, type AxAIAnthropicArgs, type AxAIAnthropicChatError, type AxAIAnthropicChatRequest, type AxAIAnthropicChatRequestCacheParam, type AxAIAnthropicChatResponse, type AxAIAnthropicChatResponseDelta, type AxAIAnthropicConfig, type AxAIAnthropicContentBlockDeltaEvent, type AxAIAnthropicContentBlockStartEvent, type AxAIAnthropicContentBlockStopEvent, type AxAIAnthropicErrorEvent, type AxAIAnthropicMessageDeltaEvent, type AxAIAnthropicMessageStartEvent, type AxAIAnthropicMessageStopEvent, AxAIAnthropicModel, type AxAIAnthropicPingEvent, AxAIAnthropicVertexModel, 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 AxAIGoogleGeminiChatRequest, type AxAIGoogleGeminiChatResponse, type AxAIGoogleGeminiChatResponseDelta, type AxAIGoogleGeminiConfig, type AxAIGoogleGeminiContent, type AxAIGoogleGeminiContentPart, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiEmbedTypes, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiThinkingConfig, type AxAIGoogleGeminiThinkingTokenBudgetLevels, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, 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, AxAIMistral, type AxAIMistralArgs, type AxAIMistralChatRequest, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, type AxAIModelListBase, type AxAIModels, AxAIOllama, type AxAIOllamaAIConfig, type AxAIOllamaArgs, AxAIOpenAI, 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 AxAIOpenAIUsage, type AxAIPromptConfig, 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, AxAIServiceNetworkError, type AxAIServiceOptions, AxAIServiceResponseError, AxAIServiceStatusError, AxAIServiceStreamTerminatedError, AxAIServiceTimeoutError, AxAITogether, type AxAITogetherArgs, type AxAPI, type AxAPIConfig, AxAgent, type AxAgentFeatures, type AxAgentOptions, type AxAgentic, AxApacheTika, type AxApacheTikaArgs, type AxApacheTikaConvertOptions, type AxAssertion, AxAssertionError, AxBalancer, type AxBalancerOptions, AxBaseAI, type AxBaseAIArgs, AxBaseOptimizer, type AxBootstrapCompileOptions, AxBootstrapFewShot, type AxBootstrapOptimizerOptions, AxChainOfThought, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, type AxCheckpointLoadFn, type AxCheckpointSaveFn, type AxCompileOptions, 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, AxDefaultCostTracker, AxDefaultQueryRewriter, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, AxEvalUtil, type AxEvaluateArgs, type AxExample, type AxField, type AxFieldDescriptor, type AxFieldProcessor, type AxFieldProcessorProcess, type AxFieldTemplateFn, type AxFieldType, type AxFieldValue, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenOut, type AxGenStreamingOut, AxGenerateError, type AxGenerateErrorDetails, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSInterpreter, AxJSInterpreterPermission, AxLLMRequestTypeValues, type AxLoggerFunction, type AxLoggerTag, AxMCPClient, AxMCPHTTPSSETransport, AxMCPStdioTransport, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPTransport, AxMemory, type AxMessage, type AxMetricFn, type AxMetricFnArgs, AxMiPRO, type AxMiPROCompileOptions, type AxMiPROOptimizerOptions, type AxMiPROResult, AxMockAIService, type AxMockAIServiceConfig, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxModelUsage, type AxMultiMetricFn, AxMultiServiceRouter, type AxOptimizationCheckpoint, type AxOptimizationProgress, type AxOptimizationStats, type AxOptimizer, type AxOptimizerArgs, type AxOptimizerResult, type AxParetoResult, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramStreamingForwardOptions, type AxProgramTrace, type AxProgramUsage, AxProgramWithSignature, type AxProgramWithSignatureOptions, AxPromptTemplate, type AxPromptTemplateOptions, AxRAG, type AxRateLimiterFunction, AxRateLimiterTokenUsage, type AxRateLimiterTokenUsageOptions, type AxRerankerIn, type AxRerankerOut, type AxResponseHandlerArgs, type AxRewriteIn, type AxRewriteOut, AxRewriter, type AxSetExamplesOptions, AxSignature, type AxSignatureConfig, type AxSignatureTemplateValue, AxSimpleClassifier, AxSimpleClassifierClass, type AxSimpleClassifierForwardOptions, AxSpanKindValues, type AxStreamingAssertion, type AxStreamingEvent, type AxStreamingFieldProcessorProcess, AxStringUtil, AxTestPrompt, type AxTokenUsage, type AxTunable, type AxUsable, 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, axAIRekaBestConfig, axAIRekaCreativeConfig, axAIRekaDefaultConfig, axAIRekaFastConfig, axAITogetherDefaultConfig, axBaseAIDefaultConfig, axBaseAIDefaultCreativeConfig, axGlobals, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoReka, axModelInfoTogether, axSpanAttributes, axSpanEvents, f, s };
|