AxFlowTypedSubContextImpl
Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/flow/subContext.ts#L112
Typed implementation of the sub-context for parallel execution with full type safety
Type Parameters
Type Parameter |
---|
TNodes extends Record <string , AxGen <any , any >> |
TState extends AxFlowState |
Implements
AxFlowTypedSubContext
<TNodes
,TState
>
Constructors
Constructor
new AxFlowTypedSubContextImpl<TNodes, TState>(nodeGenerators: Map<string,
| AxGen<AxGenIn, AxGenOut>
| AxProgram<AxGenIn, AxGenOut>>): AxFlowTypedSubContextImpl<TNodes, TState>;
Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/flow/subContext.ts#L119
Parameters
Parameter | Type |
---|---|
nodeGenerators | Map <string , | AxGen <AxGenIn , AxGenOut > | AxProgram <AxGenIn , AxGenOut >> |
Returns
AxFlowTypedSubContextImpl
<TNodes
, TState
>
Methods
execute()
execute<TNodeName, TAI>(
nodeName: TNodeName,
mapping: (state: TState) => GetGenIn<TNodes[TNodeName]>,
dynamicContext?: AxFlowDynamicContext<TAI>): AxFlowTypedSubContext<TNodes, AddNodeResult<TState, TNodeName, GetGenOut<TNodes[TNodeName]>>>;
Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/flow/subContext.ts#L126
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
AxFlowTypedSubContext
<TNodes
, AddNodeResult
<TState
, TNodeName
, GetGenOut
<TNodes
[TNodeName
]>>>
Implementation of
executeSteps()
executeSteps(initialState: TState, context: Readonly<{
mainAi: AxAIService;
mainOptions?: AxProgramForwardOptions<string>;
}>): Promise<AxFlowState>;
Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/flow/subContext.ts#L190
Parameters
Parameter | Type |
---|---|
initialState | TState |
context | Readonly <{ mainAi : AxAIService ; mainOptions? : AxProgramForwardOptions <string >; }> |
Returns
Promise
<AxFlowState
>
Implementation of
AxFlowTypedSubContext
.executeSteps
map()
map<TNewState>(transform: (state: TState) => TNewState): AxFlowTypedSubContext<TNodes, TNewState>;
Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/flow/subContext.ts#L182
Type Parameters
Type Parameter |
---|
TNewState extends AxFlowState |
Parameters
Parameter | Type |
---|---|
transform | (state : TState ) => TNewState |
Returns
AxFlowTypedSubContext
<TNodes
, TNewState
>