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

AxProgram

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/program.ts#L17

Extended by

Type Parameters

Type Parameter
IN
OUT

Implements

Constructors

Constructor

new AxProgram<IN, OUT>(signature: 
  | undefined
  | Readonly<
  | string
  | AxSignature<Record<string, any>, Record<string, any>>
| AxSignatureConfig>, options?: Readonly<AxProgramOptions>): AxProgram<IN, OUT>;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/program.ts#L31

Parameters

ParameterType
signature| undefined | Readonly< | string | AxSignature<Record<string, any>, Record<string, any>> | AxSignatureConfig>
options?Readonly<AxProgramOptions>

Returns

AxProgram<IN, OUT>

Methods

getSignature()

getSignature(): AxSignature;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/program.ts#L55

Returns

AxSignature


getTraces()

getTraces(): AxProgramTrace<IN, OUT>[];

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/program.ts#L153

Returns

AxProgramTrace<IN, OUT>[]


getUsage()

getUsage(): AxModelUsage & object[];

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/program.ts#L167

Returns

AxModelUsage & object[]

Implementation of

AxUsable.getUsage


register()

register(prog: Readonly<AxTunable<IN, OUT> & AxUsable>): void;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/program.ts#L83

Parameters

ParameterType
progReadonly<AxTunable<IN, OUT> & AxUsable>

Returns

void


resetUsage()

resetUsage(): void;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/program.ts#L177

Returns

void

Implementation of

AxUsable.resetUsage


setDemos()

setDemos(demos: readonly AxProgramDemos<IN, OUT>[]): void;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/program.ts#L184

Parameters

ParameterType
demosreadonly AxProgramDemos<IN, OUT>[]

Returns

void


setDescription()

setDescription(description: string): void;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/program.ts#L73

Parameters

ParameterType
descriptionstring

Returns

void


setExamples()

setExamples(examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/program.ts#L103

Parameters

ParameterType
examplesReadonly<AxProgramExamples<IN, OUT>>
options?Readonly<AxSetExamplesOptions>

Returns

void


setId()

setId(id: string): void;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/program.ts#L90

Parameters

ParameterType
idstring

Returns

void


setParentId()

setParentId(parentId: string): void;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/program.ts#L97

Parameters

ParameterType
parentIdstring

Returns

void


setSignature()

setSignature(signature: 
  | undefined
  | Readonly<
  | string
  | AxSignature<Record<string, any>, Record<string, any>>
  | AxSignatureConfig>): void;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/program.ts#L59

Parameters

ParameterType
signature| undefined | Readonly< | string | AxSignature<Record<string, any>, Record<string, any>> | AxSignatureConfig>

Returns

void