AxStepContext
Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L45
Mutable context object that flows through the generation loop. Accessible to functions and step hooks, enabling per-step control over model, options, functions, and loop flow.
Uses a pending mutations pattern: changes are collected during a step and applied at the top of the next iteration.
Properties
| Property | Modifier | Type |
|---|---|---|
functionsExecuted | readonly | ReadonlySet<string> |
isFirstStep | readonly | boolean |
lastFunctionCalls | readonly | readonly AxFunctionCallRecord[] |
maxSteps | readonly | number |
state | readonly | Map<string, unknown> |
stepIndex | readonly | number |
usage | readonly | Readonly<AxStepUsage> |
Methods
addFunctions()
addFunctions(functions: AxInputFunctionType): void;
Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L67
Parameters
| Parameter | Type |
|---|---|
functions | AxInputFunctionType |
Returns
void
removeFunctions()
removeFunctions(...names: string[]): void;
Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L68
Parameters
| Parameter | Type |
|---|---|
…names | string[] |
Returns
void
setMaxTokens()
setMaxTokens(maxTokens: number): void;
Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L61
Parameters
| Parameter | Type |
|---|---|
maxTokens | number |
Returns
void
setModel()
setModel(model: string): void;
Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L58
Parameters
| Parameter | Type |
|---|---|
model | string |
Returns
void
setOptions()
setOptions(options: Partial<AxAIServiceOptions & object>): void;
Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L62
Parameters
| Parameter | Type |
|---|---|
options | Partial<AxAIServiceOptions & object> |
Returns
void
setTemperature()
setTemperature(temperature: number): void;
Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L60
Parameters
| Parameter | Type |
|---|---|
temperature | number |
Returns
void
setThinkingBudget()
setThinkingBudget(budget: undefined | "high" | "low" | "minimal" | "medium" | "highest" | "none"): void;
Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L59
Parameters
| Parameter | Type |
|---|---|
budget | undefined | "high" | "low" | "minimal" | "medium" | "highest" | "none" |
Returns
void
stop()
stop(resultValues?: Record<string, unknown>): void;
Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L69
Parameters
| Parameter | Type |
|---|---|
resultValues? | Record<string, unknown> |
Returns
void