AxSynth
Defined in: https://github.com/ax-llm/ax/blob/242cf18d21de9f9d58c7c82f53305f0605497473/src/ax/dsp/synth.ts#L118
AxSynth generates synthetic training data.
Example
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
new AxSynth<IN, OUT>(signature: AxSignature<IN, OUT>, options: AxSynthOptions): AxSynth<IN, OUT>;
Defined in: https://github.com/ax-llm/ax/blob/242cf18d21de9f9d58c7c82f53305f0605497473/src/ax/dsp/synth.ts#L125
Parameters
| Parameter | Type |
|---|---|
signature | AxSignature<IN, OUT> |
options | AxSynthOptions |
Returns
AxSynth<IN, OUT>
Methods
generate()
generate(count: number, options?: object): Promise<AxSynthResult>;
Defined in: https://github.com/ax-llm/ax/blob/242cf18d21de9f9d58c7c82f53305f0605497473/src/ax/dsp/synth.ts#L140
Generate synthetic examples.
Parameters
| Parameter | Type |
|---|---|
count | number |
options? | { batchSize?: number; } |
options.batchSize? | number |
Returns
Promise<AxSynthResult>
getSignature()
getSignature(): AxSignature<IN, OUT>;
Defined in: https://github.com/ax-llm/ax/blob/242cf18d21de9f9d58c7c82f53305f0605497473/src/ax/dsp/synth.ts#L326
Get the signature being used.
Returns
AxSignature<IN, OUT>
getTeacher()
getTeacher(): AxAIService;
Defined in: https://github.com/ax-llm/ax/blob/242cf18d21de9f9d58c7c82f53305f0605497473/src/ax/dsp/synth.ts#L333
Get the teacher AI service.