AxSignature
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L554
Type Parameters
| Type Parameter | Default type |
|---|---|
_TInput extends Record<string, any> | Record<string, any> |
_TOutput extends Record<string, any> | Record<string, any> |
Constructors
Constructor
new AxSignature<_TInput, _TOutput>(signature?: Readonly<
| string
| AxSignatureConfig
| AxSignature<Record<string, any>, Record<string, any>>>): AxSignature<_TInput, _TOutput>;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L583
Deprecated
Use AxSignature.create() for better type safety instead of the constructor.
This constructor will be removed in v15.0.0.
Migration timeline:
- v13.0.24+: Deprecation warnings (current)
- v14.0.0: Runtime console warnings
- v15.0.0: Complete removal
Example
// Instead of: new AxSignature('userInput:string -> responseText:string')
// Use: AxSignature.create('userInput:string -> responseText:string')
Parameters
| Parameter | Type |
|---|---|
signature? | Readonly< | string | AxSignatureConfig | AxSignature<Record<string, any>, Record<string, any>>> |
Returns
AxSignature<_TInput, _TOutput>
Methods
addInputField()
addInputField(field: Readonly<AxField>): void;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L744
Parameters
| Parameter | Type |
|---|---|
field | Readonly<AxField> |
Returns
void
addOutputField()
addOutputField(field: Readonly<AxField>): void;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L785
Parameters
| Parameter | Type |
|---|---|
field | Readonly<AxField> |
Returns
void
appendInputField()
appendInputField<K, T>(name: K, fieldType: T): AxSignature<_TInput & Record<K, InferFieldValueType<T>>, _TOutput>;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L887
Type Parameters
| Type Parameter |
|---|
K extends string |
T extends AxFieldType |
Parameters
| Parameter | Type |
|---|---|
name | K |
fieldType | T |
Returns
AxSignature<_TInput & Record<K, InferFieldValueType<T>>, _TOutput>
appendOutputField()
appendOutputField<K, T>(name: K, fieldType: T): AxSignature<_TInput, _TOutput & Record<K, InferFieldValueType<T>>>;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L949
Type Parameters
| Type Parameter |
|---|
K extends string |
T extends AxFieldType |
Parameters
| Parameter | Type |
|---|---|
name | K |
fieldType | T |
Returns
AxSignature<_TInput, _TOutput & Record<K, InferFieldValueType<T>>>
getDescription()
getDescription(): undefined | string;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L884
Returns
undefined | string
getInputFields()
getInputFields(): readonly AxIField[];
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L882
Returns
readonly AxIField[]
getOutputFields()
getOutputFields(): readonly AxIField[];
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L883
Returns
readonly AxIField[]
hash()
hash(): string;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L1196
Returns
string
prependInputField()
prependInputField<K, T>(name: K, fieldType: T): AxSignature<Record<K, InferFieldValueType<T>> & _TInput, _TOutput>;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L902
Type Parameters
| Type Parameter |
|---|
K extends string |
T extends AxFieldType |
Parameters
| Parameter | Type |
|---|---|
name | K |
fieldType | T |
Returns
AxSignature<Record<K, InferFieldValueType<T>> & _TInput, _TOutput>
prependOutputField()
prependOutputField<K, T>(name: K, fieldType: T): AxSignature<_TInput, Record<K, InferFieldValueType<T>> & _TOutput>;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L964
Type Parameters
| Type Parameter |
|---|
K extends string |
T extends AxFieldType |
Parameters
| Parameter | Type |
|---|---|
name | K |
fieldType | T |
Returns
AxSignature<_TInput, Record<K, InferFieldValueType<T>> & _TOutput>
setDescription()
setDescription(desc: string): void;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L731
Parameters
| Parameter | Type |
|---|---|
desc | string |
Returns
void
setInputFields()
setInputFields(fields: readonly AxField[]): void;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L826
Parameters
| Parameter | Type |
|---|---|
fields | readonly AxField[] |
Returns
void
setOutputFields()
setOutputFields(fields: readonly AxField[]): void;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L854
Parameters
| Parameter | Type |
|---|---|
fields | readonly AxField[] |
Returns
void
toJSON()
toJSON(): object;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L1200
Returns
object
| Name | Type |
|---|---|
description | undefined | string |
id | string |
inputFields | AxIField[] |
outputFields | AxIField[] |
toJSONSchema()
toJSONSchema(): AxFunctionJSONSchema;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L1021
Returns
toString()
toString(): string;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L1198
Returns
string
validate()
validate(): boolean;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L1175
Returns
boolean
create()
static create<T>(signature: T): AxSignature<ParseSignature<T>["inputs"], ParseSignature<T>["outputs"]>;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/sig.ts#L683
Static factory method for type inference. Creates a typed AxSignature instance from a signature string.
Type Parameters
| Type Parameter |
|---|
T extends string |
Parameters
| Parameter | Type |
|---|---|
signature | T |
Returns
AxSignature<ParseSignature<T>["inputs"], ParseSignature<T>["outputs"]>