flow
const flow: {
<TInput, TOutput> (options?: AxFlowOptions): AxFlow<TInput, TOutput, {
}, TInput>;
<TInput, TOutput> (mermaid: string, bindings?: AxFlowMermaidBindings): AxFlow<TInput, TOutput, any, any>;
} = flowFn;Defined in: https://github.com/ax-llm/ax/blob/3ac75e381dcefb739712993c304c34295567283a/src/ax/flow/flow.ts#L1720
Creates a new AxFlow builder. Passing a string compiles a mermaid
flowchart in the AxFlow dialect (see AxFlow.toString) into a runnable
flow — node contracts come from %%ax nodeId: <signature> directives or
from bindings.nodes, data wiring is by field name (a node input binds to
the nearest upstream producer of that field), labeled out-edges of a
decision node become branches, and back-edges become feedback/while
loops. flow(String(otherFlow)) round-trips.
Call Signature
<TInput, TOutput>(options?: AxFlowOptions): AxFlow<TInput, TOutput, {
}, TInput>;Type Parameters
| Type Parameter | Default type |
|---|---|
TInput extends Record<string, any> | Record<string, unknown> |
TOutput | object |
Parameters
| Parameter | Type |
|---|---|
options? | AxFlowOptions |
Returns
AxFlow<TInput, TOutput, {
}, TInput>
Call Signature
<TInput, TOutput>(mermaid: string, bindings?: AxFlowMermaidBindings): AxFlow<TInput, TOutput, any, any>;Type Parameters
| Type Parameter | Default type |
|---|---|
TInput extends Record<string, any> | Record<string, any> |
TOutput | Record<string, any> |
Parameters
| Parameter | Type |
|---|---|
mermaid | string |
bindings? | AxFlowMermaidBindings |
Returns
AxFlow<TInput, TOutput, any, any>