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

AxSignature

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2134

Type Parameters

Type ParameterDefault type
_TInput extends Record<string, any>Record<string, any>
_TOutput extends Record<string, any>Record<string, any>

Methods

addInputField()

TypeScript
addInputField(field: Readonly<AxField>): void;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2324

Parameters

ParameterType
fieldReadonly<AxField>

Returns

void


addOutputField()

TypeScript
addOutputField(field: Readonly<AxField>): void;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2365

Parameters

ParameterType
fieldReadonly<AxField>

Returns

void


appendInputField()

TypeScript
appendInputField<K, T>(name: K, fieldType: T): AxSignature<_TInput & AddedFieldShape<K, T, "input">, _TOutput>;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2470

Type Parameters

Type Parameter
K extends string
T extends AxFieldType

Parameters

ParameterType
nameK
fieldTypeT

Returns

AxSignature<_TInput & AddedFieldShape<K, T, "input">, _TOutput>


appendOutputField()

TypeScript
appendOutputField<K, T>(name: K, fieldType: T): AxSignature<_TInput, _TOutput & AddedFieldShape<K, T, "output">>;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2532

Type Parameters

Type Parameter
K extends string
T extends AxFieldType

Parameters

ParameterType
nameK
fieldTypeT

Returns

AxSignature<_TInput, _TOutput & AddedFieldShape<K, T, "output">>


getDescription()

TypeScript
getDescription(): undefined | string;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2464

Returns

undefined | string


getInputFields()

TypeScript
getInputFields(): readonly AxIField[];

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2462

Returns

readonly AxIField[]


getOutputFields()

TypeScript
getOutputFields(): readonly AxIField[];

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2463

Returns

readonly AxIField[]


hasComplexFields()

TypeScript
hasComplexFields(): boolean;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2732

Returns

boolean


hash()

TypeScript
hash(): string;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2775

Returns

string


prependInputField()

TypeScript
prependInputField<K, T>(name: K, fieldType: T): AxSignature<AddedFieldShape<K, T, "input"> & _TInput, _TOutput>;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2485

Type Parameters

Type Parameter
K extends string
T extends AxFieldType

Parameters

ParameterType
nameK
fieldTypeT

Returns

AxSignature<AddedFieldShape<K, T, "input"> & _TInput, _TOutput>


prependOutputField()

TypeScript
prependOutputField<K, T>(name: K, fieldType: T): AxSignature<_TInput, AddedFieldShape<K, T, "output"> & _TOutput>;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2547

Type Parameters

Type Parameter
K extends string
T extends AxFieldType

Parameters

ParameterType
nameK
fieldTypeT

Returns

AxSignature<_TInput, AddedFieldShape<K, T, "output"> & _TOutput>


setDescription()

TypeScript
setDescription(desc: string): void;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2311

Parameters

ParameterType
descstring

Returns

void


setInputFields()

TypeScript
setInputFields(fields: readonly AxField[]): void;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2406

Parameters

ParameterType
fieldsreadonly AxField[]

Returns

void


setOutputFields()

TypeScript
setOutputFields(fields: readonly AxField[]): void;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2434

Parameters

ParameterType
fieldsreadonly AxField[]

Returns

void


toInputJSONSchema()

TypeScript
toInputJSONSchema(): AxFunctionJSONSchema;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2794

Returns

AxFunctionJSONSchema


toJSON()

TypeScript
toJSON(): object;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2779

Returns

object

NameType
descriptionundefined | string
idstring
inputFieldsAxIField[]
outputFieldsAxIField[]

toJSONSchema()

TypeScript
toJSONSchema(): AxFunctionJSONSchema;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2788

Returns

AxFunctionJSONSchema


toString()

TypeScript
toString(): string;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2777

Returns

string


validate()

TypeScript
validate(): boolean;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2754

Returns

boolean


create()

TypeScript
static create<T>(signature: T): AxSignature<ParseSignature<T>["inputs"], ParseSignature<T>["outputs"]>;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2251

Static factory method for type inference. Creates a typed AxSignature instance from a signature string.

Type Parameters

Type Parameter
T extends string

Parameters

ParameterType
signatureT

Returns

AxSignature<ParseSignature<T>["inputs"], ParseSignature<T>["outputs"]>


empty()

TypeScript
static empty(): AxSignature;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2267

Returns

AxSignature


from()

TypeScript
static from<TInput, TOutput>(signature?: AxSignatureInput): AxSignature<TInput, TOutput>;

Defined in: https://github.com/ax-llm/ax/blob/e690b4823b8309e258594064abe941d4cff6ef89/src/ax/dsp/sig.ts#L2260

Type Parameters

Type ParameterDefault type
TInput extends Record<string, any>Record<string, any>
TOutput extends Record<string, any>Record<string, any>

Parameters

ParameterType
signature?AxSignatureInput

Returns

AxSignature<TInput, TOutput>

Docs