Documentation

Build LLM-powered agents
with production-ready TypeScript

DSPy for TypeScript. Working with LLMs is complex—they don't always do what you want. DSPy makes it easier to build amazing things with LLMs. Just define your inputs and outputs (signature) and an efficient prompt is auto-generated and used. Connect together various signatures to build complex systems and workflows using LLMs.

15+ LLM Providers
End-to-end Streaming
Auto Prompt Tuning

AxFluentFieldType

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

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

Implements

Constructors

Constructor

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

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

Parameters

ParameterType
fieldType{ description?: string; fields?: TFields; format?: string; isArray: TIsArray; isInternal: TIsInternal; isOptional: TIsOptional; maximum?: number; maxLength?: number; minimum?: number; minLength?: number; options?: TOptions; pattern?: string; patternDescription?: string; type: TType; }
fieldType.description?string
fieldType.fields?TFields
fieldType.format?string
fieldType.isArrayTIsArray
fieldType.isInternalTIsInternal
fieldType.isOptionalTIsOptional
fieldType.maximum?number
fieldType.maxLength?number
fieldType.minimum?number
fieldType.minLength?number
fieldType.options?TOptions
fieldType.pattern?string
fieldType.patternDescription?string
fieldType.typeTType

Returns

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

Properties

PropertyModifierType
description?readonlystring
fields?readonlyany
format?readonlystring
isArrayreadonlyTIsArray
isInternalreadonlyTIsInternal
isOptionalreadonlyTIsOptional
maximum?readonlynumber
maxLength?readonlynumber
minimum?readonlynumber
minLength?readonlynumber
options?readonlyTOptions
pattern?readonlystring
patternDescription?readonlystring
typereadonlyTType

Methods

array()

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

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

Parameters

ParameterType
desc?string

Returns

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


date()

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

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

Set date format validation for strings

Returns

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


datetime()

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

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

Set datetime format validation for strings

Returns

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


email()

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

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

Set email format validation for strings

Returns

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


internal()

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

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

Returns

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


max()

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

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

Set maximum value for numbers or maximum length for strings

Parameters

ParameterType
valuenumber

Returns

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


min()

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

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

Set minimum value for numbers or minimum length for strings

Parameters

ParameterType
valuenumber

Returns

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


optional()

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

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

Returns

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


regex()

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

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

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>


url()

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

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

Set URL/URI format validation for strings

Returns

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