AxBestOfN
Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/refine.ts#L587
Extends
AxRefineBase<IN,OUT>
Type Parameters
| Type Parameter |
|---|
IN |
OUT extends AxGenOut |
Constructors
Constructor
new AxBestOfN<IN, OUT>(program: Readonly<AxProgrammable<IN, OUT>>, options: Readonly<AxBestOfNOptions<IN, OUT>>): AxBestOfN<IN, OUT>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/refine.ts#L596
Parameters
| Parameter | Type |
|---|---|
program | Readonly<AxProgrammable<IN, OUT>> |
options | Readonly<AxBestOfNOptions<IN, OUT>> |
Returns
AxBestOfN<IN, OUT>
Overrides
AxRefineBase<IN, OUT>.constructorMethods
applyOptimization()
applyOptimization(optimizedProgram: AxOptimizedProgram<OUT>): void;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/refine.ts#L234
Parameters
| Parameter | Type |
|---|---|
optimizedProgram | AxOptimizedProgram<OUT> |
Returns
void
Inherited from
AxRefineBase.applyOptimizationapplyOptimizedComponents()
applyOptimizedComponents(updates: Readonly<Record<string, string>>): void;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/refine.ts#L242
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
Inherited from
AxRefineBase.applyOptimizedComponentsforward()
forward(
ai: Readonly<AxAIService>,
input: IN,
options?: Readonly<AxProgramForwardOptions<any>>): Promise<OUT>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/refine.ts#L610
Parameters
| Parameter | Type |
|---|---|
ai | Readonly<AxAIService> |
input | IN |
options? | Readonly<AxProgramForwardOptions<any>> |
Returns
Promise<OUT>
Overrides
AxRefineBase.forwardgetAttempts()
getAttempts(): readonly AxAttempt<IN, OUT>[];Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/refine.ts#L203
Returns
readonly AxAttempt<IN, OUT>[]
Inherited from
AxRefineBase.getAttemptsgetChatLog()
getChatLog(): readonly AxChatLogEntry[];Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/refine.ts#L252
Returns
readonly AxChatLogEntry[]
Inherited from
AxRefineBase.getChatLoggetId()
getId(): string;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/refine.ts#L211
Returns
string
Inherited from
AxRefineBase.getIdgetOptimizableComponents()
getOptimizableComponents(): readonly AxOptimizableComponent[];Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/refine.ts#L238
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[]
Inherited from
AxRefineBase.getOptimizableComponentsgetSignature()
getSignature(): AxSignature;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/refine.ts#L207
Returns
Inherited from
AxRefineBase.getSignaturegetTraces()
getTraces(): AxProgramTrace<IN, OUT>[];Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/refine.ts#L219
Returns
AxProgramTrace<IN, OUT>[]
Inherited from
AxRefineBase.getTracesgetUsage()
getUsage(): AxModelUsage & object[];Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/refine.ts#L248
Returns
AxModelUsage & object[]
Inherited from
AxRefineBase.getUsagenamedProgramInstances()
namedProgramInstances(): AxNamedProgramInstance<any, any>[];Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/refine.ts#L223
Returns
AxNamedProgramInstance<any, any>[]
Inherited from
AxRefineBase.namedProgramInstancesresetUsage()
resetUsage(): void;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/refine.ts#L256
Returns
void
Inherited from
AxRefineBase.resetUsagesetDemos()
setDemos(demos: readonly AxProgramDemos<IN, OUT>[], options?: object): void;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/refine.ts#L227
Parameters
| Parameter | Type |
|---|---|
demos | readonly AxProgramDemos<IN, OUT>[] |
options? | { modelConfig?: Record<string, unknown>; } |
options.modelConfig? | Record<string, unknown> |
Returns
void
Inherited from
AxRefineBase.setDemossetId()
setId(id: string): void;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/refine.ts#L215
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
Inherited from
AxRefineBase.setIdstreamingForward()
streamingForward(
_ai: Readonly<AxAIService>,
_values: IN,
_options?: Readonly<AxProgramStreamingForwardOptions<any>>): AxGenStreamingOut<OUT>;Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/refine.ts#L262
Parameters
| Parameter | Type |
|---|---|
_ai | Readonly<AxAIService> |
_values | IN |
_options? | Readonly<AxProgramStreamingForwardOptions<any>> |
Returns
AxGenStreamingOut<OUT>
Inherited from
AxRefineBase.streamingForward