@ax-llm/ax 12.0.17 → 12.0.19
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 +813 -312
- package/index.cjs.map +1 -1
- package/index.d.cts +346 -116
- package/index.d.ts +346 -116
- package/index.js +811 -312
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.cts
CHANGED
|
@@ -178,6 +178,7 @@ type AxModelInfo = {
|
|
|
178
178
|
hasThinkingBudget?: boolean;
|
|
179
179
|
hasShowThoughts?: boolean;
|
|
180
180
|
maxTokens?: number;
|
|
181
|
+
isExpensive?: boolean;
|
|
181
182
|
};
|
|
182
183
|
type AxTokenUsage = {
|
|
183
184
|
promptTokens: number;
|
|
@@ -370,6 +371,7 @@ type AxAIPromptConfig = {
|
|
|
370
371
|
stream?: boolean;
|
|
371
372
|
thinkingTokenBudget?: 'minimal' | 'low' | 'medium' | 'high' | 'highest' | 'none';
|
|
372
373
|
showThoughts?: boolean;
|
|
374
|
+
useExpensiveModel?: 'yes';
|
|
373
375
|
};
|
|
374
376
|
type AxAIServiceOptions = {
|
|
375
377
|
debug?: boolean;
|
|
@@ -666,8 +668,6 @@ declare class AxAIAnthropic extends AxBaseAI<AxAIAnthropicModel | AxAIAnthropicV
|
|
|
666
668
|
}
|
|
667
669
|
|
|
668
670
|
declare enum AxAIOpenAIModel {
|
|
669
|
-
O1 = "o1",
|
|
670
|
-
O1Mini = "o1-mini",
|
|
671
671
|
GPT4 = "gpt-4",
|
|
672
672
|
GPT41 = "gpt-4.1",
|
|
673
673
|
GPT41Mini = "gpt-4.1-mini",
|
|
@@ -679,7 +679,12 @@ declare enum AxAIOpenAIModel {
|
|
|
679
679
|
GPT35TurboInstruct = "gpt-3.5-turbo-instruct",
|
|
680
680
|
GPT35TextDavinci002 = "text-davinci-002",
|
|
681
681
|
GPT3TextBabbage002 = "text-babbage-002",
|
|
682
|
-
GPT3TextAda001 = "text-ada-001"
|
|
682
|
+
GPT3TextAda001 = "text-ada-001",
|
|
683
|
+
O1 = "o1",
|
|
684
|
+
O1Mini = "o1-mini",
|
|
685
|
+
O3 = "o3",
|
|
686
|
+
O3Mini = "o3-mini",
|
|
687
|
+
O4Mini = "o4-mini"
|
|
683
688
|
}
|
|
684
689
|
declare enum AxAIOpenAIEmbedModel {
|
|
685
690
|
TextEmbeddingAda002 = "text-embedding-ada-002",
|
|
@@ -1474,8 +1479,6 @@ declare class AxAIOllama extends AxAIOpenAIBase<string, string> {
|
|
|
1474
1479
|
}
|
|
1475
1480
|
|
|
1476
1481
|
declare enum AxAIOpenAIResponsesModel {
|
|
1477
|
-
O1 = "o1",
|
|
1478
|
-
O1Mini = "o1-mini",
|
|
1479
1482
|
GPT4 = "gpt-4",
|
|
1480
1483
|
GPT41 = "gpt-4.1",
|
|
1481
1484
|
GPT41Mini = "gpt-4.1-mini",
|
|
@@ -1488,6 +1491,10 @@ declare enum AxAIOpenAIResponsesModel {
|
|
|
1488
1491
|
GPT35TextDavinci002 = "text-davinci-002",
|
|
1489
1492
|
GPT3TextBabbage002 = "text-babbage-002",
|
|
1490
1493
|
GPT3TextAda001 = "text-ada-001",
|
|
1494
|
+
O1Pro = "o1-pro",
|
|
1495
|
+
O1 = "o1",
|
|
1496
|
+
O1Mini = "o1-mini",
|
|
1497
|
+
O3Pro = "o3-pro",
|
|
1491
1498
|
O3 = "o3",
|
|
1492
1499
|
O3Mini = "o3-mini",
|
|
1493
1500
|
O4Mini = "o4-mini"
|
|
@@ -1598,7 +1605,10 @@ interface AxAIOpenAIResponsesFunctionCallItem {
|
|
|
1598
1605
|
interface AxAIOpenAIResponsesReasoningItem {
|
|
1599
1606
|
readonly type: 'reasoning';
|
|
1600
1607
|
readonly id: string;
|
|
1601
|
-
readonly summary: ReadonlyArray<
|
|
1608
|
+
readonly summary: ReadonlyArray<{
|
|
1609
|
+
type: 'summary_text';
|
|
1610
|
+
text: string;
|
|
1611
|
+
}>;
|
|
1602
1612
|
readonly encrypted_content?: string | null;
|
|
1603
1613
|
readonly status?: 'in_progress' | 'completed' | 'incomplete';
|
|
1604
1614
|
}
|
|
@@ -1905,6 +1915,7 @@ type AxAIOpenAIResponsesConfig<TModel, TEmbedModel> = Omit<AxModelConfig, 'topK'
|
|
|
1905
1915
|
echo?: boolean;
|
|
1906
1916
|
dimensions?: number;
|
|
1907
1917
|
reasoningEffort?: 'low' | 'medium' | 'high';
|
|
1918
|
+
reasoningSummary?: 'auto' | 'concise' | 'detailed';
|
|
1908
1919
|
store?: boolean;
|
|
1909
1920
|
systemPrompt?: string;
|
|
1910
1921
|
parallelToolCalls?: boolean;
|
|
@@ -3533,6 +3544,325 @@ declare class AxGenerateError extends Error {
|
|
|
3533
3544
|
constructor(message: string, details: Readonly<AxGenerateErrorDetails>, options?: ErrorOptions);
|
|
3534
3545
|
}
|
|
3535
3546
|
|
|
3547
|
+
type AxFlowState = Record<string, unknown>;
|
|
3548
|
+
interface AxFlowDynamicContext {
|
|
3549
|
+
ai?: AxAIService;
|
|
3550
|
+
options?: AxProgramForwardOptions;
|
|
3551
|
+
}
|
|
3552
|
+
type GetGenIn<T extends AxGen<AxGenIn, AxGenOut>> = T extends AxGen<infer IN, AxGenOut> ? IN : never;
|
|
3553
|
+
type GetGenOut<T extends AxGen<AxGenIn, AxGenOut>> = T extends AxGen<AxGenIn, infer OUT> ? OUT : never;
|
|
3554
|
+
type InferAxGen<TSig extends string> = TSig extends string ? AxGen<AxGenIn, AxGenOut> : never;
|
|
3555
|
+
type NodeResultKey<TNodeName extends string> = `${TNodeName}Result`;
|
|
3556
|
+
type AddNodeResult<TState extends AxFlowState, TNodeName extends string, TNodeOut extends AxGenOut> = TState & {
|
|
3557
|
+
[K in NodeResultKey<TNodeName>]: TNodeOut;
|
|
3558
|
+
};
|
|
3559
|
+
type AxFlowTypedParallelBranch<TNodes extends Record<string, AxGen<any, any>>, TState extends AxFlowState> = (subFlow: AxFlowTypedSubContext<TNodes, TState>) => AxFlowTypedSubContext<TNodes, AxFlowState>;
|
|
3560
|
+
interface AxFlowTypedSubContext<TNodes extends Record<string, AxGen<any, any>>, TState extends AxFlowState> {
|
|
3561
|
+
execute<TNodeName extends keyof TNodes & string>(nodeName: TNodeName, mapping: (state: TState) => GetGenIn<TNodes[TNodeName]>, dynamicContext?: AxFlowDynamicContext): AxFlowTypedSubContext<TNodes, AddNodeResult<TState, TNodeName, GetGenOut<TNodes[TNodeName]>>>;
|
|
3562
|
+
map<TNewState extends AxFlowState>(transform: (state: TState) => TNewState): AxFlowTypedSubContext<TNodes, TNewState>;
|
|
3563
|
+
executeSteps(initialState: TState, context: Readonly<{
|
|
3564
|
+
mainAi: AxAIService;
|
|
3565
|
+
mainOptions?: AxProgramForwardOptions;
|
|
3566
|
+
}>): Promise<AxFlowState>;
|
|
3567
|
+
}
|
|
3568
|
+
type AxFlowParallelBranch = (subFlow: AxFlowSubContext) => AxFlowSubContext;
|
|
3569
|
+
interface AxFlowSubContext {
|
|
3570
|
+
execute(nodeName: string, mapping: (state: AxFlowState) => Record<string, AxFieldValue>, dynamicContext?: AxFlowDynamicContext): this;
|
|
3571
|
+
map(transform: (state: AxFlowState) => AxFlowState): this;
|
|
3572
|
+
executeSteps(initialState: AxFlowState, context: Readonly<{
|
|
3573
|
+
mainAi: AxAIService;
|
|
3574
|
+
mainOptions?: AxProgramForwardOptions;
|
|
3575
|
+
}>): Promise<AxFlowState>;
|
|
3576
|
+
}
|
|
3577
|
+
/**
|
|
3578
|
+
* AxFlow - A fluent, chainable API for building and orchestrating complex, stateful AI programs.
|
|
3579
|
+
*
|
|
3580
|
+
* Now with advanced type-safe chaining where each method call evolves the type information,
|
|
3581
|
+
* providing compile-time type safety and superior IntelliSense.
|
|
3582
|
+
*
|
|
3583
|
+
* @example
|
|
3584
|
+
* ```typescript
|
|
3585
|
+
* const flow = new AxFlow<{ topic: string }, { finalAnswer: string }>()
|
|
3586
|
+
* .node('summarizer', 'text:string -> summary:string')
|
|
3587
|
+
* .node('critic', 'summary:string -> critique:string')
|
|
3588
|
+
* .execute('summarizer', state => ({ text: `About ${state.topic}` })) // state is { topic: string }
|
|
3589
|
+
* .execute('critic', state => ({ summary: state.summarizerResult.summary })) // state evolves!
|
|
3590
|
+
* .map(state => ({ finalAnswer: state.criticResult.critique })) // fully typed!
|
|
3591
|
+
*
|
|
3592
|
+
* const result = await flow.forward(ai, { topic: "AI safety" })
|
|
3593
|
+
* ```
|
|
3594
|
+
*/
|
|
3595
|
+
declare class AxFlow<IN extends AxGenIn, OUT extends AxGenOut, TNodes extends Record<string, AxGen<any, any>> = Record<string, never>, // Node registry for type tracking
|
|
3596
|
+
TState extends AxFlowState = IN> extends AxProgramWithSignature<IN, OUT> {
|
|
3597
|
+
private readonly nodes;
|
|
3598
|
+
private readonly flowDefinition;
|
|
3599
|
+
private readonly nodeGenerators;
|
|
3600
|
+
private readonly loopStack;
|
|
3601
|
+
private readonly stepLabels;
|
|
3602
|
+
private branchContext;
|
|
3603
|
+
constructor(signature?: NonNullable<ConstructorParameters<typeof AxSignature>[0]>);
|
|
3604
|
+
/**
|
|
3605
|
+
* Declares a reusable computational node using a signature string.
|
|
3606
|
+
* Returns a new AxFlow type that tracks this node in the TNodes registry.
|
|
3607
|
+
*
|
|
3608
|
+
* @param name - The name of the node
|
|
3609
|
+
* @param signature - Signature string in the same format as AxSignature
|
|
3610
|
+
* @param options - Optional program forward options (same as AxGen)
|
|
3611
|
+
* @returns New AxFlow instance with updated TNodes type
|
|
3612
|
+
*
|
|
3613
|
+
* @example
|
|
3614
|
+
* ```typescript
|
|
3615
|
+
* flow.node('summarizer', 'text:string -> summary:string')
|
|
3616
|
+
* flow.node('analyzer', 'text:string -> analysis:string, confidence:number', { debug: true })
|
|
3617
|
+
* ```
|
|
3618
|
+
*/
|
|
3619
|
+
node<TName extends string, TSig extends string>(name: TName, signature: TSig, options?: Readonly<AxProgramForwardOptions>): AxFlow<IN, OUT, TNodes & {
|
|
3620
|
+
[K in TName]: InferAxGen<TSig>;
|
|
3621
|
+
}, // Add new node to registry
|
|
3622
|
+
TState>;
|
|
3623
|
+
/**
|
|
3624
|
+
* Declares a reusable computational node using an existing AxGen instance.
|
|
3625
|
+
* This allows reusing pre-configured generators in the flow.
|
|
3626
|
+
*
|
|
3627
|
+
* @param name - The name of the node
|
|
3628
|
+
* @param axgenInstance - Existing AxGen instance to use for this node
|
|
3629
|
+
* @returns New AxFlow instance with updated TNodes type
|
|
3630
|
+
*
|
|
3631
|
+
* @example
|
|
3632
|
+
* ```typescript
|
|
3633
|
+
* const summarizer = new AxGen('text:string -> summary:string', { temperature: 0.1 })
|
|
3634
|
+
* flow.node('summarizer', summarizer)
|
|
3635
|
+
* ```
|
|
3636
|
+
*/
|
|
3637
|
+
node<TName extends string, TGen extends AxGen<any, any>>(name: TName, axgenInstance: TGen): AxFlow<IN, OUT, TNodes & {
|
|
3638
|
+
[K in TName]: TGen;
|
|
3639
|
+
}, // Add new node to registry with exact type
|
|
3640
|
+
TState>;
|
|
3641
|
+
/**
|
|
3642
|
+
* Short alias for node() - supports both signature strings and AxGen instances
|
|
3643
|
+
*/
|
|
3644
|
+
n<TName extends string, TSig extends string>(name: TName, signature: TSig, options?: Readonly<AxProgramForwardOptions>): AxFlow<IN, OUT, TNodes & {
|
|
3645
|
+
[K in TName]: InferAxGen<TSig>;
|
|
3646
|
+
}, TState>;
|
|
3647
|
+
n<TName extends string, TGen extends AxGen<any, any>>(name: TName, axgenInstance: TGen): AxFlow<IN, OUT, TNodes & {
|
|
3648
|
+
[K in TName]: TGen;
|
|
3649
|
+
}, TState>;
|
|
3650
|
+
/**
|
|
3651
|
+
* Applies a synchronous transformation to the state object.
|
|
3652
|
+
* Returns a new AxFlow type with the evolved state.
|
|
3653
|
+
*
|
|
3654
|
+
* @param transform - Function that takes the current state and returns a new state
|
|
3655
|
+
* @returns New AxFlow instance with updated TState type
|
|
3656
|
+
*
|
|
3657
|
+
* @example
|
|
3658
|
+
* ```typescript
|
|
3659
|
+
* flow.map(state => ({ ...state, processedText: state.text.toLowerCase() }))
|
|
3660
|
+
* ```
|
|
3661
|
+
*/
|
|
3662
|
+
map<TNewState extends AxFlowState>(transform: (state: TState) => TNewState): AxFlow<IN, OUT, TNodes, TNewState>;
|
|
3663
|
+
/**
|
|
3664
|
+
* Short alias for map()
|
|
3665
|
+
*/
|
|
3666
|
+
m<TNewState extends AxFlowState>(transform: (state: TState) => TNewState): AxFlow<IN, OUT, TNodes, TNewState>;
|
|
3667
|
+
/**
|
|
3668
|
+
* Labels a step for later reference (useful for feedback loops).
|
|
3669
|
+
*
|
|
3670
|
+
* @param label - The label to assign to the current step position
|
|
3671
|
+
* @returns this (for chaining, no type change)
|
|
3672
|
+
*
|
|
3673
|
+
* @example
|
|
3674
|
+
* ```typescript
|
|
3675
|
+
* flow.label('retry-point')
|
|
3676
|
+
* .execute('queryGen', ...)
|
|
3677
|
+
* ```
|
|
3678
|
+
*/
|
|
3679
|
+
label(label: string): this;
|
|
3680
|
+
/**
|
|
3681
|
+
* Short alias for label()
|
|
3682
|
+
*/
|
|
3683
|
+
l(label: string): this;
|
|
3684
|
+
/**
|
|
3685
|
+
* Executes a previously defined node with full type safety.
|
|
3686
|
+
* The node name must exist in TNodes, and the mapping function is typed based on the node's signature.
|
|
3687
|
+
*
|
|
3688
|
+
* @param nodeName - The name of the node to execute (must exist in TNodes)
|
|
3689
|
+
* @param mapping - Typed function that takes the current state and returns the input for the node
|
|
3690
|
+
* @param dynamicContext - Optional object to override the AI service or options for this specific step
|
|
3691
|
+
* @returns New AxFlow instance with TState augmented with the node's result
|
|
3692
|
+
*
|
|
3693
|
+
* @example
|
|
3694
|
+
* ```typescript
|
|
3695
|
+
* flow.execute('summarizer', state => ({ text: state.originalText }), { ai: cheapAI })
|
|
3696
|
+
* ```
|
|
3697
|
+
*/
|
|
3698
|
+
execute<TNodeName extends keyof TNodes & string>(nodeName: TNodeName, mapping: (state: TState) => GetGenIn<TNodes[TNodeName]>, dynamicContext?: AxFlowDynamicContext): AxFlow<IN, OUT, TNodes, AddNodeResult<TState, TNodeName, GetGenOut<TNodes[TNodeName]>>>;
|
|
3699
|
+
/**
|
|
3700
|
+
* Short alias for execute()
|
|
3701
|
+
*/
|
|
3702
|
+
e<TNodeName extends keyof TNodes & string>(nodeName: TNodeName, mapping: (state: TState) => GetGenIn<TNodes[TNodeName]>, dynamicContext?: AxFlowDynamicContext): AxFlow<IN, OUT, TNodes, AddNodeResult<TState, TNodeName, GetGenOut<TNodes[TNodeName]>>>;
|
|
3703
|
+
/**
|
|
3704
|
+
* Starts a conditional branch based on a predicate function.
|
|
3705
|
+
*
|
|
3706
|
+
* @param predicate - Function that takes state and returns a value to branch on
|
|
3707
|
+
* @returns this (for chaining)
|
|
3708
|
+
*
|
|
3709
|
+
* @example
|
|
3710
|
+
* ```typescript
|
|
3711
|
+
* flow.branch(state => state.qualityResult.needsMoreInfo)
|
|
3712
|
+
* .when(true)
|
|
3713
|
+
* .execute('queryGen', ...)
|
|
3714
|
+
* .when(false)
|
|
3715
|
+
* .execute('answer', ...)
|
|
3716
|
+
* .merge()
|
|
3717
|
+
* ```
|
|
3718
|
+
*/
|
|
3719
|
+
branch(predicate: (state: TState) => unknown): this;
|
|
3720
|
+
/**
|
|
3721
|
+
* Short alias for branch()
|
|
3722
|
+
*/
|
|
3723
|
+
b(predicate: (state: TState) => unknown): this;
|
|
3724
|
+
/**
|
|
3725
|
+
* Defines a branch case for the current branch context.
|
|
3726
|
+
*
|
|
3727
|
+
* @param value - The value to match against the branch predicate result
|
|
3728
|
+
* @returns this (for chaining)
|
|
3729
|
+
*/
|
|
3730
|
+
when(value: unknown): this;
|
|
3731
|
+
/**
|
|
3732
|
+
* Short alias for when()
|
|
3733
|
+
*/
|
|
3734
|
+
w(value: unknown): this;
|
|
3735
|
+
/**
|
|
3736
|
+
* Ends the current branch and merges all branch paths back into the main flow.
|
|
3737
|
+
* Optionally specify the explicit merged state type for better type safety.
|
|
3738
|
+
*
|
|
3739
|
+
* @param explicitMergedType - Optional type hint for the merged state (defaults to current TState)
|
|
3740
|
+
* @returns AxFlow instance with the merged state type
|
|
3741
|
+
*
|
|
3742
|
+
* @example
|
|
3743
|
+
* ```typescript
|
|
3744
|
+
* // Default behavior - preserves current TState
|
|
3745
|
+
* flow.branch(state => state.type)
|
|
3746
|
+
* .when('simple').execute('simpleProcessor', ...)
|
|
3747
|
+
* .when('complex').execute('complexProcessor', ...)
|
|
3748
|
+
* .merge()
|
|
3749
|
+
*
|
|
3750
|
+
* // Explicit type - specify exact merged state shape
|
|
3751
|
+
* flow.branch(state => state.type)
|
|
3752
|
+
* .when('simple').map(state => ({ result: state.simpleResult, method: 'simple' }))
|
|
3753
|
+
* .when('complex').map(state => ({ result: state.complexResult, method: 'complex' }))
|
|
3754
|
+
* .merge<{ result: string; method: string }>()
|
|
3755
|
+
* ```
|
|
3756
|
+
*/
|
|
3757
|
+
merge<TMergedState extends AxFlowState = TState>(): AxFlow<IN, OUT, TNodes, TMergedState>;
|
|
3758
|
+
/**
|
|
3759
|
+
* Short alias for merge()
|
|
3760
|
+
*/
|
|
3761
|
+
mg<TMergedState extends AxFlowState = TState>(): AxFlow<IN, OUT, TNodes, TMergedState>;
|
|
3762
|
+
/**
|
|
3763
|
+
* Executes multiple operations in parallel and merges their results.
|
|
3764
|
+
* Both typed and legacy untyped branches are supported.
|
|
3765
|
+
*
|
|
3766
|
+
* @param branches - Array of functions that define parallel operations
|
|
3767
|
+
* @returns Object with merge method for combining results
|
|
3768
|
+
*
|
|
3769
|
+
* @example
|
|
3770
|
+
* ```typescript
|
|
3771
|
+
* flow.parallel([
|
|
3772
|
+
* subFlow => subFlow.execute('retrieve1', state => ({ query: state.query1 })),
|
|
3773
|
+
* subFlow => subFlow.execute('retrieve2', state => ({ query: state.query2 })),
|
|
3774
|
+
* subFlow => subFlow.execute('retrieve3', state => ({ query: state.query3 }))
|
|
3775
|
+
* ]).merge('documents', (docs1, docs2, docs3) => [...docs1, ...docs2, ...docs3])
|
|
3776
|
+
* ```
|
|
3777
|
+
*/
|
|
3778
|
+
parallel(branches: (AxFlowParallelBranch | AxFlowTypedParallelBranch<TNodes, TState>)[]): {
|
|
3779
|
+
merge<T, TResultKey extends string>(resultKey: TResultKey, mergeFunction: (...results: unknown[]) => T): AxFlow<IN, OUT, TNodes, TState & {
|
|
3780
|
+
[K in TResultKey]: T;
|
|
3781
|
+
}>;
|
|
3782
|
+
};
|
|
3783
|
+
/**
|
|
3784
|
+
* Short alias for parallel()
|
|
3785
|
+
*/
|
|
3786
|
+
p(branches: (AxFlowParallelBranch | AxFlowTypedParallelBranch<TNodes, TState>)[]): {
|
|
3787
|
+
merge<T, TResultKey extends string>(resultKey: TResultKey, mergeFunction: (...results: unknown[]) => T): AxFlow<IN, OUT, TNodes, TState & {
|
|
3788
|
+
[K in TResultKey]: T;
|
|
3789
|
+
}>;
|
|
3790
|
+
};
|
|
3791
|
+
/**
|
|
3792
|
+
* Creates a feedback loop that jumps back to a labeled step if a condition is met.
|
|
3793
|
+
*
|
|
3794
|
+
* @param condition - Function that returns true to trigger the feedback loop
|
|
3795
|
+
* @param targetLabel - The label to jump back to
|
|
3796
|
+
* @param maxIterations - Maximum number of iterations to prevent infinite loops (default: 10)
|
|
3797
|
+
* @returns this (for chaining)
|
|
3798
|
+
*
|
|
3799
|
+
* @example
|
|
3800
|
+
* ```typescript
|
|
3801
|
+
* flow.label('retry-point')
|
|
3802
|
+
* .execute('answer', ...)
|
|
3803
|
+
* .execute('qualityCheck', ...)
|
|
3804
|
+
* .feedback(state => state.qualityCheckResult.confidence < 0.7, 'retry-point')
|
|
3805
|
+
* ```
|
|
3806
|
+
*/
|
|
3807
|
+
feedback(condition: (state: TState) => boolean, targetLabel: string, maxIterations?: number): this;
|
|
3808
|
+
/**
|
|
3809
|
+
* Short alias for feedback()
|
|
3810
|
+
*/
|
|
3811
|
+
fb(condition: (state: TState) => boolean, targetLabel: string, maxIterations?: number): this;
|
|
3812
|
+
/**
|
|
3813
|
+
* Marks the beginning of a loop block.
|
|
3814
|
+
*
|
|
3815
|
+
* @param condition - Function that takes the current state and returns a boolean
|
|
3816
|
+
* @param maxIterations - Maximum number of iterations to prevent infinite loops (default: 100)
|
|
3817
|
+
* @returns this (for chaining)
|
|
3818
|
+
*
|
|
3819
|
+
* @example
|
|
3820
|
+
* ```typescript
|
|
3821
|
+
* flow.while(state => state.iterations < 3, 10)
|
|
3822
|
+
* .map(state => ({ ...state, iterations: (state.iterations || 0) + 1 }))
|
|
3823
|
+
* .endWhile()
|
|
3824
|
+
* ```
|
|
3825
|
+
*/
|
|
3826
|
+
while(condition: (state: TState) => boolean, maxIterations?: number): this;
|
|
3827
|
+
/**
|
|
3828
|
+
* Short alias for while()
|
|
3829
|
+
*/
|
|
3830
|
+
wh(condition: (state: TState) => boolean, maxIterations?: number): this;
|
|
3831
|
+
/**
|
|
3832
|
+
* Marks the end of a loop block.
|
|
3833
|
+
*
|
|
3834
|
+
* @returns this (for chaining)
|
|
3835
|
+
*/
|
|
3836
|
+
endWhile(): this;
|
|
3837
|
+
/**
|
|
3838
|
+
* Short alias for endWhile()
|
|
3839
|
+
*/
|
|
3840
|
+
end(): this;
|
|
3841
|
+
/**
|
|
3842
|
+
* Executes the flow with the given AI service and input values.
|
|
3843
|
+
*
|
|
3844
|
+
* @param ai - The AI service to use as the default for all steps
|
|
3845
|
+
* @param values - The input values for the flow
|
|
3846
|
+
* @param options - Optional forward options to use as defaults
|
|
3847
|
+
* @returns Promise that resolves to the final output
|
|
3848
|
+
*/
|
|
3849
|
+
forward(ai: Readonly<AxAIService>, values: IN, options?: Readonly<AxProgramForwardOptions>): Promise<OUT>;
|
|
3850
|
+
}
|
|
3851
|
+
/**
|
|
3852
|
+
* Typed implementation of the sub-context for parallel execution with full type safety
|
|
3853
|
+
*/
|
|
3854
|
+
declare class AxFlowTypedSubContextImpl<TNodes extends Record<string, AxGen<any, any>>, TState extends AxFlowState> implements AxFlowTypedSubContext<TNodes, TState> {
|
|
3855
|
+
private readonly nodeGenerators;
|
|
3856
|
+
private readonly steps;
|
|
3857
|
+
constructor(nodeGenerators: Map<string, AxGen<AxGenIn, AxGenOut>>);
|
|
3858
|
+
execute<TNodeName extends keyof TNodes & string>(nodeName: TNodeName, mapping: (state: TState) => GetGenIn<TNodes[TNodeName]>, dynamicContext?: AxFlowDynamicContext): AxFlowTypedSubContext<TNodes, AddNodeResult<TState, TNodeName, GetGenOut<TNodes[TNodeName]>>>;
|
|
3859
|
+
map<TNewState extends AxFlowState>(transform: (state: TState) => TNewState): AxFlowTypedSubContext<TNodes, TNewState>;
|
|
3860
|
+
executeSteps(initialState: TState, context: Readonly<{
|
|
3861
|
+
mainAi: AxAIService;
|
|
3862
|
+
mainOptions?: AxProgramForwardOptions;
|
|
3863
|
+
}>): Promise<AxFlowState>;
|
|
3864
|
+
}
|
|
3865
|
+
|
|
3536
3866
|
type AxDataRow = {
|
|
3537
3867
|
row: Record<string, AxFieldValue>;
|
|
3538
3868
|
};
|
|
@@ -4034,6 +4364,15 @@ declare const axCreateOptimizerLogger: (output?: (message: string) => void) => A
|
|
|
4034
4364
|
*/
|
|
4035
4365
|
declare const axDefaultOptimizerLogger: AxLoggerFunction;
|
|
4036
4366
|
|
|
4367
|
+
/**
|
|
4368
|
+
* OpenAI: Model information
|
|
4369
|
+
*/
|
|
4370
|
+
declare const axModelInfoOpenAI: AxModelInfo[];
|
|
4371
|
+
/**
|
|
4372
|
+
* OpenAI: Model information
|
|
4373
|
+
*/
|
|
4374
|
+
declare const axModelInfoOpenAIResponses: AxModelInfo[];
|
|
4375
|
+
|
|
4037
4376
|
type AxChatRequestMessage = AxChatRequest['chatPrompt'][number];
|
|
4038
4377
|
/**
|
|
4039
4378
|
* Validates a chat request message item to ensure it meets the required criteria
|
|
@@ -4159,110 +4498,6 @@ declare const AxEvalUtil: {
|
|
|
4159
4498
|
novelF1ScoreOptimized: typeof novelF1ScoreOptimized;
|
|
4160
4499
|
};
|
|
4161
4500
|
|
|
4162
|
-
type AxFlowState = Record<string, any>;
|
|
4163
|
-
interface AxFlowDynamicContext {
|
|
4164
|
-
ai?: AxAIService;
|
|
4165
|
-
options?: AxProgramForwardOptions;
|
|
4166
|
-
}
|
|
4167
|
-
/**
|
|
4168
|
-
* AxFlow - A fluent, chainable API for building and orchestrating complex, stateful AI programs.
|
|
4169
|
-
*
|
|
4170
|
-
* Allows developers to define computational nodes declaratively and then compose them
|
|
4171
|
-
* imperatively using loops, conditionals, and dynamic context.
|
|
4172
|
-
*
|
|
4173
|
-
* @example
|
|
4174
|
-
* ```typescript
|
|
4175
|
-
* const flow = new AxFlow<{ topic: string }, { summary: string; analysis: string }>()
|
|
4176
|
-
* .node('summarizer', { 'text:string': { summary: f.string() } })
|
|
4177
|
-
* .node('analyzer', { 'text:string': { analysis: f.string() } })
|
|
4178
|
-
* .map(input => ({ originalText: `Some long text about ${input.topic}` }))
|
|
4179
|
-
* .execute('summarizer', state => ({ text: state.originalText }), { ai: cheapAI })
|
|
4180
|
-
* .execute('analyzer', state => ({ text: state.originalText }), { ai: powerfulAI })
|
|
4181
|
-
* .map(state => ({
|
|
4182
|
-
* summary: state.summarizerResult.summary,
|
|
4183
|
-
* analysis: state.analyzerResult.analysis
|
|
4184
|
-
* }))
|
|
4185
|
-
*
|
|
4186
|
-
* const result = await flow.forward(ai, { topic: "the future of AI" })
|
|
4187
|
-
* ```
|
|
4188
|
-
*/
|
|
4189
|
-
declare class AxFlow<IN extends AxGenIn, OUT extends AxGenOut> extends AxProgramWithSignature<IN, OUT> {
|
|
4190
|
-
private readonly nodes;
|
|
4191
|
-
private readonly flowDefinition;
|
|
4192
|
-
private readonly nodeGenerators;
|
|
4193
|
-
private readonly loopStack;
|
|
4194
|
-
constructor(signature?: NonNullable<ConstructorParameters<typeof AxSignature>[0]>);
|
|
4195
|
-
/**
|
|
4196
|
-
* Declares a reusable computational node and its input/output signature.
|
|
4197
|
-
*
|
|
4198
|
-
* @param name - The name of the node
|
|
4199
|
-
* @param signature - An object where the key is a string representation of inputs
|
|
4200
|
-
* and the value is an object representing outputs
|
|
4201
|
-
* @returns this (for chaining)
|
|
4202
|
-
*
|
|
4203
|
-
* @example
|
|
4204
|
-
* ```typescript
|
|
4205
|
-
* flow.node('summarizer', { 'text:string': { summary: f.string() } })
|
|
4206
|
-
* ```
|
|
4207
|
-
*/
|
|
4208
|
-
node(name: string, signature: Record<string, Record<string, unknown>>): this;
|
|
4209
|
-
/**
|
|
4210
|
-
* Applies a synchronous transformation to the state object.
|
|
4211
|
-
*
|
|
4212
|
-
* @param transform - Function that takes the current state and returns a new state
|
|
4213
|
-
* @returns this (for chaining)
|
|
4214
|
-
*
|
|
4215
|
-
* @example
|
|
4216
|
-
* ```typescript
|
|
4217
|
-
* flow.map(state => ({ ...state, processedText: state.text.toLowerCase() }))
|
|
4218
|
-
* ```
|
|
4219
|
-
*/
|
|
4220
|
-
map(transform: (state: AxFlowState) => AxFlowState): this;
|
|
4221
|
-
/**
|
|
4222
|
-
* Executes a previously defined node.
|
|
4223
|
-
*
|
|
4224
|
-
* @param nodeName - The name of the node to execute (must exist in the nodes map)
|
|
4225
|
-
* @param mapping - Function that takes the current state and returns the input object required by the node
|
|
4226
|
-
* @param dynamicContext - Optional object to override the AI service or options for this specific step
|
|
4227
|
-
* @returns this (for chaining)
|
|
4228
|
-
*
|
|
4229
|
-
* @example
|
|
4230
|
-
* ```typescript
|
|
4231
|
-
* flow.execute('summarizer', state => ({ text: state.originalText }), { ai: cheapAI })
|
|
4232
|
-
* ```
|
|
4233
|
-
*/
|
|
4234
|
-
execute(nodeName: string, mapping: (state: AxFlowState) => Record<string, AxFieldValue>, dynamicContext?: AxFlowDynamicContext): this;
|
|
4235
|
-
/**
|
|
4236
|
-
* Marks the beginning of a loop block.
|
|
4237
|
-
*
|
|
4238
|
-
* @param condition - Function that takes the current state and returns a boolean
|
|
4239
|
-
* @returns this (for chaining)
|
|
4240
|
-
*
|
|
4241
|
-
* @example
|
|
4242
|
-
* ```typescript
|
|
4243
|
-
* flow.while(state => state.iterations < 3)
|
|
4244
|
-
* .map(state => ({ ...state, iterations: (state.iterations || 0) + 1 }))
|
|
4245
|
-
* .endWhile()
|
|
4246
|
-
* ```
|
|
4247
|
-
*/
|
|
4248
|
-
while(condition: (state: AxFlowState) => boolean): this;
|
|
4249
|
-
/**
|
|
4250
|
-
* Marks the end of a loop block.
|
|
4251
|
-
*
|
|
4252
|
-
* @returns this (for chaining)
|
|
4253
|
-
*/
|
|
4254
|
-
endWhile(): this;
|
|
4255
|
-
/**
|
|
4256
|
-
* Executes the flow with the given AI service and input values.
|
|
4257
|
-
*
|
|
4258
|
-
* @param ai - The AI service to use as the default for all steps
|
|
4259
|
-
* @param values - The input values for the flow
|
|
4260
|
-
* @param options - Optional forward options to use as defaults
|
|
4261
|
-
* @returns Promise that resolves to the final output
|
|
4262
|
-
*/
|
|
4263
|
-
forward(ai: Readonly<AxAIService>, values: IN, options?: Readonly<AxProgramForwardOptions>): Promise<OUT>;
|
|
4264
|
-
}
|
|
4265
|
-
|
|
4266
4501
|
type AxInstanceRegistryItem<T extends AxTunable<IN, OUT>, IN extends AxGenIn, OUT extends AxGenOut> = T & AxUsable;
|
|
4267
4502
|
declare class AxInstanceRegistry<T extends AxTunable<IN, OUT>, IN extends AxGenIn, OUT extends AxGenOut> {
|
|
4268
4503
|
private reg;
|
|
@@ -4479,11 +4714,6 @@ declare const axModelInfoHuggingFace: AxModelInfo[];
|
|
|
4479
4714
|
|
|
4480
4715
|
declare const axModelInfoMistral: AxModelInfo[];
|
|
4481
4716
|
|
|
4482
|
-
/**
|
|
4483
|
-
* OpenAI: Model information
|
|
4484
|
-
*/
|
|
4485
|
-
declare const axModelInfoOpenAI: AxModelInfo[];
|
|
4486
|
-
|
|
4487
4717
|
/**
|
|
4488
4718
|
* OpenAI: Model information
|
|
4489
4719
|
*/
|
|
@@ -4495,4 +4725,4 @@ interface AxSamplePickerOptions<OUT extends AxGenOut> {
|
|
|
4495
4725
|
resultPicker?: AxResultPickerFunction<OUT>;
|
|
4496
4726
|
}
|
|
4497
4727
|
|
|
4498
|
-
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, type AxAIAnthropicThinkingConfig, type AxAIAnthropicThinkingTokenBudgetLevels, 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 AxAIOpenAIAnnotation, type AxAIOpenAIArgs, AxAIOpenAIBase, type AxAIOpenAIBaseArgs, type AxAIOpenAIChatRequest, type AxAIOpenAIChatResponse, type AxAIOpenAIChatResponseDelta, type AxAIOpenAIConfig, AxAIOpenAIEmbedModel, type AxAIOpenAIEmbedRequest, type AxAIOpenAIEmbedResponse, type AxAIOpenAILogprob, AxAIOpenAIModel, type AxAIOpenAIResponseDelta, AxAIOpenAIResponses, type AxAIOpenAIResponsesArgs, AxAIOpenAIResponsesBase, type AxAIOpenAIResponsesCodeInterpreterToolCall, type AxAIOpenAIResponsesComputerToolCall, type AxAIOpenAIResponsesConfig, type AxAIOpenAIResponsesContentPartAddedEvent, type AxAIOpenAIResponsesContentPartDoneEvent, type AxAIOpenAIResponsesDefineFunctionTool, type AxAIOpenAIResponsesErrorEvent, type AxAIOpenAIResponsesFileSearchCallCompletedEvent, type AxAIOpenAIResponsesFileSearchCallInProgressEvent, type AxAIOpenAIResponsesFileSearchCallSearchingEvent, type AxAIOpenAIResponsesFileSearchToolCall, type AxAIOpenAIResponsesFunctionCallArgumentsDeltaEvent, type AxAIOpenAIResponsesFunctionCallArgumentsDoneEvent, type AxAIOpenAIResponsesFunctionCallItem, type AxAIOpenAIResponsesImageGenerationCallCompletedEvent, type AxAIOpenAIResponsesImageGenerationCallGeneratingEvent, type AxAIOpenAIResponsesImageGenerationCallInProgressEvent, type AxAIOpenAIResponsesImageGenerationCallPartialImageEvent, type AxAIOpenAIResponsesImageGenerationToolCall, AxAIOpenAIResponsesImpl, type AxAIOpenAIResponsesInputAudioContentPart, type AxAIOpenAIResponsesInputContentPart, type AxAIOpenAIResponsesInputFunctionCallItem, type AxAIOpenAIResponsesInputFunctionCallOutputItem, type AxAIOpenAIResponsesInputImageUrlContentPart, type AxAIOpenAIResponsesInputItem, type AxAIOpenAIResponsesInputMessageItem, type AxAIOpenAIResponsesInputTextContentPart, type AxAIOpenAIResponsesLocalShellToolCall, type AxAIOpenAIResponsesMCPCallArgumentsDeltaEvent, type AxAIOpenAIResponsesMCPCallArgumentsDoneEvent, type AxAIOpenAIResponsesMCPCallCompletedEvent, type AxAIOpenAIResponsesMCPCallFailedEvent, type AxAIOpenAIResponsesMCPCallInProgressEvent, type AxAIOpenAIResponsesMCPListToolsCompletedEvent, type AxAIOpenAIResponsesMCPListToolsFailedEvent, type AxAIOpenAIResponsesMCPListToolsInProgressEvent, type AxAIOpenAIResponsesMCPToolCall, AxAIOpenAIResponsesModel, type AxAIOpenAIResponsesOutputItem, type AxAIOpenAIResponsesOutputItemAddedEvent, type AxAIOpenAIResponsesOutputItemDoneEvent, type AxAIOpenAIResponsesOutputMessageItem, type AxAIOpenAIResponsesOutputRefusalContentPart, type AxAIOpenAIResponsesOutputTextAnnotationAddedEvent, type AxAIOpenAIResponsesOutputTextContentPart, type AxAIOpenAIResponsesOutputTextDeltaEvent, type AxAIOpenAIResponsesOutputTextDoneEvent, type AxAIOpenAIResponsesReasoningDeltaEvent, type AxAIOpenAIResponsesReasoningDoneEvent, type AxAIOpenAIResponsesReasoningItem, type AxAIOpenAIResponsesReasoningSummaryDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryDoneEvent, type AxAIOpenAIResponsesReasoningSummaryPart, type AxAIOpenAIResponsesReasoningSummaryPartAddedEvent, type AxAIOpenAIResponsesReasoningSummaryPartDoneEvent, type AxAIOpenAIResponsesReasoningSummaryTextDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryTextDoneEvent, type AxAIOpenAIResponsesRefusalDeltaEvent, type AxAIOpenAIResponsesRefusalDoneEvent, type AxAIOpenAIResponsesRequest, type AxAIOpenAIResponsesResponse, type AxAIOpenAIResponsesResponseCompletedEvent, type AxAIOpenAIResponsesResponseCreatedEvent, type AxAIOpenAIResponsesResponseDelta, type AxAIOpenAIResponsesResponseFailedEvent, type AxAIOpenAIResponsesResponseInProgressEvent, type AxAIOpenAIResponsesResponseIncompleteEvent, type AxAIOpenAIResponsesResponseQueuedEvent, type AxAIOpenAIResponsesStreamEvent, type AxAIOpenAIResponsesStreamEventBase, type AxAIOpenAIResponsesToolCall, type AxAIOpenAIResponsesToolCallBase, type AxAIOpenAIResponsesToolChoice, type AxAIOpenAIResponsesToolDefinition, type AxAIOpenAIResponsesWebSearchCallCompletedEvent, type AxAIOpenAIResponsesWebSearchCallInProgressEvent, type AxAIOpenAIResponsesWebSearchCallSearchingEvent, type AxAIOpenAIResponsesWebSearchToolCall, type AxAIOpenAIUrlCitation, type AxAIOpenAIUsage, type AxAIPromptConfig, AxAIRefusalError, AxAIReka, type AxAIRekaArgs, type AxAIRekaChatRequest, type AxAIRekaChatResponse, type AxAIRekaChatResponseDelta, type AxAIRekaConfig, AxAIRekaModel, type AxAIRekaUsage, type AxAIService, AxAIServiceAbortedError, type AxAIServiceActionOptions, AxAIServiceAuthenticationError, AxAIServiceError, type AxAIServiceImpl, type AxAIServiceMetrics, 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, 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, AxFlow, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, type AxFunctionResult, 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 AxMemoryData, 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 AxResultPickerFunction, type AxResultPickerFunctionFieldResults, type AxResultPickerFunctionFunctionResults, type AxRewriteIn, type AxRewriteOut, type AxSamplePickerOptions, 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, axCreateDefaultLogger, axCreateDefaultTextLogger, axCreateOptimizerLogger, axDefaultOptimizerLogger, axGlobals, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoReka, axModelInfoTogether, axSpanAttributes, axSpanEvents, axValidateChatRequestMessage, axValidateChatResponseResult, f, s };
|
|
4728
|
+
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, type AxAIAnthropicThinkingConfig, type AxAIAnthropicThinkingTokenBudgetLevels, 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 AxAIOpenAIAnnotation, type AxAIOpenAIArgs, AxAIOpenAIBase, type AxAIOpenAIBaseArgs, type AxAIOpenAIChatRequest, type AxAIOpenAIChatResponse, type AxAIOpenAIChatResponseDelta, type AxAIOpenAIConfig, AxAIOpenAIEmbedModel, type AxAIOpenAIEmbedRequest, type AxAIOpenAIEmbedResponse, type AxAIOpenAILogprob, AxAIOpenAIModel, type AxAIOpenAIResponseDelta, AxAIOpenAIResponses, type AxAIOpenAIResponsesArgs, AxAIOpenAIResponsesBase, type AxAIOpenAIResponsesCodeInterpreterToolCall, type AxAIOpenAIResponsesComputerToolCall, type AxAIOpenAIResponsesConfig, type AxAIOpenAIResponsesContentPartAddedEvent, type AxAIOpenAIResponsesContentPartDoneEvent, type AxAIOpenAIResponsesDefineFunctionTool, type AxAIOpenAIResponsesErrorEvent, type AxAIOpenAIResponsesFileSearchCallCompletedEvent, type AxAIOpenAIResponsesFileSearchCallInProgressEvent, type AxAIOpenAIResponsesFileSearchCallSearchingEvent, type AxAIOpenAIResponsesFileSearchToolCall, type AxAIOpenAIResponsesFunctionCallArgumentsDeltaEvent, type AxAIOpenAIResponsesFunctionCallArgumentsDoneEvent, type AxAIOpenAIResponsesFunctionCallItem, type AxAIOpenAIResponsesImageGenerationCallCompletedEvent, type AxAIOpenAIResponsesImageGenerationCallGeneratingEvent, type AxAIOpenAIResponsesImageGenerationCallInProgressEvent, type AxAIOpenAIResponsesImageGenerationCallPartialImageEvent, type AxAIOpenAIResponsesImageGenerationToolCall, AxAIOpenAIResponsesImpl, type AxAIOpenAIResponsesInputAudioContentPart, type AxAIOpenAIResponsesInputContentPart, type AxAIOpenAIResponsesInputFunctionCallItem, type AxAIOpenAIResponsesInputFunctionCallOutputItem, type AxAIOpenAIResponsesInputImageUrlContentPart, type AxAIOpenAIResponsesInputItem, type AxAIOpenAIResponsesInputMessageItem, type AxAIOpenAIResponsesInputTextContentPart, type AxAIOpenAIResponsesLocalShellToolCall, type AxAIOpenAIResponsesMCPCallArgumentsDeltaEvent, type AxAIOpenAIResponsesMCPCallArgumentsDoneEvent, type AxAIOpenAIResponsesMCPCallCompletedEvent, type AxAIOpenAIResponsesMCPCallFailedEvent, type AxAIOpenAIResponsesMCPCallInProgressEvent, type AxAIOpenAIResponsesMCPListToolsCompletedEvent, type AxAIOpenAIResponsesMCPListToolsFailedEvent, type AxAIOpenAIResponsesMCPListToolsInProgressEvent, type AxAIOpenAIResponsesMCPToolCall, AxAIOpenAIResponsesModel, type AxAIOpenAIResponsesOutputItem, type AxAIOpenAIResponsesOutputItemAddedEvent, type AxAIOpenAIResponsesOutputItemDoneEvent, type AxAIOpenAIResponsesOutputMessageItem, type AxAIOpenAIResponsesOutputRefusalContentPart, type AxAIOpenAIResponsesOutputTextAnnotationAddedEvent, type AxAIOpenAIResponsesOutputTextContentPart, type AxAIOpenAIResponsesOutputTextDeltaEvent, type AxAIOpenAIResponsesOutputTextDoneEvent, type AxAIOpenAIResponsesReasoningDeltaEvent, type AxAIOpenAIResponsesReasoningDoneEvent, type AxAIOpenAIResponsesReasoningItem, type AxAIOpenAIResponsesReasoningSummaryDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryDoneEvent, type AxAIOpenAIResponsesReasoningSummaryPart, type AxAIOpenAIResponsesReasoningSummaryPartAddedEvent, type AxAIOpenAIResponsesReasoningSummaryPartDoneEvent, type AxAIOpenAIResponsesReasoningSummaryTextDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryTextDoneEvent, type AxAIOpenAIResponsesRefusalDeltaEvent, type AxAIOpenAIResponsesRefusalDoneEvent, type AxAIOpenAIResponsesRequest, type AxAIOpenAIResponsesResponse, type AxAIOpenAIResponsesResponseCompletedEvent, type AxAIOpenAIResponsesResponseCreatedEvent, type AxAIOpenAIResponsesResponseDelta, type AxAIOpenAIResponsesResponseFailedEvent, type AxAIOpenAIResponsesResponseInProgressEvent, type AxAIOpenAIResponsesResponseIncompleteEvent, type AxAIOpenAIResponsesResponseQueuedEvent, type AxAIOpenAIResponsesStreamEvent, type AxAIOpenAIResponsesStreamEventBase, type AxAIOpenAIResponsesToolCall, type AxAIOpenAIResponsesToolCallBase, type AxAIOpenAIResponsesToolChoice, type AxAIOpenAIResponsesToolDefinition, type AxAIOpenAIResponsesWebSearchCallCompletedEvent, type AxAIOpenAIResponsesWebSearchCallInProgressEvent, type AxAIOpenAIResponsesWebSearchCallSearchingEvent, type AxAIOpenAIResponsesWebSearchToolCall, type AxAIOpenAIUrlCitation, type AxAIOpenAIUsage, type AxAIPromptConfig, AxAIRefusalError, AxAIReka, type AxAIRekaArgs, type AxAIRekaChatRequest, type AxAIRekaChatResponse, type AxAIRekaChatResponseDelta, type AxAIRekaConfig, AxAIRekaModel, type AxAIRekaUsage, type AxAIService, AxAIServiceAbortedError, type AxAIServiceActionOptions, AxAIServiceAuthenticationError, AxAIServiceError, type AxAIServiceImpl, type AxAIServiceMetrics, 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, 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, AxFlow, AxFlowTypedSubContextImpl, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, type AxFunctionResult, 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 AxMemoryData, 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 AxResultPickerFunction, type AxResultPickerFunctionFieldResults, type AxResultPickerFunctionFunctionResults, type AxRewriteIn, type AxRewriteOut, type AxSamplePickerOptions, 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, axCreateDefaultLogger, axCreateDefaultTextLogger, axCreateOptimizerLogger, axDefaultOptimizerLogger, axGlobals, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoOpenAIResponses, axModelInfoReka, axModelInfoTogether, axSpanAttributes, axSpanEvents, axValidateChatRequestMessage, axValidateChatResponseResult, f, s };
|