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/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/dsp/sig.ts#L2086

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/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/dsp/sig.ts#L2276

Parameters

ParameterType
fieldReadonly<AxField>

Returns

void


addOutputField()

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

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

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/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/dsp/sig.ts#L2422

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/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/dsp/sig.ts#L2484

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/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/dsp/sig.ts#L2416

Returns

undefined | string


getInputFields()

TypeScript
getInputFields(): readonly AxIField[];

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

Returns

readonly AxIField[]


getOutputFields()

TypeScript
getOutputFields(): readonly AxIField[];

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

Returns

readonly AxIField[]


hasComplexFields()

TypeScript
hasComplexFields(): boolean;

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

Returns

boolean


hash()

TypeScript
hash(): string;

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

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/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/dsp/sig.ts#L2437

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/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/dsp/sig.ts#L2499

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/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/dsp/sig.ts#L2263

Parameters

ParameterType
descstring

Returns

void


setInputFields()

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

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

Parameters

ParameterType
fieldsreadonly AxField[]

Returns

void


setOutputFields()

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

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

Parameters

ParameterType
fieldsreadonly AxField[]

Returns

void


toInputJSONSchema()

TypeScript
toInputJSONSchema(): AxFunctionJSONSchema;

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

Returns

AxFunctionJSONSchema


toJSON()

TypeScript
toJSON(): object;

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

Returns

object

NameType
descriptionundefined | string
idstring
inputFieldsAxIField[]
outputFieldsAxIField[]

toJSONSchema()

TypeScript
toJSONSchema(): AxFunctionJSONSchema;

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

Returns

AxFunctionJSONSchema


toString()

TypeScript
toString(): string;

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

Returns

string


validate()

TypeScript
validate(): boolean;

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

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/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/dsp/sig.ts#L2203

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/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/dsp/sig.ts#L2219

Returns

AxSignature


from()

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

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

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