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

AxSimpleClassifier

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

Constructors

Constructor

new AxSimpleClassifier(ai: AxAIService): AxSimpleClassifier;

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

Parameters

ParameterType
aiAxAIService

Returns

AxSimpleClassifier

Methods

forward()

forward(text: string, options?: Readonly<AxSimpleClassifierForwardOptions>): Promise<string>;

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

Parameters

ParameterType
textstring
options?Readonly<AxSimpleClassifierForwardOptions>

Returns

Promise<string>


getState()

getState(): undefined | AxDBState;

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

Returns

undefined | AxDBState


setClasses()

setClasses(classes: readonly AxSimpleClassifierClass[], options?: Readonly<{
  abortSignal?: AbortSignal;
}>): Promise<void>;

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

Parameters

ParameterType
classesreadonly AxSimpleClassifierClass[]
options?Readonly<{ abortSignal?: AbortSignal; }>

Returns

Promise<void>


setOptions()

setOptions(options: Readonly<{
  debug?: boolean;
}>): void;

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

Parameters

ParameterType
optionsReadonly<{ debug?: boolean; }>

Returns

void


setState()

setState(state: AxDBState): void;

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

Parameters

ParameterType
stateAxDBState

Returns

void