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

AxFluentFieldType

Defined in: https://github.com/ax-llm/ax/blob/3d5aa8dac28a2637e4150f022dcd02e6fc3309f0/src/ax/dsp/sig.ts#L300

Type Parameters

Type ParameterDefault type
TType extends AxFieldType["type"]AxFieldType["type"]
TIsArray extends booleanfalse
TOptions extends readonly string[] | undefinedundefined
TIsOptional extends booleanfalse
TIsInternal extends booleanfalse
TFields extends | Record<string, | AxFluentFieldInfo | AxFluentFieldType> | undefinedundefined
TIsCached extends booleanfalse
TEvidence extends AxEvidenceOptions | undefinedAxEvidenceOptions | undefined

Implements

Constructors

Constructor

TypeScript
new AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>(fieldType: object): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>;

Defined in: https://github.com/ax-llm/ax/blob/3d5aa8dac28a2637e4150f022dcd02e6fc3309f0/src/ax/dsp/sig.ts#L335

Parameters

ParameterType
fieldType{ description?: string; evidence?: TEvidence; fields?: TFields; format?: string; isArray: TIsArray; isCached: TIsCached; isInternal: TIsInternal; isOptional: TIsOptional; itemDescription?: string; language?: string; maximum?: number; maxLength?: number; minimum?: number; minLength?: number; options?: TOptions; pattern?: string; patternDescription?: string; type: TType; valueDescriptions?: Readonly<Record<string, string>>; }
fieldType.description?string
fieldType.evidence?TEvidence
fieldType.fields?TFields
fieldType.format?string
fieldType.isArrayTIsArray
fieldType.isCachedTIsCached
fieldType.isInternalTIsInternal
fieldType.isOptionalTIsOptional
fieldType.itemDescription?string
fieldType.language?string
fieldType.maximum?number
fieldType.maxLength?number
fieldType.minimum?number
fieldType.minLength?number
fieldType.options?TOptions
fieldType.pattern?string
fieldType.patternDescription?string
fieldType.typeTType
fieldType.valueDescriptions?Readonly<Record<string, string>>

Returns

AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>

Properties

PropertyModifierType
description?readonlystring
evidencereadonlyTEvidence
fields?readonlyany
format?readonlystring
isArrayreadonlyTIsArray
isCachedreadonlyTIsCached
isInternalreadonlyTIsInternal
isOptionalreadonlyTIsOptional
itemDescription?readonlystring
language?readonlystring
maximum?readonlynumber
maxLength?readonlynumber
minimum?readonlynumber
minLength?readonlynumber
options?readonlyTOptions
pattern?readonlystring
patternDescription?readonlystring
typereadonlyTType
valueDescriptions?readonlyReadonly<Record<string, string>>

Accessors

~standard

Get Signature

TypeScript
get ~standard(): Props<unknown, unknown>;

Defined in: https://github.com/ax-llm/ax/blob/3d5aa8dac28a2637e4150f022dcd02e6fc3309f0/src/ax/dsp/sig.ts#L713

Standard Schema v1 surface — lets ax fields flow through any library that accepts StandardSchemaV1 (tRPC, TanStack Form, Vercel AI SDK, etc.).

Returns

Props<unknown, unknown>

Methods

array()

TypeScript
array(desc?: string): AxFluentFieldType<TType, true, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>;

Defined in: https://github.com/ax-llm/ax/blob/3d5aa8dac28a2637e4150f022dcd02e6fc3309f0/src/ax/dsp/sig.ts#L478

Parameters

ParameterType
desc?string

Returns

AxFluentFieldType<TType, true, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>


cache()

TypeScript
cache(): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, true, TEvidence>;

Defined in: https://github.com/ax-llm/ax/blob/3d5aa8dac28a2637e4150f022dcd02e6fc3309f0/src/ax/dsp/sig.ts#L519

Mark this input field for caching. When contextCache is enabled, cached fields are rendered in a separate user message with cache: true, allowing them to be cached by the LLM provider.

Returns

AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, true, TEvidence>


date()

TypeScript
date(): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>;

Defined in: https://github.com/ax-llm/ax/blob/3d5aa8dac28a2637e4150f022dcd02e6fc3309f0/src/ax/dsp/sig.ts#L668

Set date format validation for strings

Returns

AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>


datetime()

TypeScript
datetime(): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>;

Defined in: https://github.com/ax-llm/ax/blob/3d5aa8dac28a2637e4150f022dcd02e6fc3309f0/src/ax/dsp/sig.ts#L690

Set datetime format validation for strings

Returns

AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>


describeValues()

TypeScript
describeValues<D>(descriptions: D & Record<Exclude<keyof D, TType extends "boolean" ? "true" | "false" : TType extends "class" ? NonNullable<TOptions>[number] : never>, never>): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>;

Defined in: https://github.com/ax-llm/ax/blob/3d5aa8dac28a2637e4150f022dcd02e6fc3309f0/src/ax/dsp/sig.ts#L380

Describe individual boolean outcomes or class labels without changing their value types.

Type Parameters

Type Parameter
D extends Readonly<Record<string, string>>

Parameters

ParameterType
descriptionsD & Record<Exclude<keyof D, TType extends "boolean" ? "true" | "false" : TType extends "class" ? NonNullable<TOptions>[number] : never>, never>

Returns

AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>


email()

TypeScript
email(): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>;

Defined in: https://github.com/ax-llm/ax/blob/3d5aa8dac28a2637e4150f022dcd02e6fc3309f0/src/ax/dsp/sig.ts#L596

Set email format validation for strings

Returns

AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>


internal()

TypeScript
internal(): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, true, TFields, TIsCached, TEvidence>;

Defined in: https://github.com/ax-llm/ax/blob/3d5aa8dac28a2637e4150f022dcd02e6fc3309f0/src/ax/dsp/sig.ts#L498

Returns

AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, true, TFields, TIsCached, TEvidence>


max()

TypeScript
max(value: number): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>;

Defined in: https://github.com/ax-llm/ax/blob/3d5aa8dac28a2637e4150f022dcd02e6fc3309f0/src/ax/dsp/sig.ts#L567

Set maximum value for numbers or maximum length for strings

Parameters

ParameterType
valuenumber

Returns

AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>


min()

TypeScript
min(value: number): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>;

Defined in: https://github.com/ax-llm/ax/blob/3d5aa8dac28a2637e4150f022dcd02e6fc3309f0/src/ax/dsp/sig.ts#L538

Set minimum value for numbers or minimum length for strings

Parameters

ParameterType
valuenumber

Returns

AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>


optional()

TypeScript
optional(): AxFluentFieldType<TType, TIsArray, TOptions, true, TIsInternal, TFields, TIsCached, TEvidence>;

Defined in: https://github.com/ax-llm/ax/blob/3d5aa8dac28a2637e4150f022dcd02e6fc3309f0/src/ax/dsp/sig.ts#L462

Returns

AxFluentFieldType<TType, TIsArray, TOptions, true, TIsInternal, TFields, TIsCached, TEvidence>


regex()

TypeScript
regex(pattern: string, description: string): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>;

Defined in: https://github.com/ax-llm/ax/blob/3d5aa8dac28a2637e4150f022dcd02e6fc3309f0/src/ax/dsp/sig.ts#L642

Set regex pattern validation for strings

Parameters

ParameterTypeDescription
patternstringRegular expression pattern to match
descriptionstringHuman-readable description of what the pattern validates (e.g., “Must be a valid username with only lowercase letters, numbers, and underscores”)

Returns

AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>


url()

TypeScript
url(): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>;

Defined in: https://github.com/ax-llm/ax/blob/3d5aa8dac28a2637e4150f022dcd02e6fc3309f0/src/ax/dsp/sig.ts#L618

Set URL/URI format validation for strings

Returns

AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence>


withEvidence()

TypeScript
withEvidence<E>(this: TType extends "boolean" | "class" | "score" ? AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence> : never, options?: E): AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, E>;

Defined in: https://github.com/ax-llm/ax/blob/3d5aa8dac28a2637e4150f022dcd02e6fc3309f0/src/ax/dsp/sig.ts#L407

Type Parameters

Type ParameterDefault type
E extends | AxEvidenceOptions | Omit<AxEvidenceOptions, "threshold"> & objectobject

Parameters

ParameterType
thisTType extends "boolean" | "class" | "score" ? AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, TEvidence> : never
options?E

Returns

AxFluentFieldType<TType, TIsArray, TOptions, TIsOptional, TIsInternal, TFields, TIsCached, E>

Docs