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

AxProgrammable

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L310

Extends

Extended by

Type Parameters

Type ParameterDefault type
IN-
OUT-
TModelKeystring

Methods

applyOptimization()

applyOptimization(optimizedProgram: AxOptimizedProgram<OUT>): void;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L302

Parameters

ParameterType
optimizedProgramAxOptimizedProgram<OUT>

Returns

void

Inherited from

AxTunable.applyOptimization


forward()

forward(
   ai: Readonly<AxAIService>, 
   values: IN | AxMessage<IN>[], 
options?: Readonly<AxProgramForwardOptions<TModelKey>>): Promise<OUT>;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L281

Parameters

ParameterType
aiReadonly<AxAIService>
valuesIN | AxMessage<IN>[]
options?Readonly<AxProgramForwardOptions<TModelKey>>

Returns

Promise<OUT>

Inherited from

AxForwardable.forward


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L295

Returns

string

Inherited from

AxTunable.getId


getSignature()

getSignature(): AxSignature;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L314

Returns

AxSignature


getTraces()

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

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L297

Returns

AxProgramTrace<IN, OUT>[]

Inherited from

AxTunable.getTraces


getUsage()

getUsage(): AxModelUsage & object[];

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L306

Returns

AxModelUsage & object[]

Inherited from

AxUsable.getUsage


resetUsage()

resetUsage(): void;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L307

Returns

void

Inherited from

AxUsable.resetUsage


setDemos()

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

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L298

Parameters

ParameterType
demosreadonly AxProgramDemos<IN, OUT, string>[]
options?{ modelConfig?: Record<string, unknown>; }
options.modelConfig?Record<string, unknown>

Returns

void

Inherited from

AxTunable.setDemos


setId()

setId(id: string): void;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L296

Parameters

ParameterType
idstring

Returns

void

Inherited from

AxTunable.setId


streamingForward()

streamingForward(
   ai: Readonly<AxAIService>, 
   values: IN | AxMessage<IN>[], 
options?: Readonly<AxProgramStreamingForwardOptions<TModelKey>>): AxGenStreamingOut<OUT>;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/dsp/types.ts#L287

Parameters

ParameterType
aiReadonly<AxAIService>
valuesIN | AxMessage<IN>[]
options?Readonly<AxProgramStreamingForwardOptions<TModelKey>>

Returns

AxGenStreamingOut<OUT>

Inherited from

AxForwardable.streamingForward