Documentation

Build LLM-powered agents
with production-ready TypeScript

DSPy for TypeScript. Working with LLMs is complex—they don't always do what you want. DSPy makes it easier to build amazing things with LLMs. Just define your inputs and outputs (signature) and an efficient prompt is auto-generated and used. Connect together various signatures to build complex systems and workflows using LLMs.

15+ LLM Providers
End-to-end Streaming
Auto Prompt Tuning

AxACEOptimizedProgram

Defined in: https://github.com/ax-llm/ax/blob/0aa4aa2ceed1ba61106711baed6ce962cf2eb604/src/ax/dsp/optimizers/ace.ts#L71

Optimized program artifact that persists ACE playbook updates.

Extends

Type Parameters

Type ParameterDefault type
OUTany

Constructors

Constructor

new AxACEOptimizedProgram<OUT>(config: object): AxACEOptimizedProgram<OUT>;

Defined in: https://github.com/ax-llm/ax/blob/0aa4aa2ceed1ba61106711baed6ce962cf2eb604/src/ax/dsp/optimizers/ace.ts#L78

Parameters

ParameterType
config{ artifact: AxACEOptimizationArtifact; baseInstruction?: string; bestScore: number; configurationHistory?: Record<string, unknown>[]; converged: boolean; demos?: AxProgramDemos<any, OUT>[]; examples?: AxExample[]; instruction?: string; modelConfig?: { [key: string]: unknown; frequencyPenalty?: number; maxTokens?: number; presencePenalty?: number; stop?: string | string[]; temperature?: number; topK?: number; topP?: number; }; optimizationTime: number; optimizerType: string; playbook: AxACEPlaybook; scoreHistory?: number[]; stats: AxOptimizationStats; totalRounds: number; }
config.artifactAxACEOptimizationArtifact
config.baseInstruction?string
config.bestScorenumber
config.configurationHistory?Record<string, unknown>[]
config.convergedboolean
config.demos?AxProgramDemos<any, OUT>[]
config.examples?AxExample[]
config.instruction?string
config.modelConfig?{ [key: string]: unknown; frequencyPenalty?: number; maxTokens?: number; presencePenalty?: number; stop?: string | string[]; temperature?: number; topK?: number; topP?: number; }
config.modelConfig.frequencyPenalty?number
config.modelConfig.maxTokens?number
config.modelConfig.presencePenalty?number
config.modelConfig.stop?string | string[]
config.modelConfig.temperature?number
config.modelConfig.topK?number
config.modelConfig.topP?number
config.optimizationTimenumber
config.optimizerTypestring
config.playbookAxACEPlaybook
config.scoreHistory?number[]
config.statsAxOptimizationStats
config.totalRoundsnumber

Returns

AxACEOptimizedProgram<OUT>

Overrides

AxOptimizedProgramImpl.constructor

Properties

PropertyModifierTypeInherited from
artifactreadonlyAxACEOptimizationArtifact-
bestScorereadonlynumberAxOptimizedProgramImpl.bestScore
configurationHistory?readonlyRecord<string, unknown>[]AxOptimizedProgramImpl.configurationHistory
convergedreadonlybooleanAxOptimizedProgramImpl.converged
demos?readonlyAxProgramDemos<any, OUT>[]AxOptimizedProgramImpl.demos
examples?readonlyAxExample[]AxOptimizedProgramImpl.examples
instruction?readonlystringAxOptimizedProgramImpl.instruction
modelConfig?readonlyobjectAxOptimizedProgramImpl.modelConfig
modelConfig.frequencyPenalty?publicnumber-
modelConfig.maxTokens?publicnumber-
modelConfig.presencePenalty?publicnumber-
modelConfig.stop?publicstring | string[]-
modelConfig.temperature?publicnumber-
modelConfig.topK?publicnumber-
modelConfig.topP?publicnumber-
optimizationTimereadonlynumberAxOptimizedProgramImpl.optimizationTime
optimizerTypereadonlystringAxOptimizedProgramImpl.optimizerType
playbookreadonlyAxACEPlaybook-
scoreHistory?readonlynumber[]AxOptimizedProgramImpl.scoreHistory
statsreadonlyAxOptimizationStatsAxOptimizedProgramImpl.stats
totalRoundsreadonlynumberAxOptimizedProgramImpl.totalRounds

Methods

applyTo()

applyTo<IN, T>(program: AxGen<IN, T>): void;

Defined in: https://github.com/ax-llm/ax/blob/0aa4aa2ceed1ba61106711baed6ce962cf2eb604/src/ax/dsp/optimizers/ace.ts#L115

Type Parameters

Type Parameter
IN
T extends AxGenOut

Parameters

ParameterType
programAxGen<IN, T>

Returns

void

Overrides

AxOptimizedProgramImpl.applyTo