AxFlow
Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L90
Interface for flows that can be tuned, executed, and used in compositions. Provides methods for building and executing complex AI workflows.
Type Parameters
| Type Parameter | Default type |
|---|---|
IN extends Record<string, any> | - |
OUT | - |
TNodes extends Record<string, AxProgrammable<any, any>> | Record<string, never> |
TState extends AxFlowState | IN |
Implements
AxFlowable<IN,OUT>AxFlowNodeExecutionRecorder
Methods
applyOptimization()
applyOptimization(optimizedProgram: AxOptimizedProgram<any>): void;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1011
Parameters
| Parameter | Type |
|---|---|
optimizedProgram | AxOptimizedProgram<any> |
Returns
void
Implementation of
applyOptimizedComponents()
applyOptimizedComponents(updates: Readonly<Record<string, string>>): void;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1038
Apply a map of componentKey → newValue updates produced by an optimizer.
Each program filters keys belonging to itself and dispatches internally.
Unknown keys are silently ignored, which lets parents broadcast a single
map across the whole subtree.
Parameters
| Parameter | Type |
|---|---|
updates | Readonly<Record<string, string>> |
Returns
void
Implementation of
AxFlowable.applyOptimizedComponents
b()
b(predicate: (_state: TState) => unknown): this;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1066
Parameters
| Parameter | Type |
|---|---|
predicate | (_state: TState) => unknown |
Returns
this
branch()
branch(predicate: (_state: TState) => unknown): this;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1054
Parameters
| Parameter | Type |
|---|---|
predicate | (_state: TState) => unknown |
Returns
this
derive()
derive<T>(
outputFieldName: string,
inputFieldName: string,
transformFn: (value: any, index?: number, state?: TState) => T,
options?: object): this;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1321
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
outputFieldName | string |
inputFieldName | string |
transformFn | (value: any, index?: number, state?: TState) => T |
options? | { batchSize?: number; } |
options.batchSize? | number |
Returns
this
description()
description(name: string, description: string): this;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L407
Parameters
| Parameter | Type |
|---|---|
name | string |
description | string |
Returns
this
e()
e<TNodeName, TAI>(
nodeName: TNodeName,
mapping: (_state: TState) => GetGenIn<TNodes[TNodeName]>,
dynamicContext?: AxFlowDynamicContext<TAI>): AxFlow<IN, OUT, TNodes, AddNodeResult<TState, TNodeName, GetGenOut<TNodes[TNodeName]>>>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L995
Type Parameters
| Type Parameter |
|---|
TNodeName extends string |
TAI extends Readonly<AxAIService<unknown, unknown, string>> |
Parameters
| Parameter | Type |
|---|---|
nodeName | TNodeName |
mapping | (_state: TState) => GetGenIn<TNodes[TNodeName]> |
dynamicContext? | AxFlowDynamicContext<TAI> |
Returns
AxFlow<IN, OUT, TNodes, AddNodeResult<TState, TNodeName, GetGenOut<TNodes[TNodeName]>>>
end()
end(): this;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1317
Returns
this
endWhile()
endWhile(): this;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1278
Returns
this
execute()
execute<TNodeName, TAI>(
nodeName: TNodeName,
mapping: (_state: TState) => GetGenIn<TNodes[TNodeName]>,
dynamicContext?: AxFlowDynamicContext<TAI>): AxFlow<IN, OUT, TNodes, AddNodeResult<TState, TNodeName, GetGenOut<TNodes[TNodeName]>>>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L973
Type Parameters
| Type Parameter |
|---|
TNodeName extends string |
TAI extends Readonly<AxAIService<unknown, unknown, string>> |
Parameters
| Parameter | Type |
|---|---|
nodeName | TNodeName |
mapping | (_state: TState) => GetGenIn<TNodes[TNodeName]> |
dynamicContext? | AxFlowDynamicContext<TAI> |
Returns
AxFlow<IN, OUT, TNodes, AddNodeResult<TState, TNodeName, GetGenOut<TNodes[TNodeName]>>>
fb()
fb(
condition: (_state: TState) => boolean,
targetLabel: string,
maxIterations: number): this;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1251
Parameters
| Parameter | Type | Default value |
|---|---|---|
condition | (_state: TState) => boolean | undefined |
targetLabel | string | undefined |
maxIterations | number | 10 |
Returns
this
feedback()
feedback(
condition: (_state: TState) => boolean,
targetLabel: string,
maxIterations: number): this;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1206
Parameters
| Parameter | Type | Default value |
|---|---|---|
condition | (_state: TState) => boolean | undefined |
targetLabel | string | undefined |
maxIterations | number | 10 |
Returns
this
forward()
forward<T>(
ai: T,
values: IN,
options?: Readonly<AxFlowForwardOptions<T>>): Promise<OUT>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L544
Type Parameters
| Type Parameter |
|---|
T extends Readonly<AxAIService<unknown, unknown, string>> |
Parameters
| Parameter | Type |
|---|---|
ai | T |
values | IN |
options? | Readonly<AxFlowForwardOptions<T>> |
Returns
Promise<OUT>
Implementation of
getChatLog()
getChatLog(): readonly AxChatLogEntry[];Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L452
Returns
readonly AxChatLogEntry[]
Implementation of
getExecutionPlan()
getExecutionPlan(): object;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1362
Returns
object
| Name | Type |
|---|---|
autoParallelEnabled | boolean |
groups? | AxFlowExecutionPlanGroup[] |
maxParallelism | number |
parallelGroups | number |
steps? | AxFlowExecutionPlanStep[] |
totalSteps | number |
getId()
getId(): string;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L367
Returns
string
Implementation of
getNodePrograms()
getNodePrograms(): readonly object[];Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L484
Returns
readonly object[]
getOptimizableComponents()
getOptimizableComponents(): readonly AxOptimizableComponent[];Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1022
Enumerate all string-valued artifacts this program tree exposes for reflective optimization (instructions, signature descriptions, function names/descriptions, agent system prompts, etc.). Composite programs flat-map their children’s components and append their own.
The optimizer never walks the tree — traversal is encapsulated here.
Returns
readonly AxOptimizableComponent[]
Implementation of
AxFlowable.getOptimizableComponents
getSignature()
getSignature(): AxSignature;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1377
Returns
Implementation of
getTraces()
getTraces(): AxProgramTrace<IN, OUT>[];Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L387
Returns
AxProgramTrace<IN, OUT>[]
Implementation of
getTracesReport()
getTracesReport(): Record<string, AxProgramTrace<any, any>[]>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L513
Returns
Record<string, AxProgramTrace<any, any>[]>
getUsage()
getUsage(): AxModelUsage & object[];Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L448
Returns
AxModelUsage & object[]
Implementation of
getUsageReport()
getUsageReport(): Record<string, AxProgramUsage[]>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L476
Returns
Record<string, AxProgramUsage[]>
l()
l(label: string): this;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L922
Parameters
| Parameter | Type |
|---|---|
label | string |
Returns
this
label()
label(label: string): this;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L911
Parameters
| Parameter | Type |
|---|---|
label | string |
Returns
this
m()
Call Signature
m<TNewState>(transform: (_state: TState) => TNewState): AxFlow<IN, OUT, TNodes, TNewState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L869
Type Parameters
| Type Parameter |
|---|
TNewState extends AxFlowState |
Parameters
| Parameter | Type |
|---|---|
transform | (_state: TState) => TNewState |
Returns
AxFlow<IN, OUT, TNodes, TNewState>
Call Signature
m<TNewState>(transform: (_state: TState) => Promise<TNewState>): AxFlow<IN, OUT, TNodes, TNewState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L872
Type Parameters
| Type Parameter |
|---|
TNewState extends AxFlowState |
Parameters
| Parameter | Type |
|---|---|
transform | (_state: TState) => Promise<TNewState> |
Returns
AxFlow<IN, OUT, TNodes, TNewState>
Call Signature
m<TNewState>(transforms: (_state: TState) => TNewState[], options: object): AxFlow<IN, OUT, TNodes, TNewState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L875
Type Parameters
| Type Parameter |
|---|
TNewState extends AxFlowState |
Parameters
| Parameter | Type |
|---|---|
transforms | (_state: TState) => TNewState[] |
options | { parallel: true; } |
options.parallel | true |
Returns
AxFlow<IN, OUT, TNodes, TNewState>
Call Signature
m<TNewState>(transforms: (_state: TState) => Promise<TNewState>[], options: object): AxFlow<IN, OUT, TNodes, TNewState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L879
Type Parameters
| Type Parameter |
|---|
TNewState extends AxFlowState |
Parameters
| Parameter | Type |
|---|---|
transforms | (_state: TState) => Promise<TNewState>[] |
options | { parallel: true; } |
options.parallel | true |
Returns
AxFlow<IN, OUT, TNodes, TNewState>
map()
Call Signature
map<TNewState>(transform: (_state: TState) => TNewState): AxFlow<IN, OUT, TNodes, TNewState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L819
Type Parameters
| Type Parameter |
|---|
TNewState extends AxFlowState |
Parameters
| Parameter | Type |
|---|---|
transform | (_state: TState) => TNewState |
Returns
AxFlow<IN, OUT, TNodes, TNewState>
Call Signature
map<TNewState>(transform: (_state: TState) => Promise<TNewState>): AxFlow<IN, OUT, TNodes, TNewState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L822
Type Parameters
| Type Parameter |
|---|
TNewState extends AxFlowState |
Parameters
| Parameter | Type |
|---|---|
transform | (_state: TState) => Promise<TNewState> |
Returns
AxFlow<IN, OUT, TNodes, TNewState>
Call Signature
map<TNewState>(transforms: (_state: TState) => TNewState[], options: object): AxFlow<IN, OUT, TNodes, TNewState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L825
Type Parameters
| Type Parameter |
|---|
TNewState extends AxFlowState |
Parameters
| Parameter | Type |
|---|---|
transforms | (_state: TState) => TNewState[] |
options | { parallel: true; } |
options.parallel | true |
Returns
AxFlow<IN, OUT, TNodes, TNewState>
Call Signature
map<TNewState>(transforms: (_state: TState) => Promise<TNewState>[], options: object): AxFlow<IN, OUT, TNodes, TNewState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L829
Type Parameters
| Type Parameter |
|---|
TNewState extends AxFlowState |
Parameters
| Parameter | Type |
|---|---|
transforms | (_state: TState) => Promise<TNewState>[] |
options | { parallel: true; } |
options.parallel | true |
Returns
AxFlow<IN, OUT, TNodes, TNewState>
Call Signature
map<TNewState>(transform: (_state: TState) => TNewState | Promise<TNewState>, options?: object): AxFlow<IN, OUT, TNodes, TNewState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L833
Type Parameters
| Type Parameter |
|---|
TNewState extends AxFlowState |
Parameters
| Parameter | Type |
|---|---|
transform | (_state: TState) => TNewState | Promise<TNewState> |
options? | { parallel?: boolean; } |
options.parallel? | boolean |
Returns
AxFlow<IN, OUT, TNodes, TNewState>
merge()
merge<TMergedState>(): AxFlow<IN, OUT, TNodes, TMergedState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1085
Type Parameters
| Type Parameter | Default type |
|---|---|
TMergedState extends AxFlowState | TState |
Returns
AxFlow<IN, OUT, TNodes, TMergedState>
mg()
mg<TMergedState>(): AxFlow<IN, OUT, TNodes, TMergedState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1119
Type Parameters
| Type Parameter | Default type |
|---|---|
TMergedState extends AxFlowState | TState |
Returns
AxFlow<IN, OUT, TNodes, TMergedState>
n()
Call Signature
n<TName, TSig>(name: TName, signature: TSig): AxFlow<IN, OUT, TNodes & { [K in string]: InferAxGen<TSig> }, TState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L784
Type Parameters
| Type Parameter |
|---|
TName extends string |
TSig extends string |
Parameters
| Parameter | Type |
|---|---|
name | TName |
signature | TSig |
Returns
AxFlow<IN, OUT, TNodes & { [K in string]: InferAxGen<TSig> }, TState>
Call Signature
n<TName>(name: TName, signature: AxSignature): AxFlow<IN, OUT, TNodes & { [K in string]: AxGen<AxGenIn, AxGenOut> }, TState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L788
Type Parameters
| Type Parameter |
|---|
TName extends string |
Parameters
| Parameter | Type |
|---|---|
name | TName |
signature | AxSignature |
Returns
AxFlow<IN, OUT, TNodes & { [K in string]: AxGen<AxGenIn, AxGenOut> }, TState>
Call Signature
n<TName, TProgram>(name: TName, programClass: TProgram): AxFlow<IN, OUT, TNodes & { [K in string]: InstanceType<TProgram> }, TState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L797
Type Parameters
| Type Parameter |
|---|
TName extends string |
TProgram extends () => AxProgrammable<any, any> |
Parameters
| Parameter | Type |
|---|---|
name | TName |
programClass | TProgram |
Returns
AxFlow<IN, OUT, TNodes & { [K in string]: InstanceType<TProgram> }, TState>
Call Signature
n<TName, TProgram>(name: TName, programInstance: TProgram): AxFlow<IN, OUT, TNodes & { [K in string]: TProgram }, TState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L804
Type Parameters
| Type Parameter |
|---|
TName extends string |
TProgram extends AxProgrammable<any, any, string> |
Parameters
| Parameter | Type |
|---|---|
name | TName |
programInstance | TProgram |
Returns
AxFlow<IN, OUT, TNodes & { [K in string]: TProgram }, TState>
namedProgramInstances()
namedProgramInstances(): AxNamedProgramInstance<IN, OUT>[];Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L382
Returns
AxNamedProgramInstance<IN, OUT>[]
Implementation of
AxFlowable.namedProgramInstances
namedPrograms()
namedPrograms(): object[];Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L377
Returns
object[]
node()
Call Signature
node<TName, TSig>(name: TName, signature: TSig): AxFlow<IN, OUT, TNodes & { [K in string]: InferAxGen<TSig> }, TState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L711
Type Parameters
| Type Parameter |
|---|
TName extends string |
TSig extends string |
Parameters
| Parameter | Type |
|---|---|
name | TName |
signature | TSig |
Returns
AxFlow<IN, OUT, TNodes & { [K in string]: InferAxGen<TSig> }, TState>
Call Signature
node<TName>(name: TName, signature: AxSignature): AxFlow<IN, OUT, TNodes & { [K in string]: AxGen<AxGenIn, AxGenOut> }, TState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L716
Type Parameters
| Type Parameter |
|---|
TName extends string |
Parameters
| Parameter | Type |
|---|---|
name | TName |
signature | AxSignature |
Returns
AxFlow<IN, OUT, TNodes & { [K in string]: AxGen<AxGenIn, AxGenOut> }, TState>
Call Signature
node<TName, TProgram>(name: TName, programClass: TProgram): AxFlow<IN, OUT, TNodes & { [K in string]: InstanceType<TProgram> }, TState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L726
Type Parameters
| Type Parameter |
|---|
TName extends string |
TProgram extends () => AxProgrammable<any, any> |
Parameters
| Parameter | Type |
|---|---|
name | TName |
programClass | TProgram |
Returns
AxFlow<IN, OUT, TNodes & { [K in string]: InstanceType<TProgram> }, TState>
Call Signature
node<TName, TProgram>(name: TName, programInstance: TProgram): AxFlow<IN, OUT, TNodes & { [K in string]: TProgram }, TState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L734
Type Parameters
| Type Parameter |
|---|
TName extends string |
TProgram extends AxProgrammable<any, any, string> |
Parameters
| Parameter | Type |
|---|---|
name | TName |
programInstance | TProgram |
Returns
AxFlow<IN, OUT, TNodes & { [K in string]: TProgram }, TState>
nodeExtended()
nodeExtended<TName>(
name: TName,
baseSignature:
| string
| AxSignature<Record<string, any>, Record<string, any>>,
extensions: object): AxFlow<IN, OUT, TNodes & { [K in string]: AxGen<AxGenIn, AxGenOut> }, TState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1382
Type Parameters
| Type Parameter |
|---|
TName extends string |
Parameters
| Parameter | Type |
|---|---|
name | TName |
baseSignature | | string | AxSignature<Record<string, any>, Record<string, any>> |
extensions | { appendInputs?: object[]; appendOutputs?: object[]; prependInputs?: object[]; prependOutputs?: object[]; } |
extensions.appendInputs? | object[] |
extensions.appendOutputs? | object[] |
extensions.prependInputs? | object[] |
extensions.prependOutputs? | object[] |
Returns
AxFlow<IN, OUT, TNodes & { [K in string]: AxGen<AxGenIn, AxGenOut> }, TState>
nx()
nx<TName>(
name: TName,
baseSignature:
| string
| AxSignature<Record<string, any>, Record<string, any>>,
extensions: object): AxFlow<IN, OUT, TNodes & { [K in string]: AxGen<AxGenIn, AxGenOut> }, TState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1417
Type Parameters
| Type Parameter |
|---|
TName extends string |
Parameters
| Parameter | Type |
|---|---|
name | TName |
baseSignature | | string | AxSignature<Record<string, any>, Record<string, any>> |
extensions | { appendInputs?: object[]; appendOutputs?: object[]; prependInputs?: object[]; prependOutputs?: object[]; } |
extensions.appendInputs? | object[] |
extensions.appendOutputs? | object[] |
extensions.prependInputs? | object[] |
extensions.prependOutputs? | object[] |
Returns
AxFlow<IN, OUT, TNodes & { [K in string]: AxGen<AxGenIn, AxGenOut> }, TState>
p()
p(branches: AxFlowTypedParallelBranch<TNodes, TState>[]): object;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1197
Parameters
| Parameter | Type |
|---|---|
branches | AxFlowTypedParallelBranch<TNodes, TState>[] |
Returns
object
| Name | Type |
|---|---|
merge() | (resultKey: TResultKey, mergeFunction: (…_results: unknown[]) => T) => |
parallel()
parallel(branches: AxFlowTypedParallelBranch<TNodes, TState>[]): object;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1128
Parameters
| Parameter | Type |
|---|---|
branches | AxFlowTypedParallelBranch<TNodes, TState>[] |
Returns
object
| Name | Type |
|---|---|
merge() | (resultKey: TResultKey, mergeFunction: (…_results: unknown[]) => T) => |
r()
r<TNewOut>(transform: (_state: TState) => TNewOut): AxFlow<IN, TNewOut, TNodes, TState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L905
Type Parameters
| Type Parameter |
|---|
TNewOut extends Record<string, unknown> |
Parameters
| Parameter | Type |
|---|---|
transform | (_state: TState) => TNewOut |
Returns
AxFlow<IN, TNewOut, TNodes, TState>
recordChatLog()
recordChatLog(_nodeName: string, entries: AxChatLogEntry[]): void;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L531
Parameters
| Parameter | Type |
|---|---|
_nodeName | string |
entries | AxChatLogEntry[] |
Returns
void
Implementation of
AxFlowNodeExecutionRecorder.recordChatLogrecordTraces()
recordTraces(nodeName: string, traces: AxProgramTrace<any, any>[]): void;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L526
Parameters
| Parameter | Type |
|---|---|
nodeName | string |
traces | AxProgramTrace<any, any>[] |
Returns
void
Implementation of
AxFlowNodeExecutionRecorder.recordTracesrecordUsage()
recordUsage(nodeName: string, usage: AxModelUsage & object[]): void;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L521
Parameters
| Parameter | Type |
|---|---|
nodeName | string |
usage | AxModelUsage & object[] |
Returns
void
Implementation of
AxFlowNodeExecutionRecorder.recordUsageresetChatLog()
resetChatLog(): void;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L472
Returns
void
resetTraces()
resetTraces(): void;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L468
Returns
void
resetUsage()
resetUsage(): void;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L456
Returns
void
Implementation of
returns()
returns<TNewOut>(transform: (_state: TState) => TNewOut): AxFlow<IN, TNewOut, TNodes, TState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L892
Type Parameters
| Type Parameter |
|---|
TNewOut extends Record<string, unknown> |
Parameters
| Parameter | Type |
|---|---|
transform | (_state: TState) => TNewOut |
Returns
AxFlow<IN, TNewOut, TNodes, TState>
setAllNodeInstructions()
setAllNodeInstructions(map: Readonly<Record<string, string>>): void;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L507
Parameters
| Parameter | Type |
|---|---|
map | Readonly<Record<string, string>> |
Returns
void
setDemos()
setDemos(demos: readonly AxProgramDemos<IN, OUT, keyof TNodes extends never ? string : `${string}.${string & keyof TNodes}`>[], options?: object): void;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L395
Parameters
| Parameter | Type |
|---|---|
demos | readonly AxProgramDemos<IN, OUT, keyof TNodes extends never ? string : `${string}.${string & keyof TNodes}`>[] |
options? | { modelConfig?: Record<string, unknown>; } |
options.modelConfig? | Record<string, unknown> |
Returns
void
Implementation of
setId()
setId(id: string): void;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L372
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
Implementation of
setNodeInstruction()
setNodeInstruction(name: string, instruction: string): boolean;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L494
Parameters
| Parameter | Type |
|---|---|
name | string |
instruction | string |
Returns
boolean
stop()
stop(): void;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L164
Returns
void
streamingForward()
streamingForward<T>(
ai: T,
values: IN,
options?: Readonly<AxProgramStreamingForwardOptionsWithModels<T>>): AxGenStreamingOut<OUT>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L535
Type Parameters
| Type Parameter |
|---|
T extends Readonly<AxAIService<unknown, unknown, string>> |
Parameters
| Parameter | Type |
|---|---|
ai | T |
values | IN |
options? | Readonly<AxProgramStreamingForwardOptionsWithModels<T>> |
Returns
AxGenStreamingOut<OUT>
Implementation of
toFunction()
toFunction(): AxFunction;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L414
Returns
w()
w(value: unknown): this;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1081
Parameters
| Parameter | Type |
|---|---|
value | unknown |
Returns
this
wh()
wh(condition: (_state: TState) => boolean, maxIterations: number): this;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1274
Parameters
| Parameter | Type | Default value |
|---|---|---|
condition | (_state: TState) => boolean | undefined |
maxIterations | number | 100 |
Returns
this
when()
when(value: unknown): this;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1070
Parameters
| Parameter | Type |
|---|---|
value | unknown |
Returns
this
while()
while(condition: (state: TState) => boolean, maxIterations: number): this;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L1259
Parameters
| Parameter | Type | Default value |
|---|---|---|
condition | (state: TState) => boolean | undefined |
maxIterations | number | 100 |
Returns
this
create()
static create<IN, OUT, TNodes, TState>(options?: AxFlowOptions): AxFlow<IN, OUT, TNodes, TState>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/flow/flow.ts#L148
Type Parameters
| Type Parameter | Default type |
|---|---|
IN extends Record<string, any> | Record<string, unknown> |
OUT | object |
TNodes extends Record<string, AxProgrammable<any, any, string>> | Record<string, never> |
TState extends AxFlowState | IN |
Parameters
| Parameter | Type |
|---|---|
options? | AxFlowOptions |
Returns
AxFlow<IN, OUT, TNodes, TState>