AxStepContext Generated TypeScript API reference. typescript api api/reference build/apidocs/Interface.AxStepContext.md interface AxStepContext

AxStepContext

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/types.ts#L47

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

PropertyModifierType
functionsExecutedreadonlyReadonlySet<string>
isFirstStepreadonlyboolean
lastFunctionCallsreadonlyreadonly AxFunctionCallRecord[]
maxStepsreadonlynumber
statereadonlyMap<string, unknown>
stepIndexreadonlynumber
usagereadonlyReadonly<AxStepUsage>

Methods

addFunctions()

TypeScript
addFunctions(functions: AxInputFunctionType): void;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/types.ts#L69

Parameters

ParameterType
functionsAxInputFunctionType

Returns

void


removeFunctions()

TypeScript
removeFunctions(...names: string[]): void;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/types.ts#L70

Parameters

ParameterType
namesstring[]

Returns

void


setMaxTokens()

TypeScript
setMaxTokens(maxTokens: number): void;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/types.ts#L63

Parameters

ParameterType
maxTokensnumber

Returns

void


setModel()

TypeScript
setModel(model: string): void;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/types.ts#L60

Parameters

ParameterType
modelstring

Returns

void


setOptions()

TypeScript
setOptions(options: Partial<AxAIServiceOptions & object>): void;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/types.ts#L64

Parameters

ParameterType
optionsPartial<AxAIServiceOptions & object>

Returns

void


setTemperature()

TypeScript
setTemperature(temperature: number): void;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/types.ts#L62

Parameters

ParameterType
temperaturenumber

Returns

void


setThinkingBudget()

TypeScript
setThinkingBudget(budget: undefined | "high" | "low" | "minimal" | "medium" | "highest" | "none"): void;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/types.ts#L61

Parameters

ParameterType
budgetundefined | "high" | "low" | "minimal" | "medium" | "highest" | "none"

Returns

void


stop()

TypeScript
stop(resultValues?: Record<string, unknown>): void;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/types.ts#L71

Parameters

ParameterType
resultValues?Record<string, unknown>

Returns

void

Docs