AxSynth Generated TypeScript API reference. typescript api api/reference build/apidocs/Class.AxSynth.md class AxSynth

AxSynth

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/synth.ts#L118

AxSynth generates synthetic training data.

Example

TypeScript
const synth = new AxSynth(signature, {
  teacher: ai('openai', { model: 'gpt-4o' }),
  domain: 'customer support',
  edgeCases: ['angry customers', 'vague requests'],
});

const { examples } = await synth.generate(100);

Type Parameters

Type Parameter
IN extends AxGenIn
OUT extends AxGenOut

Constructors

Constructor

TypeScript
new AxSynth<IN, OUT>(signature: AxSignature<IN, OUT>, options: AxSynthOptions): AxSynth<IN, OUT>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/synth.ts#L125

Parameters

ParameterType
signatureAxSignature<IN, OUT>
optionsAxSynthOptions

Returns

AxSynth<IN, OUT>

Methods

generate()

TypeScript
generate(count: number, options?: object): Promise<AxSynthResult>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/synth.ts#L140

Generate synthetic examples.

Parameters

ParameterType
countnumber
options?{ batchSize?: number; }
options.batchSize?number

Returns

Promise<AxSynthResult>


getSignature()

TypeScript
getSignature(): AxSignature<IN, OUT>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/synth.ts#L326

Get the signature being used.

Returns

AxSignature<IN, OUT>


getTeacher()

TypeScript
getTeacher(): AxAIService;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/synth.ts#L333

Get the teacher AI service.

Returns

AxAIService

Docs