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

AxAI

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L86

Implements

Constructors

Constructor

new AxAI(options: Readonly<AxAIArgs>): AxAI;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L89

Parameters

ParameterType
optionsReadonly<AxAIArgs>

Returns

AxAI

Methods

chat()

chat(req: Readonly<AxChatRequest>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L167

Parameters

ParameterType
reqReadonly<AxChatRequest>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Implementation of

AxAIService.chat


embed()

embed(req: Readonly<AxEmbedRequest>, options?: Readonly<AxAIServiceActionOptions>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L174

Parameters

ParameterType
reqReadonly<AxEmbedRequest>
options?Readonly<AxAIServiceActionOptions>

Returns

Promise<AxEmbedResponse>

Implementation of

AxAIService.embed


getFeatures()

getFeatures(model?: string): object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L143

Parameters

ParameterType
model?string

Returns

object

NameType
functionsboolean
streamingboolean

Implementation of

AxAIService.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L139

Returns

string

Implementation of

AxAIService.getId


getLastUsedChatModel()

getLastUsedChatModel(): unknown;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L151

Returns

unknown

Implementation of

AxAIService.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): unknown;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L155

Returns

unknown

Implementation of

AxAIService.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L159

Returns

undefined | AxModelConfig

Implementation of

AxAIService.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L189

Returns

AxLoggerFunction

Implementation of

AxAIService.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L163

Returns

AxAIServiceMetrics

Implementation of

AxAIService.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L147

Returns

undefined | AxAIModelList

Implementation of

AxAIService.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L135

Returns

string

Implementation of

AxAIService.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L185

Returns

Readonly<AxAIServiceOptions>

Implementation of

AxAIService.getOptions


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L181

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Implementation of

AxAIService.setOptions

AxAIAnthropic

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/api.ts#L509

Extends

Constructors

Constructor

new AxAIAnthropic(__namedParameters: Readonly<Omit<AxAIAnthropicArgs, "name">>): AxAIAnthropic;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/api.ts#L518

Parameters

ParameterType
__namedParametersReadonly<Omit<AxAIAnthropicArgs, "name">>

Returns

AxAIAnthropic

Overrides

AxBaseAI.constructor

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<
  | AxAIAnthropicModel
  | AxAIAnthropicVertexModel, unknown>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L326

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions< | AxAIAnthropicModel | AxAIAnthropicVertexModel, unknown>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxBaseAI.chat


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<
  | AxAIAnthropicModel
| AxAIAnthropicVertexModel, unknown>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L625

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions< | AxAIAnthropicModel | AxAIAnthropicVertexModel, unknown>>

Returns

Promise<AxEmbedResponse>

Inherited from

AxBaseAI.embed


getFeatures()

getFeatures(model?: 
  | AxAIAnthropicModel
  | AxAIAnthropicVertexModel): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L265

Parameters

ParameterType
model?| AxAIAnthropicModel | AxAIAnthropicVertexModel

Returns

AxAIFeatures

Inherited from

AxBaseAI.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L194

Returns

string

Inherited from

AxBaseAI.getId


getLastUsedChatModel()

getLastUsedChatModel(): 
  | undefined
  | AxAIAnthropicModel
  | AxAIAnthropicVertexModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L271

Returns

| undefined | AxAIAnthropicModel | AxAIAnthropicVertexModel

Inherited from

AxBaseAI.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): unknown;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L275

Returns

unknown

Inherited from

AxBaseAI.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L279

Returns

undefined | AxModelConfig

Inherited from

AxBaseAI.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L230

Returns

AxLoggerFunction

Inherited from

AxBaseAI.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L322

Returns

AxAIServiceMetrics

Inherited from

AxBaseAI.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L234

Returns

undefined | AxAIModelList

Inherited from

AxBaseAI.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L261

Returns

string

Inherited from

AxBaseAI.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L217

Returns

Readonly<AxAIServiceOptions>

Inherited from

AxBaseAI.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L198

Parameters

ParameterType
apiURLstring

Returns

void

Inherited from

AxBaseAI.setAPIURL


setHeaders()

setHeaders(headers: () => Promise<Record<string, string>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L202

Parameters

ParameterType
headers() => Promise<Record<string, string>>

Returns

void

Inherited from

AxBaseAI.setHeaders


setName()

setName(name: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L190

Parameters

ParameterType
namestring

Returns

void

Inherited from

AxBaseAI.setName


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L206

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Inherited from

AxBaseAI.setOptions

AxAIAzureOpenAI

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/azure-openai/api.ts#L40

Extends

Constructors

Constructor

new AxAIAzureOpenAI(__namedParameters: Readonly<Omit<AxAIAzureOpenAIArgs, "name">>): AxAIAzureOpenAI;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/azure-openai/api.ts#L44

Parameters

ParameterType
__namedParametersReadonly<Omit<AxAIAzureOpenAIArgs, "name">>

Returns

AxAIAzureOpenAI

Overrides

AxAIOpenAIBase.constructor

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIOpenAIModel, AxAIOpenAIEmbedModel>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L326

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIOpenAIModel, AxAIOpenAIEmbedModel>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxAIOpenAIBase.chat


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<AxAIOpenAIModel, AxAIOpenAIEmbedModel>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L625

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions<AxAIOpenAIModel, AxAIOpenAIEmbedModel>>

Returns

Promise<AxEmbedResponse>

Inherited from

AxAIOpenAIBase.embed


getFeatures()

getFeatures(model?: AxAIOpenAIModel): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L265

Parameters

ParameterType
model?AxAIOpenAIModel

Returns

AxAIFeatures

Inherited from

AxAIOpenAIBase.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L194

Returns

string

Inherited from

AxAIOpenAIBase.getId


getLastUsedChatModel()

getLastUsedChatModel(): undefined | AxAIOpenAIModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L271

Returns

undefined | AxAIOpenAIModel

Inherited from

AxAIOpenAIBase.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): 
  | undefined
  | AxAIOpenAIEmbedModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L275

Returns

| undefined | AxAIOpenAIEmbedModel

Inherited from

AxAIOpenAIBase.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L279

Returns

undefined | AxModelConfig

Inherited from

AxAIOpenAIBase.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L230

Returns

AxLoggerFunction

Inherited from

AxAIOpenAIBase.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L322

Returns

AxAIServiceMetrics

Inherited from

AxAIOpenAIBase.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L234

Returns

undefined | AxAIModelList

Inherited from

AxAIOpenAIBase.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L261

Returns

string

Inherited from

AxAIOpenAIBase.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L217

Returns

Readonly<AxAIServiceOptions>

Inherited from

AxAIOpenAIBase.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L198

Parameters

ParameterType
apiURLstring

Returns

void

Inherited from

AxAIOpenAIBase.setAPIURL


setHeaders()

setHeaders(headers: () => Promise<Record<string, string>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L202

Parameters

ParameterType
headers() => Promise<Record<string, string>>

Returns

void

Inherited from

AxAIOpenAIBase.setHeaders


setName()

setName(name: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L190

Parameters

ParameterType
namestring

Returns

void

Inherited from

AxAIOpenAIBase.setName


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L206

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Inherited from

AxAIOpenAIBase.setOptions

AxAICohere

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/api.ts#L299

Extends

Constructors

Constructor

new AxAICohere(__namedParameters: Readonly<Omit<AxAICohereArgs, "name">>): AxAICohere;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/api.ts#L308

Parameters

ParameterType
__namedParametersReadonly<Omit<AxAICohereArgs, "name">>

Returns

AxAICohere

Overrides

AxBaseAI.constructor

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAICohereModel, AxAICohereEmbedModel>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L326

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAICohereModel, AxAICohereEmbedModel>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxBaseAI.chat


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<AxAICohereModel, AxAICohereEmbedModel>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L625

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions<AxAICohereModel, AxAICohereEmbedModel>>

Returns

Promise<AxEmbedResponse>

Inherited from

AxBaseAI.embed


getFeatures()

getFeatures(model?: AxAICohereModel): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L265

Parameters

ParameterType
model?AxAICohereModel

Returns

AxAIFeatures

Inherited from

AxBaseAI.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L194

Returns

string

Inherited from

AxBaseAI.getId


getLastUsedChatModel()

getLastUsedChatModel(): undefined | AxAICohereModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L271

Returns

undefined | AxAICohereModel

Inherited from

AxBaseAI.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): 
  | undefined
  | AxAICohereEmbedModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L275

Returns

| undefined | AxAICohereEmbedModel

Inherited from

AxBaseAI.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L279

Returns

undefined | AxModelConfig

Inherited from

AxBaseAI.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L230

Returns

AxLoggerFunction

Inherited from

AxBaseAI.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L322

Returns

AxAIServiceMetrics

Inherited from

AxBaseAI.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L234

Returns

undefined | AxAIModelList

Inherited from

AxBaseAI.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L261

Returns

string

Inherited from

AxBaseAI.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L217

Returns

Readonly<AxAIServiceOptions>

Inherited from

AxBaseAI.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L198

Parameters

ParameterType
apiURLstring

Returns

void

Inherited from

AxBaseAI.setAPIURL


setHeaders()

setHeaders(headers: () => Promise<Record<string, string>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L202

Parameters

ParameterType
headers() => Promise<Record<string, string>>

Returns

void

Inherited from

AxBaseAI.setHeaders


setName()

setName(name: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L190

Parameters

ParameterType
namestring

Returns

void

Inherited from

AxBaseAI.setName


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L206

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Inherited from

AxBaseAI.setOptions

AxAIDeepSeek

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/deepseek/api.ts#L31

Extends

Constructors

Constructor

new AxAIDeepSeek(__namedParameters: Readonly<Omit<AxAIDeepSeekArgs, "name">>): AxAIDeepSeek;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/deepseek/api.ts#L32

Parameters

ParameterType
__namedParametersReadonly<Omit<AxAIDeepSeekArgs, "name">>

Returns

AxAIDeepSeek

Overrides

AxAIOpenAIBase.constructor

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIDeepSeekModel, undefined>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L326

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIDeepSeekModel, undefined>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxAIOpenAIBase.chat


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<AxAIDeepSeekModel, undefined>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L625

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions<AxAIDeepSeekModel, undefined>>

Returns

Promise<AxEmbedResponse>

Inherited from

AxAIOpenAIBase.embed


getFeatures()

getFeatures(model?: AxAIDeepSeekModel): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L265

Parameters

ParameterType
model?AxAIDeepSeekModel

Returns

AxAIFeatures

Inherited from

AxAIOpenAIBase.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L194

Returns

string

Inherited from

AxAIOpenAIBase.getId


getLastUsedChatModel()

getLastUsedChatModel(): undefined | AxAIDeepSeekModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L271

Returns

undefined | AxAIDeepSeekModel

Inherited from

AxAIOpenAIBase.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): undefined;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L275

Returns

undefined

Inherited from

AxAIOpenAIBase.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L279

Returns

undefined | AxModelConfig

Inherited from

AxAIOpenAIBase.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L230

Returns

AxLoggerFunction

Inherited from

AxAIOpenAIBase.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L322

Returns

AxAIServiceMetrics

Inherited from

AxAIOpenAIBase.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L234

Returns

undefined | AxAIModelList

Inherited from

AxAIOpenAIBase.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L261

Returns

string

Inherited from

AxAIOpenAIBase.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L217

Returns

Readonly<AxAIServiceOptions>

Inherited from

AxAIOpenAIBase.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L198

Parameters

ParameterType
apiURLstring

Returns

void

Inherited from

AxAIOpenAIBase.setAPIURL


setHeaders()

setHeaders(headers: () => Promise<Record<string, string>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L202

Parameters

ParameterType
headers() => Promise<Record<string, string>>

Returns

void

Inherited from

AxAIOpenAIBase.setHeaders


setName()

setName(name: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L190

Parameters

ParameterType
namestring

Returns

void

Inherited from

AxAIOpenAIBase.setName


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L206

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Inherited from

AxAIOpenAIBase.setOptions

AxAIGoogleGemini

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/api.ts#L601

AxAIGoogleGemini: AI Service

Extends

Constructors

Constructor

new AxAIGoogleGemini(__namedParameters: Readonly<Omit<AxAIGoogleGeminiArgs, "name">>): AxAIGoogleGemini;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/api.ts#L610

Parameters

ParameterType
__namedParametersReadonly<Omit<AxAIGoogleGeminiArgs, "name">>

Returns

AxAIGoogleGemini

Overrides

AxBaseAI.constructor

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIGoogleGeminiModel, AxAIGoogleGeminiEmbedModel>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L326

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIGoogleGeminiModel, AxAIGoogleGeminiEmbedModel>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxBaseAI.chat


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<AxAIGoogleGeminiModel, AxAIGoogleGeminiEmbedModel>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L625

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions<AxAIGoogleGeminiModel, AxAIGoogleGeminiEmbedModel>>

Returns

Promise<AxEmbedResponse>

Inherited from

AxBaseAI.embed


getFeatures()

getFeatures(model?: AxAIGoogleGeminiModel): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L265

Parameters

ParameterType
model?AxAIGoogleGeminiModel

Returns

AxAIFeatures

Inherited from

AxBaseAI.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L194

Returns

string

Inherited from

AxBaseAI.getId


getLastUsedChatModel()

getLastUsedChatModel(): 
  | undefined
  | AxAIGoogleGeminiModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L271

Returns

| undefined | AxAIGoogleGeminiModel

Inherited from

AxBaseAI.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): 
  | undefined
  | AxAIGoogleGeminiEmbedModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L275

Returns

| undefined | AxAIGoogleGeminiEmbedModel

Inherited from

AxBaseAI.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L279

Returns

undefined | AxModelConfig

Inherited from

AxBaseAI.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L230

Returns

AxLoggerFunction

Inherited from

AxBaseAI.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L322

Returns

AxAIServiceMetrics

Inherited from

AxBaseAI.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L234

Returns

undefined | AxAIModelList

Inherited from

AxBaseAI.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L261

Returns

string

Inherited from

AxBaseAI.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L217

Returns

Readonly<AxAIServiceOptions>

Inherited from

AxBaseAI.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L198

Parameters

ParameterType
apiURLstring

Returns

void

Inherited from

AxBaseAI.setAPIURL


setHeaders()

setHeaders(headers: () => Promise<Record<string, string>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L202

Parameters

ParameterType
headers() => Promise<Record<string, string>>

Returns

void

Inherited from

AxBaseAI.setHeaders


setName()

setName(name: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L190

Parameters

ParameterType
namestring

Returns

void

Inherited from

AxBaseAI.setName


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L206

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Inherited from

AxBaseAI.setOptions

AxAIGrok

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/x-grok/api.ts#L76

Extends

Constructors

Constructor

new AxAIGrok(__namedParameters: Readonly<Omit<AxAIGrokArgs, "name">>): AxAIGrok;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/x-grok/api.ts#L81

Parameters

ParameterType
__namedParametersReadonly<Omit<AxAIGrokArgs, "name">>

Returns

AxAIGrok

Overrides

AxAIOpenAIBase.constructor

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIGrokModel, GrokEmbedSmall>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L326

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIGrokModel, GrokEmbedSmall>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxAIOpenAIBase.chat


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<AxAIGrokModel, GrokEmbedSmall>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L625

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions<AxAIGrokModel, GrokEmbedSmall>>

Returns

Promise<AxEmbedResponse>

Inherited from

AxAIOpenAIBase.embed


getFeatures()

getFeatures(model?: AxAIGrokModel): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L265

Parameters

ParameterType
model?AxAIGrokModel

Returns

AxAIFeatures

Inherited from

AxAIOpenAIBase.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L194

Returns

string

Inherited from

AxAIOpenAIBase.getId


getLastUsedChatModel()

getLastUsedChatModel(): undefined | AxAIGrokModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L271

Returns

undefined | AxAIGrokModel

Inherited from

AxAIOpenAIBase.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): 
  | undefined
  | GrokEmbedSmall;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L275

Returns

| undefined | GrokEmbedSmall

Inherited from

AxAIOpenAIBase.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L279

Returns

undefined | AxModelConfig

Inherited from

AxAIOpenAIBase.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L230

Returns

AxLoggerFunction

Inherited from

AxAIOpenAIBase.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L322

Returns

AxAIServiceMetrics

Inherited from

AxAIOpenAIBase.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L234

Returns

undefined | AxAIModelList

Inherited from

AxAIOpenAIBase.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L261

Returns

string

Inherited from

AxAIOpenAIBase.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L217

Returns

Readonly<AxAIServiceOptions>

Inherited from

AxAIOpenAIBase.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L198

Parameters

ParameterType
apiURLstring

Returns

void

Inherited from

AxAIOpenAIBase.setAPIURL


setHeaders()

setHeaders(headers: () => Promise<Record<string, string>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L202

Parameters

ParameterType
headers() => Promise<Record<string, string>>

Returns

void

Inherited from

AxAIOpenAIBase.setHeaders


setName()

setName(name: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L190

Parameters

ParameterType
namestring

Returns

void

Inherited from

AxAIOpenAIBase.setName


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L206

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Inherited from

AxAIOpenAIBase.setOptions

AxAIGroq

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/groq/api.ts#L27

Extends

Constructors

Constructor

new AxAIGroq(__namedParameters: Readonly<Omit<AxAIGroqArgs, "name">>): AxAIGroq;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/groq/api.ts#L28

Parameters

ParameterType
__namedParametersReadonly<Omit<AxAIGroqArgs, "name">>

Returns

AxAIGroq

Overrides

AxAIOpenAIBase.constructor

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIGroqModel, undefined>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L326

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIGroqModel, undefined>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxAIOpenAIBase.chat


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<AxAIGroqModel, undefined>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L625

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions<AxAIGroqModel, undefined>>

Returns

Promise<AxEmbedResponse>

Inherited from

AxAIOpenAIBase.embed


getFeatures()

getFeatures(model?: AxAIGroqModel): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L265

Parameters

ParameterType
model?AxAIGroqModel

Returns

AxAIFeatures

Inherited from

AxAIOpenAIBase.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L194

Returns

string

Inherited from

AxAIOpenAIBase.getId


getLastUsedChatModel()

getLastUsedChatModel(): undefined | AxAIGroqModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L271

Returns

undefined | AxAIGroqModel

Inherited from

AxAIOpenAIBase.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): undefined;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L275

Returns

undefined

Inherited from

AxAIOpenAIBase.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L279

Returns

undefined | AxModelConfig

Inherited from

AxAIOpenAIBase.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L230

Returns

AxLoggerFunction

Inherited from

AxAIOpenAIBase.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L322

Returns

AxAIServiceMetrics

Inherited from

AxAIOpenAIBase.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L234

Returns

undefined | AxAIModelList

Inherited from

AxAIOpenAIBase.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L261

Returns

string

Inherited from

AxAIOpenAIBase.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L217

Returns

Readonly<AxAIServiceOptions>

Inherited from

AxAIOpenAIBase.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L198

Parameters

ParameterType
apiURLstring

Returns

void

Inherited from

AxAIOpenAIBase.setAPIURL


setHeaders()

setHeaders(headers: () => Promise<Record<string, string>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L202

Parameters

ParameterType
headers() => Promise<Record<string, string>>

Returns

void

Inherited from

AxAIOpenAIBase.setHeaders


setName()

setName(name: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L190

Parameters

ParameterType
namestring

Returns

void

Inherited from

AxAIOpenAIBase.setName


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/groq/api.ts#L71

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Overrides

AxAIOpenAIBase.setOptions

AxAIHuggingFace

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/huggingface/api.ts#L166

Extends

Constructors

Constructor

new AxAIHuggingFace(__namedParameters: Readonly<Omit<AxAIHuggingFaceArgs, "name">>): AxAIHuggingFace;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/huggingface/api.ts#L175

Parameters

ParameterType
__namedParametersReadonly<Omit<AxAIHuggingFaceArgs, "name">>

Returns

AxAIHuggingFace

Overrides

AxBaseAI.constructor

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<MetaLlama270BChatHF, unknown>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L326

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<MetaLlama270BChatHF, unknown>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxBaseAI.chat


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<MetaLlama270BChatHF, unknown>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L625

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions<MetaLlama270BChatHF, unknown>>

Returns

Promise<AxEmbedResponse>

Inherited from

AxBaseAI.embed


getFeatures()

getFeatures(model?: MetaLlama270BChatHF): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L265

Parameters

ParameterType
model?MetaLlama270BChatHF

Returns

AxAIFeatures

Inherited from

AxBaseAI.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L194

Returns

string

Inherited from

AxBaseAI.getId


getLastUsedChatModel()

getLastUsedChatModel(): 
  | undefined
  | MetaLlama270BChatHF;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L271

Returns

| undefined | MetaLlama270BChatHF

Inherited from

AxBaseAI.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): unknown;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L275

Returns

unknown

Inherited from

AxBaseAI.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L279

Returns

undefined | AxModelConfig

Inherited from

AxBaseAI.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L230

Returns

AxLoggerFunction

Inherited from

AxBaseAI.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L322

Returns

AxAIServiceMetrics

Inherited from

AxBaseAI.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L234

Returns

undefined | AxAIModelList

Inherited from

AxBaseAI.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L261

Returns

string

Inherited from

AxBaseAI.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L217

Returns

Readonly<AxAIServiceOptions>

Inherited from

AxBaseAI.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L198

Parameters

ParameterType
apiURLstring

Returns

void

Inherited from

AxBaseAI.setAPIURL


setHeaders()

setHeaders(headers: () => Promise<Record<string, string>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L202

Parameters

ParameterType
headers() => Promise<Record<string, string>>

Returns

void

Inherited from

AxBaseAI.setHeaders


setName()

setName(name: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L190

Parameters

ParameterType
namestring

Returns

void

Inherited from

AxBaseAI.setName


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L206

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Inherited from

AxBaseAI.setOptions

AxAIMistral

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mistral/api.ts#L79

Extends

Constructors

Constructor

new AxAIMistral(__namedParameters: Readonly<Omit<AxAIMistralArgs, "name">>): AxAIMistral;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mistral/api.ts#L83

Parameters

ParameterType
__namedParametersReadonly<Omit<AxAIMistralArgs, "name">>

Returns

AxAIMistral

Overrides

AxAIOpenAIBase.constructor

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIMistralModel, MistralEmbed>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L326

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIMistralModel, MistralEmbed>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxAIOpenAIBase.chat


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<AxAIMistralModel, MistralEmbed>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L625

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions<AxAIMistralModel, MistralEmbed>>

Returns

Promise<AxEmbedResponse>

Inherited from

AxAIOpenAIBase.embed


getFeatures()

getFeatures(model?: AxAIMistralModel): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L265

Parameters

ParameterType
model?AxAIMistralModel

Returns

AxAIFeatures

Inherited from

AxAIOpenAIBase.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L194

Returns

string

Inherited from

AxAIOpenAIBase.getId


getLastUsedChatModel()

getLastUsedChatModel(): undefined | AxAIMistralModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L271

Returns

undefined | AxAIMistralModel

Inherited from

AxAIOpenAIBase.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): 
  | undefined
  | MistralEmbed;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L275

Returns

| undefined | MistralEmbed

Inherited from

AxAIOpenAIBase.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L279

Returns

undefined | AxModelConfig

Inherited from

AxAIOpenAIBase.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L230

Returns

AxLoggerFunction

Inherited from

AxAIOpenAIBase.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L322

Returns

AxAIServiceMetrics

Inherited from

AxAIOpenAIBase.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L234

Returns

undefined | AxAIModelList

Inherited from

AxAIOpenAIBase.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L261

Returns

string

Inherited from

AxAIOpenAIBase.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L217

Returns

Readonly<AxAIServiceOptions>

Inherited from

AxAIOpenAIBase.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L198

Parameters

ParameterType
apiURLstring

Returns

void

Inherited from

AxAIOpenAIBase.setAPIURL


setHeaders()

setHeaders(headers: () => Promise<Record<string, string>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L202

Parameters

ParameterType
headers() => Promise<Record<string, string>>

Returns

void

Inherited from

AxAIOpenAIBase.setHeaders


setName()

setName(name: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L190

Parameters

ParameterType
namestring

Returns

void

Inherited from

AxAIOpenAIBase.setName


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L206

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Inherited from

AxAIOpenAIBase.setOptions

AxAIOllama

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/ollama/api.ts#L33

OllamaAI: AI Service

Extends

Constructors

Constructor

new AxAIOllama(__namedParameters: Readonly<Omit<AxAIOllamaArgs, "name">>): AxAIOllama;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/ollama/api.ts#L34

Parameters

ParameterType
__namedParametersReadonly<Omit<AxAIOllamaArgs, "name">>

Returns

AxAIOllama

Overrides

AxAIOpenAIBase.constructor

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<string, string>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L326

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<string, string>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxAIOpenAIBase.chat


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<string, string>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L625

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions<string, string>>

Returns

Promise<AxEmbedResponse>

Inherited from

AxAIOpenAIBase.embed


getFeatures()

getFeatures(model?: string): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L265

Parameters

ParameterType
model?string

Returns

AxAIFeatures

Inherited from

AxAIOpenAIBase.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L194

Returns

string

Inherited from

AxAIOpenAIBase.getId


getLastUsedChatModel()

getLastUsedChatModel(): undefined | string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L271

Returns

undefined | string

Inherited from

AxAIOpenAIBase.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): undefined | string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L275

Returns

undefined | string

Inherited from

AxAIOpenAIBase.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L279

Returns

undefined | AxModelConfig

Inherited from

AxAIOpenAIBase.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L230

Returns

AxLoggerFunction

Inherited from

AxAIOpenAIBase.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L322

Returns

AxAIServiceMetrics

Inherited from

AxAIOpenAIBase.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L234

Returns

undefined | AxAIModelList

Inherited from

AxAIOpenAIBase.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L261

Returns

string

Inherited from

AxAIOpenAIBase.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L217

Returns

Readonly<AxAIServiceOptions>

Inherited from

AxAIOpenAIBase.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L198

Parameters

ParameterType
apiURLstring

Returns

void

Inherited from

AxAIOpenAIBase.setAPIURL


setHeaders()

setHeaders(headers: () => Promise<Record<string, string>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L202

Parameters

ParameterType
headers() => Promise<Record<string, string>>

Returns

void

Inherited from

AxAIOpenAIBase.setHeaders


setName()

setName(name: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L190

Parameters

ParameterType
namestring

Returns

void

Inherited from

AxAIOpenAIBase.setName


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L206

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Inherited from

AxAIOpenAIBase.setOptions

AxAIOpenAI

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/api.ts#L616

Extends

Constructors

Constructor

new AxAIOpenAI(__namedParameters: Readonly<Omit<AxAIOpenAIArgs, "name">>): AxAIOpenAI;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/api.ts#L620

Parameters

ParameterType
__namedParametersReadonly<Omit<AxAIOpenAIArgs, "name">>

Returns

AxAIOpenAI

Overrides

AxAIOpenAIBase.constructor

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIOpenAIModel, AxAIOpenAIEmbedModel>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L326

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIOpenAIModel, AxAIOpenAIEmbedModel>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxAIOpenAIBase.chat


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<AxAIOpenAIModel, AxAIOpenAIEmbedModel>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L625

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions<AxAIOpenAIModel, AxAIOpenAIEmbedModel>>

Returns

Promise<AxEmbedResponse>

Inherited from

AxAIOpenAIBase.embed


getFeatures()

getFeatures(model?: AxAIOpenAIModel): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L265

Parameters

ParameterType
model?AxAIOpenAIModel

Returns

AxAIFeatures

Inherited from

AxAIOpenAIBase.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L194

Returns

string

Inherited from

AxAIOpenAIBase.getId


getLastUsedChatModel()

getLastUsedChatModel(): undefined | AxAIOpenAIModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L271

Returns

undefined | AxAIOpenAIModel

Inherited from

AxAIOpenAIBase.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): 
  | undefined
  | AxAIOpenAIEmbedModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L275

Returns

| undefined | AxAIOpenAIEmbedModel

Inherited from

AxAIOpenAIBase.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L279

Returns

undefined | AxModelConfig

Inherited from

AxAIOpenAIBase.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L230

Returns

AxLoggerFunction

Inherited from

AxAIOpenAIBase.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L322

Returns

AxAIServiceMetrics

Inherited from

AxAIOpenAIBase.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L234

Returns

undefined | AxAIModelList

Inherited from

AxAIOpenAIBase.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L261

Returns

string

Inherited from

AxAIOpenAIBase.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L217

Returns

Readonly<AxAIServiceOptions>

Inherited from

AxAIOpenAIBase.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L198

Parameters

ParameterType
apiURLstring

Returns

void

Inherited from

AxAIOpenAIBase.setAPIURL


setHeaders()

setHeaders(headers: () => Promise<Record<string, string>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L202

Parameters

ParameterType
headers() => Promise<Record<string, string>>

Returns

void

Inherited from

AxAIOpenAIBase.setHeaders


setName()

setName(name: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L190

Parameters

ParameterType
namestring

Returns

void

Inherited from

AxAIOpenAIBase.setName


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L206

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Inherited from

AxAIOpenAIBase.setOptions

AxAIOpenAIResponses

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_api_base.ts#L158

Base class for OpenAI AI services using the /v1/responses API endpoint

Extends

Constructors

Constructor

new AxAIOpenAIResponses(__namedParameters: Readonly<Omit<AxAIOpenAIResponsesArgs, "name">>): AxAIOpenAIResponses;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_api_base.ts#L163

Parameters

ParameterType
__namedParametersReadonly<Omit<AxAIOpenAIResponsesArgs, "name">>

Returns

AxAIOpenAIResponses

Overrides

AxAIOpenAIResponsesBase.constructor

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L326

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxAIOpenAIResponsesBase.chat


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L625

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel>>

Returns

Promise<AxEmbedResponse>

Inherited from

AxAIOpenAIResponsesBase.embed


getFeatures()

getFeatures(model?: AxAIOpenAIResponsesModel): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L265

Parameters

ParameterType
model?AxAIOpenAIResponsesModel

Returns

AxAIFeatures

Inherited from

AxAIOpenAIResponsesBase.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L194

Returns

string

Inherited from

AxAIOpenAIResponsesBase.getId


getLastUsedChatModel()

getLastUsedChatModel(): 
  | undefined
  | AxAIOpenAIResponsesModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L271

Returns

| undefined | AxAIOpenAIResponsesModel

Inherited from

AxAIOpenAIResponsesBase.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): 
  | undefined
  | AxAIOpenAIEmbedModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L275

Returns

| undefined | AxAIOpenAIEmbedModel

Inherited from

AxAIOpenAIResponsesBase.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L279

Returns

undefined | AxModelConfig

Inherited from

AxAIOpenAIResponsesBase.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L230

Returns

AxLoggerFunction

Inherited from

AxAIOpenAIResponsesBase.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L322

Returns

AxAIServiceMetrics

Inherited from

AxAIOpenAIResponsesBase.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L234

Returns

undefined | AxAIModelList

Inherited from

AxAIOpenAIResponsesBase.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L261

Returns

string

Inherited from

AxAIOpenAIResponsesBase.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L217

Returns

Readonly<AxAIServiceOptions>

Inherited from

AxAIOpenAIResponsesBase.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L198

Parameters

ParameterType
apiURLstring

Returns

void

Inherited from

AxAIOpenAIResponsesBase.setAPIURL


setHeaders()

setHeaders(headers: () => Promise<Record<string, string>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L202

Parameters

ParameterType
headers() => Promise<Record<string, string>>

Returns

void

Inherited from

AxAIOpenAIResponsesBase.setHeaders


setName()

setName(name: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L190

Parameters

ParameterType
namestring

Returns

void

Inherited from

AxAIOpenAIResponsesBase.setName


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L206

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Inherited from

AxAIOpenAIResponsesBase.setOptions

AxAIOpenAIBase

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/api.ts#L564

Extends

Extended by

Type Parameters

Type ParameterDefault type
TModel-
TEmbedModel-
TChatReq extends AxAIOpenAIChatRequest<TModel>AxAIOpenAIChatRequest<TModel>

Constructors

Constructor

new AxAIOpenAIBase<TModel, TEmbedModel, TChatReq>(__namedParameters: Readonly<Omit<AxAIOpenAIBaseArgs<TModel, TEmbedModel, TChatReq>, "name">>): AxAIOpenAIBase<TModel, TEmbedModel, TChatReq>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/api.ts#L578

Parameters

ParameterType
__namedParametersReadonly<Omit<AxAIOpenAIBaseArgs<TModel, TEmbedModel, TChatReq>, "name">>

Returns

AxAIOpenAIBase<TModel, TEmbedModel, TChatReq>

Overrides

AxBaseAI.constructor

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<TModel, TEmbedModel>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L326

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<TModel, TEmbedModel>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxBaseAI.chat


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<TModel, TEmbedModel>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L625

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions<TModel, TEmbedModel>>

Returns

Promise<AxEmbedResponse>

Inherited from

AxBaseAI.embed


getFeatures()

getFeatures(model?: TModel): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L265

Parameters

ParameterType
model?TModel

Returns

AxAIFeatures

Inherited from

AxBaseAI.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L194

Returns

string

Inherited from

AxBaseAI.getId


getLastUsedChatModel()

getLastUsedChatModel(): undefined | TModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L271

Returns

undefined | TModel

Inherited from

AxBaseAI.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): undefined | TEmbedModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L275

Returns

undefined | TEmbedModel

Inherited from

AxBaseAI.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L279

Returns

undefined | AxModelConfig

Inherited from

AxBaseAI.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L230

Returns

AxLoggerFunction

Inherited from

AxBaseAI.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L322

Returns

AxAIServiceMetrics

Inherited from

AxBaseAI.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L234

Returns

undefined | AxAIModelList

Inherited from

AxBaseAI.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L261

Returns

string

Inherited from

AxBaseAI.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L217

Returns

Readonly<AxAIServiceOptions>

Inherited from

AxBaseAI.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L198

Parameters

ParameterType
apiURLstring

Returns

void

Inherited from

AxBaseAI.setAPIURL


setHeaders()

setHeaders(headers: () => Promise<Record<string, string>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L202

Parameters

ParameterType
headers() => Promise<Record<string, string>>

Returns

void

Inherited from

AxBaseAI.setHeaders


setName()

setName(name: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L190

Parameters

ParameterType
namestring

Returns

void

Inherited from

AxBaseAI.setName


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L206

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Inherited from

AxBaseAI.setOptions

AxAIOpenAIResponsesBase

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_api_base.ts#L80

Base class for OpenAI AI services using the /v1/responses API endpoint

Extends

Extended by

Type Parameters

Type Parameter
TModel
TEmbedModel
TResponsesReq extends AxAIOpenAIResponsesRequest<TModel>

Constructors

Constructor

new AxAIOpenAIResponsesBase<TModel, TEmbedModel, TResponsesReq>(__namedParameters: Readonly<AxAIOpenAIResponsesBaseArgs<TModel, TEmbedModel, TResponsesReq>>): AxAIOpenAIResponsesBase<TModel, TEmbedModel, TResponsesReq>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_api_base.ts#L93

Parameters

ParameterType
__namedParametersReadonly<AxAIOpenAIResponsesBaseArgs<TModel, TEmbedModel, TResponsesReq>>

Returns

AxAIOpenAIResponsesBase<TModel, TEmbedModel, TResponsesReq>

Overrides

AxBaseAI.constructor

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<TModel, TEmbedModel>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L326

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<TModel, TEmbedModel>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxBaseAI.chat


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<TModel, TEmbedModel>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L625

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions<TModel, TEmbedModel>>

Returns

Promise<AxEmbedResponse>

Inherited from

AxBaseAI.embed


getFeatures()

getFeatures(model?: TModel): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L265

Parameters

ParameterType
model?TModel

Returns

AxAIFeatures

Inherited from

AxBaseAI.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L194

Returns

string

Inherited from

AxBaseAI.getId


getLastUsedChatModel()

getLastUsedChatModel(): undefined | TModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L271

Returns

undefined | TModel

Inherited from

AxBaseAI.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): undefined | TEmbedModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L275

Returns

undefined | TEmbedModel

Inherited from

AxBaseAI.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L279

Returns

undefined | AxModelConfig

Inherited from

AxBaseAI.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L230

Returns

AxLoggerFunction

Inherited from

AxBaseAI.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L322

Returns

AxAIServiceMetrics

Inherited from

AxBaseAI.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L234

Returns

undefined | AxAIModelList

Inherited from

AxBaseAI.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L261

Returns

string

Inherited from

AxBaseAI.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L217

Returns

Readonly<AxAIServiceOptions>

Inherited from

AxBaseAI.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L198

Parameters

ParameterType
apiURLstring

Returns

void

Inherited from

AxBaseAI.setAPIURL


setHeaders()

setHeaders(headers: () => Promise<Record<string, string>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L202

Parameters

ParameterType
headers() => Promise<Record<string, string>>

Returns

void

Inherited from

AxBaseAI.setHeaders


setName()

setName(name: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L190

Parameters

ParameterType
namestring

Returns

void

Inherited from

AxBaseAI.setName


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L206

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Inherited from

AxBaseAI.setOptions

AxAIOpenAIResponsesImpl

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_api.ts#L47

Type Parameters

Type Parameter
TModel
TEmbedModel
TResponsesReq extends AxAIOpenAIResponsesRequest<TModel>

Implements

Constructors

Constructor

new AxAIOpenAIResponsesImpl<TModel, TEmbedModel, TResponsesReq>(
   config: Readonly<AxAIOpenAIResponsesConfig<TModel, TEmbedModel>>, 
   streamingUsage: boolean, 
responsesReqUpdater?: ResponsesReqUpdater<TModel, TResponsesReq>): AxAIOpenAIResponsesImpl<TModel, TEmbedModel, TResponsesReq>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_api.ts#L64

Parameters

ParameterType
configReadonly<AxAIOpenAIResponsesConfig<TModel, TEmbedModel>>
streamingUsageboolean
responsesReqUpdater?ResponsesReqUpdater<TModel, TResponsesReq>

Returns

AxAIOpenAIResponsesImpl<TModel, TEmbedModel, TResponsesReq>

Methods

createChatReq()

createChatReq(req: Readonly<AxInternalChatRequest<TModel>>, config: Readonly<AxAIPromptConfig>): [Readonly<AxAPI>, Readonly<AxAIOpenAIResponsesRequest<TModel>>];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_api.ts#L242

Parameters

ParameterType
reqReadonly<AxInternalChatRequest<TModel>>
configReadonly<AxAIPromptConfig>

Returns

[Readonly<AxAPI>, Readonly<AxAIOpenAIResponsesRequest<TModel>>]

Implementation of

AxAIServiceImpl.createChatReq


createChatResp()

createChatResp(resp: Readonly<AxAIOpenAIResponsesResponse>): Readonly<AxChatResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_api.ts#L420

Parameters

ParameterType
respReadonly<AxAIOpenAIResponsesResponse>

Returns

Readonly<AxChatResponse>

Implementation of

AxAIServiceImpl.createChatResp


createChatStreamResp()

createChatStreamResp(streamEvent: Readonly<AxAIOpenAIResponsesResponseDelta>): Readonly<AxChatResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_api.ts#L600

Parameters

ParameterType
streamEventReadonly<AxAIOpenAIResponsesResponseDelta>

Returns

Readonly<AxChatResponse>

Implementation of

AxAIServiceImpl.createChatStreamResp


createEmbedReq()

createEmbedReq(req: Readonly<AxInternalEmbedRequest<TEmbedModel>>): [AxAPI, AxAIOpenAIEmbedRequest<TEmbedModel>];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_api.ts#L1028

Parameters

ParameterType
reqReadonly<AxInternalEmbedRequest<TEmbedModel>>

Returns

[AxAPI, AxAIOpenAIEmbedRequest<TEmbedModel>]

Implementation of

AxAIServiceImpl.createEmbedReq


getModelConfig()

getModelConfig(): Readonly<AxModelConfig>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_api.ts#L79

Returns

Readonly<AxModelConfig>

Implementation of

AxAIServiceImpl.getModelConfig


getTokenUsage()

getTokenUsage(): undefined | Readonly<AxTokenUsage>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_api.ts#L75

Returns

undefined | Readonly<AxTokenUsage>

Implementation of

AxAIServiceImpl.getTokenUsage

AxAIReka

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/api.ts#L268

Extends

Constructors

Constructor

new AxAIReka(__namedParameters: Readonly<Omit<AxAIRekaArgs, "name">>): AxAIReka;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/api.ts#L277

Parameters

ParameterType
__namedParametersReadonly<Omit<AxAIRekaArgs, "name">>

Returns

AxAIReka

Overrides

AxBaseAI.constructor

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIRekaModel, undefined>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L326

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<AxAIRekaModel, undefined>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxBaseAI.chat


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<AxAIRekaModel, undefined>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L625

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions<AxAIRekaModel, undefined>>

Returns

Promise<AxEmbedResponse>

Inherited from

AxBaseAI.embed


getFeatures()

getFeatures(model?: AxAIRekaModel): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L265

Parameters

ParameterType
model?AxAIRekaModel

Returns

AxAIFeatures

Inherited from

AxBaseAI.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L194

Returns

string

Inherited from

AxBaseAI.getId


getLastUsedChatModel()

getLastUsedChatModel(): undefined | AxAIRekaModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L271

Returns

undefined | AxAIRekaModel

Inherited from

AxBaseAI.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): undefined;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L275

Returns

undefined

Inherited from

AxBaseAI.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L279

Returns

undefined | AxModelConfig

Inherited from

AxBaseAI.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L230

Returns

AxLoggerFunction

Inherited from

AxBaseAI.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L322

Returns

AxAIServiceMetrics

Inherited from

AxBaseAI.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L234

Returns

undefined | AxAIModelList

Inherited from

AxBaseAI.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L261

Returns

string

Inherited from

AxBaseAI.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L217

Returns

Readonly<AxAIServiceOptions>

Inherited from

AxBaseAI.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L198

Parameters

ParameterType
apiURLstring

Returns

void

Inherited from

AxBaseAI.setAPIURL


setHeaders()

setHeaders(headers: () => Promise<Record<string, string>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L202

Parameters

ParameterType
headers() => Promise<Record<string, string>>

Returns

void

Inherited from

AxBaseAI.setHeaders


setName()

setName(name: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L190

Parameters

ParameterType
namestring

Returns

void

Inherited from

AxBaseAI.setName


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L206

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Inherited from

AxBaseAI.setOptions

AxAIServiceAbortedError

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L214

Extends

Constructors

Constructor

new AxAIServiceAbortedError(
   url: string, 
   reason?: string, 
   requestBody?: unknown, 
   context?: Record<string, unknown>): AxAIServiceAbortedError;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L215

Parameters

ParameterType
urlstring
reason?string
requestBody?unknown
context?Record<string, unknown>

Returns

AxAIServiceAbortedError

Overrides

AxAIServiceError.constructor

Properties

PropertyModifierTypeDescriptionInherited from
cause?publicunknown-AxAIServiceError.cause
contextreadonlyRecord<string, unknown>-AxAIServiceError.context
errorIdreadonlystring-AxAIServiceError.errorId
messagepublicstring-AxAIServiceError.message
namepublicstring-AxAIServiceError.name
requestBodyreadonlyunknown-AxAIServiceError.requestBody
responseBodyreadonlyunknown-AxAIServiceError.responseBody
stack?publicstring-AxAIServiceError.stack
timestampreadonlystring-AxAIServiceError.timestamp
urlreadonlystring-AxAIServiceError.url
stackTraceLimitstaticnumberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.AxAIServiceError.stackTraceLimit

Methods

toString()

toString(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L97

Returns a string representation of an object.

Returns

string

Inherited from

AxAIServiceError.toString


captureStackTrace()

static captureStackTrace(targetObject: object, constructorOpt?: Function): void;

Defined in: node_modules/@types/node/globals.d.ts:145

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();

Parameters

ParameterType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

AxAIServiceError.captureStackTrace


prepareStackTrace()

static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;

Defined in: node_modules/@types/node/globals.d.ts:149

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Parameters

ParameterType
errError
stackTracesCallSite[]

Returns

any

Inherited from

AxAIServiceError.prepareStackTrace

AxAIServiceAuthenticationError

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L232

Extends

Constructors

Constructor

new AxAIServiceAuthenticationError(
   url: string, 
   requestBody: unknown, 
   responseBody: unknown, 
   context?: Record<string, unknown>): AxAIServiceAuthenticationError;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L233

Parameters

ParameterType
urlstring
requestBodyunknown
responseBodyunknown
context?Record<string, unknown>

Returns

AxAIServiceAuthenticationError

Overrides

AxAIServiceError.constructor

Properties

PropertyModifierTypeDescriptionInherited from
cause?publicunknown-AxAIServiceError.cause
contextreadonlyRecord<string, unknown>-AxAIServiceError.context
errorIdreadonlystring-AxAIServiceError.errorId
messagepublicstring-AxAIServiceError.message
namepublicstring-AxAIServiceError.name
requestBodyreadonlyunknown-AxAIServiceError.requestBody
responseBodyreadonlyunknown-AxAIServiceError.responseBody
stack?publicstring-AxAIServiceError.stack
timestampreadonlystring-AxAIServiceError.timestamp
urlreadonlystring-AxAIServiceError.url
stackTraceLimitstaticnumberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.AxAIServiceError.stackTraceLimit

Methods

toString()

toString(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L97

Returns a string representation of an object.

Returns

string

Inherited from

AxAIServiceError.toString


captureStackTrace()

static captureStackTrace(targetObject: object, constructorOpt?: Function): void;

Defined in: node_modules/@types/node/globals.d.ts:145

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();

Parameters

ParameterType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

AxAIServiceError.captureStackTrace


prepareStackTrace()

static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;

Defined in: node_modules/@types/node/globals.d.ts:149

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Parameters

ParameterType
errError
stackTracesCallSite[]

Returns

any

Inherited from

AxAIServiceError.prepareStackTrace

AxAIServiceNetworkError

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L139

Extends

Constructors

Constructor

new AxAIServiceNetworkError(
   originalError: Error, 
   url: string, 
   requestBody: unknown, 
   responseBody: unknown, 
   context?: Record<string, unknown>): AxAIServiceNetworkError;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L140

Parameters

ParameterType
originalErrorError
urlstring
requestBodyunknown
responseBodyunknown
context?Record<string, unknown>

Returns

AxAIServiceNetworkError

Overrides

AxAIServiceError.constructor

Properties

PropertyModifierTypeDescriptionInherited from
cause?publicunknown-AxAIServiceError.cause
contextreadonlyRecord<string, unknown>-AxAIServiceError.context
errorIdreadonlystring-AxAIServiceError.errorId
messagepublicstring-AxAIServiceError.message
namepublicstring-AxAIServiceError.name
originalErrorreadonlyError--
requestBodyreadonlyunknown-AxAIServiceError.requestBody
responseBodyreadonlyunknown-AxAIServiceError.responseBody
stack?publicstring-AxAIServiceError.stack
timestampreadonlystring-AxAIServiceError.timestamp
urlreadonlystring-AxAIServiceError.url
stackTraceLimitstaticnumberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.AxAIServiceError.stackTraceLimit

Methods

toString()

toString(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L97

Returns a string representation of an object.

Returns

string

Inherited from

AxAIServiceError.toString


captureStackTrace()

static captureStackTrace(targetObject: object, constructorOpt?: Function): void;

Defined in: node_modules/@types/node/globals.d.ts:145

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();

Parameters

ParameterType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

AxAIServiceError.captureStackTrace


prepareStackTrace()

static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;

Defined in: node_modules/@types/node/globals.d.ts:149

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Parameters

ParameterType
errError
stackTracesCallSite[]

Returns

any

Inherited from

AxAIServiceError.prepareStackTrace

AxAIServiceResponseError

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L163

Extends

Constructors

Constructor

new AxAIServiceResponseError(
   message: string, 
   url: string, 
   requestBody?: unknown, 
   context?: Record<string, unknown>): AxAIServiceResponseError;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L164

Parameters

ParameterType
messagestring
urlstring
requestBody?unknown
context?Record<string, unknown>

Returns

AxAIServiceResponseError

Overrides

AxAIServiceError.constructor

Properties

PropertyModifierTypeDescriptionInherited from
cause?publicunknown-AxAIServiceError.cause
contextreadonlyRecord<string, unknown>-AxAIServiceError.context
errorIdreadonlystring-AxAIServiceError.errorId
messagepublicstring-AxAIServiceError.message
namepublicstring-AxAIServiceError.name
requestBodyreadonlyunknown-AxAIServiceError.requestBody
responseBodyreadonlyunknown-AxAIServiceError.responseBody
stack?publicstring-AxAIServiceError.stack
timestampreadonlystring-AxAIServiceError.timestamp
urlreadonlystring-AxAIServiceError.url
stackTraceLimitstaticnumberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.AxAIServiceError.stackTraceLimit

Methods

toString()

toString(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L97

Returns a string representation of an object.

Returns

string

Inherited from

AxAIServiceError.toString


captureStackTrace()

static captureStackTrace(targetObject: object, constructorOpt?: Function): void;

Defined in: node_modules/@types/node/globals.d.ts:145

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();

Parameters

ParameterType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

AxAIServiceError.captureStackTrace


prepareStackTrace()

static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;

Defined in: node_modules/@types/node/globals.d.ts:149

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Parameters

ParameterType
errError
stackTracesCallSite[]

Returns

any

Inherited from

AxAIServiceError.prepareStackTrace

AxAIServiceStatusError

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L120

Extends

Constructors

Constructor

new AxAIServiceStatusError(
   status: number, 
   statusText: string, 
   url: string, 
   requestBody: unknown, 
   responseBody: unknown, 
   context?: Record<string, unknown>): AxAIServiceStatusError;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L121

Parameters

ParameterType
statusnumber
statusTextstring
urlstring
requestBodyunknown
responseBodyunknown
context?Record<string, unknown>

Returns

AxAIServiceStatusError

Overrides

AxAIServiceError.constructor

Properties

PropertyModifierTypeDescriptionInherited from
cause?publicunknown-AxAIServiceError.cause
contextreadonlyRecord<string, unknown>-AxAIServiceError.context
errorIdreadonlystring-AxAIServiceError.errorId
messagepublicstring-AxAIServiceError.message
namepublicstring-AxAIServiceError.name
requestBodyreadonlyunknown-AxAIServiceError.requestBody
responseBodyreadonlyunknown-AxAIServiceError.responseBody
stack?publicstring-AxAIServiceError.stack
statusreadonlynumber--
statusTextreadonlystring--
timestampreadonlystring-AxAIServiceError.timestamp
urlreadonlystring-AxAIServiceError.url
stackTraceLimitstaticnumberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.AxAIServiceError.stackTraceLimit

Methods

toString()

toString(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L97

Returns a string representation of an object.

Returns

string

Inherited from

AxAIServiceError.toString


captureStackTrace()

static captureStackTrace(targetObject: object, constructorOpt?: Function): void;

Defined in: node_modules/@types/node/globals.d.ts:145

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();

Parameters

ParameterType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

AxAIServiceError.captureStackTrace


prepareStackTrace()

static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;

Defined in: node_modules/@types/node/globals.d.ts:149

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Parameters

ParameterType
errError
stackTracesCallSite[]

Returns

any

Inherited from

AxAIServiceError.prepareStackTrace

AxAIServiceStreamTerminatedError

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L175

Extends

Constructors

Constructor

new AxAIServiceStreamTerminatedError(
   url: string, 
   requestBody?: unknown, 
   lastChunk?: unknown, 
   context?: Record<string, unknown>): AxAIServiceStreamTerminatedError;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L176

Parameters

ParameterType
urlstring
requestBody?unknown
lastChunk?unknown
context?Record<string, unknown>

Returns

AxAIServiceStreamTerminatedError

Overrides

AxAIServiceError.constructor

Properties

PropertyModifierTypeDescriptionInherited from
cause?publicunknown-AxAIServiceError.cause
contextreadonlyRecord<string, unknown>-AxAIServiceError.context
errorIdreadonlystring-AxAIServiceError.errorId
lastChunk?readonlyunknown--
messagepublicstring-AxAIServiceError.message
namepublicstring-AxAIServiceError.name
requestBodyreadonlyunknown-AxAIServiceError.requestBody
responseBodyreadonlyunknown-AxAIServiceError.responseBody
stack?publicstring-AxAIServiceError.stack
timestampreadonlystring-AxAIServiceError.timestamp
urlreadonlystring-AxAIServiceError.url
stackTraceLimitstaticnumberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.AxAIServiceError.stackTraceLimit

Methods

toString()

toString(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L97

Returns a string representation of an object.

Returns

string

Inherited from

AxAIServiceError.toString


captureStackTrace()

static captureStackTrace(targetObject: object, constructorOpt?: Function): void;

Defined in: node_modules/@types/node/globals.d.ts:145

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();

Parameters

ParameterType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

AxAIServiceError.captureStackTrace


prepareStackTrace()

static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;

Defined in: node_modules/@types/node/globals.d.ts:149

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Parameters

ParameterType
errError
stackTracesCallSite[]

Returns

any

Inherited from

AxAIServiceError.prepareStackTrace

AxAIServiceTimeoutError

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L196

Extends

Constructors

Constructor

new AxAIServiceTimeoutError(
   url: string, 
   timeoutMs: number, 
   requestBody?: unknown, 
   context?: Record<string, unknown>): AxAIServiceTimeoutError;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L197

Parameters

ParameterType
urlstring
timeoutMsnumber
requestBody?unknown
context?Record<string, unknown>

Returns

AxAIServiceTimeoutError

Overrides

AxAIServiceError.constructor

Properties

PropertyModifierTypeDescriptionInherited from
cause?publicunknown-AxAIServiceError.cause
contextreadonlyRecord<string, unknown>-AxAIServiceError.context
errorIdreadonlystring-AxAIServiceError.errorId
messagepublicstring-AxAIServiceError.message
namepublicstring-AxAIServiceError.name
requestBodyreadonlyunknown-AxAIServiceError.requestBody
responseBodyreadonlyunknown-AxAIServiceError.responseBody
stack?publicstring-AxAIServiceError.stack
timestampreadonlystring-AxAIServiceError.timestamp
urlreadonlystring-AxAIServiceError.url
stackTraceLimitstaticnumberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.AxAIServiceError.stackTraceLimit

Methods

toString()

toString(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L97

Returns a string representation of an object.

Returns

string

Inherited from

AxAIServiceError.toString


captureStackTrace()

static captureStackTrace(targetObject: object, constructorOpt?: Function): void;

Defined in: node_modules/@types/node/globals.d.ts:145

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();

Parameters

ParameterType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

AxAIServiceError.captureStackTrace


prepareStackTrace()

static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;

Defined in: node_modules/@types/node/globals.d.ts:149

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Parameters

ParameterType
errError
stackTracesCallSite[]

Returns

any

Inherited from

AxAIServiceError.prepareStackTrace

AxAIRefusalError

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L244

Extends

  • Error

Constructors

Constructor

new AxAIRefusalError(
   refusalMessage: string, 
   model?: string, 
   requestId?: string): AxAIRefusalError;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L248

Parameters

ParameterType
refusalMessagestring
model?string
requestId?string

Returns

AxAIRefusalError

Overrides

Error.constructor

Properties

PropertyModifierTypeDescriptionInherited from
cause?publicunknown-Error.cause
errorIdreadonlystring--
messagepublicstring-Error.message
model?readonlystring--
namepublicstring-Error.name
refusalMessagereadonlystring--
requestId?readonlystring--
stack?publicstring-Error.stack
timestampreadonlystring--
stackTraceLimitstaticnumberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.Error.stackTraceLimit

Methods

toString()

toString(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L259

Returns a string representation of an object.

Returns

string


captureStackTrace()

static captureStackTrace(targetObject: object, constructorOpt?: Function): void;

Defined in: node_modules/@types/node/globals.d.ts:145

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();

Parameters

ParameterType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

Error.captureStackTrace

prepareStackTrace()

static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;

Defined in: node_modules/@types/node/globals.d.ts:149

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Parameters

ParameterType
errError
stackTracesCallSite[]

Returns

any

Inherited from

Error.prepareStackTrace

AxAIServiceError

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L76

Extends

  • Error

Extended by

Constructors

Constructor

new AxAIServiceError(
   message: string, 
   url: string, 
   requestBody: unknown, 
   responseBody: unknown, 
   context: Record<string, unknown>): AxAIServiceError;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L81

Parameters

ParameterType
messagestring
urlstring
requestBodyunknown
responseBodyunknown
contextRecord<string, unknown>

Returns

AxAIServiceError

Overrides

Error.constructor

Properties

PropertyModifierTypeDescriptionInherited from
cause?publicunknown-Error.cause
contextreadonlyRecord<string, unknown>--
errorIdreadonlystring--
messagepublicstring-Error.message
namepublicstring-Error.name
requestBodyreadonlyunknown--
responseBodyreadonlyunknown--
stack?publicstring-Error.stack
timestampreadonlystring--
urlreadonlystring--
stackTraceLimitstaticnumberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.Error.stackTraceLimit

Methods

toString()

toString(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L97

Returns a string representation of an object.

Returns

string


captureStackTrace()

static captureStackTrace(targetObject: object, constructorOpt?: Function): void;

Defined in: node_modules/@types/node/globals.d.ts:145

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();

Parameters

ParameterType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

Error.captureStackTrace

prepareStackTrace()

static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;

Defined in: node_modules/@types/node/globals.d.ts:149

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Parameters

ParameterType
errError
stackTracesCallSite[]

Returns

any

Inherited from

Error.prepareStackTrace

AxAITogether

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/together/api.ts#L18

Extends

Constructors

Constructor

new AxAITogether(__namedParameters: Readonly<Omit<AxAITogetherArgs, "name">>): AxAITogether;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/together/api.ts#L19

Parameters

ParameterType
__namedParametersReadonly<Omit<AxAITogetherArgs, "name">>

Returns

AxAITogether

Overrides

AxAIOpenAIBase.constructor

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<string, unknown>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L326

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<string, unknown>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxAIOpenAIBase.chat


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<string, unknown>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L625

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions<string, unknown>>

Returns

Promise<AxEmbedResponse>

Inherited from

AxAIOpenAIBase.embed


getFeatures()

getFeatures(model?: string): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L265

Parameters

ParameterType
model?string

Returns

AxAIFeatures

Inherited from

AxAIOpenAIBase.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L194

Returns

string

Inherited from

AxAIOpenAIBase.getId


getLastUsedChatModel()

getLastUsedChatModel(): undefined | string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L271

Returns

undefined | string

Inherited from

AxAIOpenAIBase.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): unknown;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L275

Returns

unknown

Inherited from

AxAIOpenAIBase.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L279

Returns

undefined | AxModelConfig

Inherited from

AxAIOpenAIBase.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L230

Returns

AxLoggerFunction

Inherited from

AxAIOpenAIBase.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L322

Returns

AxAIServiceMetrics

Inherited from

AxAIOpenAIBase.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L234

Returns

undefined | AxAIModelList

Inherited from

AxAIOpenAIBase.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L261

Returns

string

Inherited from

AxAIOpenAIBase.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L217

Returns

Readonly<AxAIServiceOptions>

Inherited from

AxAIOpenAIBase.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L198

Parameters

ParameterType
apiURLstring

Returns

void

Inherited from

AxAIOpenAIBase.setAPIURL


setHeaders()

setHeaders(headers: () => Promise<Record<string, string>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L202

Parameters

ParameterType
headers() => Promise<Record<string, string>>

Returns

void

Inherited from

AxAIOpenAIBase.setHeaders


setName()

setName(name: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L190

Parameters

ParameterType
namestring

Returns

void

Inherited from

AxAIOpenAIBase.setName


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L206

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Inherited from

AxAIOpenAIBase.setOptions

AxAgent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L160

An AI agent that can process inputs using an AI service and coordinate with child agents. Supports features like smart model routing and automatic input field passing to child agents.

Type Parameters

Type Parameter
IN extends AxGenIn
OUT extends AxGenOut

Implements

Constructors

Constructor

new AxAgent<IN, OUT>(__namedParameters: Readonly<{
  agents?: AxAgentic<IN, OUT>[];
  ai?: Readonly<AxAIService>;
  definition?: string;
  description: string;
  functions?: AxInputFunctionType;
  name: string;
  signature: NonNullable<ConstructorParameters<typeof AxSignature>[0]>;
}>, options?: Readonly<AxAgentOptions>): AxAgent<IN, OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L175

Parameters

ParameterType
__namedParametersReadonly<{ agents?: AxAgentic<IN, OUT>[]; ai?: Readonly<AxAIService>; definition?: string; description: string; functions?: AxInputFunctionType; name: string; signature: NonNullable<ConstructorParameters<typeof AxSignature>[0]>; }>
options?Readonly<AxAgentOptions>

Returns

AxAgent<IN, OUT>

Methods

forward()

forward(
   parentAi: Readonly<AxAIService>, 
   values: IN | AxMessage<IN>[], 
options?: Readonly<AxProgramForwardOptions>): Promise<OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L384

Parameters

ParameterType
parentAiReadonly<AxAIService>
valuesIN | AxMessage<IN>[]
options?Readonly<AxProgramForwardOptions>

Returns

Promise<OUT>


getFeatures()

getFeatures(): AxAgentFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L332

Returns

AxAgentFeatures

Implementation of

AxAgentic.getFeatures


getFunction()

getFunction(): AxFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L278

Returns

AxFunction

Implementation of

AxAgentic.getFunction


getTraces()

getTraces(): AxProgramTrace<IN, OUT>[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L262

Returns

AxProgramTrace<IN, OUT>[]

Implementation of

AxAgentic.getTraces


getUsage()

getUsage(): AxModelUsage & object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L270

Returns

AxModelUsage & object[]

Implementation of

AxAgentic.getUsage


resetUsage()

resetUsage(): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L274

Returns

void

Implementation of

AxAgentic.resetUsage


setDefinition()

setDefinition(definition: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L426

Parameters

ParameterType
definitionstring

Returns

void


setDemos()

setDemos(demos: readonly AxProgramDemos<IN, OUT>[]): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L266

Parameters

ParameterType
demosreadonly AxProgramDemos<IN, OUT>[]

Returns

void

Implementation of

AxAgentic.setDemos


setDescription()

setDescription(description: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L417

Updates the agent’s description. This updates both the stored description and the function’s description.

Parameters

ParameterTypeDescription
descriptionstringNew description for the agent (must be at least 20 characters)

Returns

void

Throws

Error if description is too short


setExamples()

setExamples(examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L247

Parameters

ParameterType
examplesReadonly<AxProgramExamples<IN, OUT>>
options?Readonly<AxSetExamplesOptions>

Returns

void

Implementation of

AxAgentic.setExamples


setId()

setId(id: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L254

Parameters

ParameterType
idstring

Returns

void

Implementation of

AxAgentic.setId


setParentId()

setParentId(parentId: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L258

Parameters

ParameterType
parentIdstring

Returns

void

Implementation of

AxAgentic.setParentId


streamingForward()

streamingForward(
   parentAi: Readonly<AxAIService>, 
   values: IN | AxMessage<IN>[], 
options?: Readonly<AxProgramStreamingForwardOptions>): AxGenStreamingOut<OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L397

Parameters

ParameterType
parentAiReadonly<AxAIService>
valuesIN | AxMessage<IN>[]
options?Readonly<AxProgramStreamingForwardOptions>

Returns

AxGenStreamingOut<OUT>

AxApacheTika

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/docs/tika.ts#L12

Constructors

Constructor

new AxApacheTika(args?: Readonly<AxApacheTikaArgs>): AxApacheTika;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/docs/tika.ts#L16

Parameters

ParameterType
args?Readonly<AxApacheTikaArgs>

Returns

AxApacheTika

Methods

convert()

convert(files: Readonly<string[] | Blob[]>, options?: Readonly<{
  batchSize?: number;
  format?: "text" | "html";
}>): Promise<string[]>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/docs/tika.ts#L54

Parameters

ParameterType
filesReadonly<string[] | Blob[]>
options?Readonly<{ batchSize?: number; format?: "text" | "html"; }>

Returns

Promise<string[]>

AxAssertionError

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/asserts.ts#L16

Extends

  • Error

Constructors

Constructor

new AxAssertionError(__namedParameters: Readonly<{
  message: string;
}>): AxAssertionError;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/asserts.ts#L17

Parameters

ParameterType
__namedParametersReadonly<{ message: string; }>

Returns

AxAssertionError

Overrides

Error.constructor

Properties

PropertyModifierTypeDescriptionInherited from
cause?publicunknown-Error.cause
messagepublicstring-Error.message
namepublicstring-Error.name
stack?publicstring-Error.stack
stackTraceLimitstaticnumberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.Error.stackTraceLimit

Methods

getFixingInstructions()

getFixingInstructions(): object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/asserts.ts#L26

Returns

object[]


toString()

toString(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/asserts.ts#L39

Returns a string representation of an object.

Returns

string


captureStackTrace()

static captureStackTrace(targetObject: object, constructorOpt?: Function): void;

Defined in: node_modules/@types/node/globals.d.ts:145

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();

Parameters

ParameterType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

Error.captureStackTrace

prepareStackTrace()

static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;

Defined in: node_modules/@types/node/globals.d.ts:149

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Parameters

ParameterType
errError
stackTracesCallSite[]

Returns

any

Inherited from

Error.prepareStackTrace

AxBalancer

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L42

Balancer that rotates through services.

Implements

Constructors

Constructor

new AxBalancer(services: readonly AxAIService<unknown, unknown>[], options?: AxBalancerOptions): AxBalancer;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L55

Parameters

ParameterType
servicesreadonly AxAIService<unknown, unknown>[]
options?AxBalancerOptions

Returns

AxBalancer

Methods

chat()

chat(req: Readonly<AxChatRequest>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L201

Parameters

ParameterType
reqReadonly<AxChatRequest>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Implementation of

AxAIService.chat


embed()

embed(req: Readonly<AxEmbedRequest>, options?: Readonly<AxAIServiceActionOptions>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L261

Parameters

ParameterType
reqReadonly<AxEmbedRequest>
options?Readonly<AxAIServiceActionOptions>

Returns

Promise<AxEmbedResponse>

Implementation of

AxAIService.embed


getFeatures()

getFeatures(model?: string): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L147

Parameters

ParameterType
model?string

Returns

AxAIFeatures

Implementation of

AxAIService.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L143

Returns

string

Implementation of

AxAIService.getId


getLastUsedChatModel()

getLastUsedChatModel(): unknown;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L76

Returns

unknown

Implementation of

AxAIService.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): unknown;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L79

Returns

unknown

Implementation of

AxAIService.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L82

Returns

undefined | AxModelConfig

Implementation of

AxAIService.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L295

Returns

AxLoggerFunction

Implementation of

AxAIService.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L151

Returns

AxAIServiceMetrics

Implementation of

AxAIService.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L117

Returns

undefined | AxAIModelList

Implementation of

AxAIService.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L139

Returns

string

Implementation of

AxAIService.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L291

Returns

Readonly<AxAIServiceOptions>

Implementation of

AxAIService.getOptions


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L287

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Implementation of

AxAIService.setOptions


inputOrderComparator()

static inputOrderComparator(): number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L89

Service comparator that respects the input order of services.

Returns

number


metricComparator()

static metricComparator(a: AxAIService, b: AxAIService): number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L110

Service comparator that sorts services by cost.

Parameters

ParameterType
aAxAIService
bAxAIService

Returns

number

AxBaseAI

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L72

Extended by

Type Parameters

Type Parameter
TModel
TEmbedModel
TChatRequest
TEmbedRequest
TChatResponse
TChatResponseDelta
TEmbedResponse

Implements

Constructors

Constructor

new AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse>(aiImpl: Readonly<AxAIServiceImpl<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse>>, __namedParameters: Readonly<AxBaseAIArgs<TModel, TEmbedModel>>): AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L137

Parameters

ParameterType
aiImplReadonly<AxAIServiceImpl<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse>>
__namedParametersReadonly<AxBaseAIArgs<TModel, TEmbedModel>>

Returns

AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse>

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<TModel, TEmbedModel>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L326

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<TModel, TEmbedModel>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Implementation of

AxAIService.chat


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<TModel, TEmbedModel>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L625

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions<TModel, TEmbedModel>>

Returns

Promise<AxEmbedResponse>

Implementation of

AxAIService.embed


getFeatures()

getFeatures(model?: TModel): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L265

Parameters

ParameterType
model?TModel

Returns

AxAIFeatures

Implementation of

AxAIService.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L194

Returns

string

Implementation of

AxAIService.getId


getLastUsedChatModel()

getLastUsedChatModel(): undefined | TModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L271

Returns

undefined | TModel

Implementation of

AxAIService.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): undefined | TEmbedModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L275

Returns

undefined | TEmbedModel

Implementation of

AxAIService.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L279

Returns

undefined | AxModelConfig

Implementation of

AxAIService.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L230

Returns

AxLoggerFunction

Implementation of

AxAIService.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L322

Returns

AxAIServiceMetrics

Implementation of

AxAIService.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L234

Returns

undefined | AxAIModelList

Implementation of

AxAIService.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L261

Returns

string

Implementation of

AxAIService.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L217

Returns

Readonly<AxAIServiceOptions>

Implementation of

AxAIService.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L198

Parameters

ParameterType
apiURLstring

Returns

void


setHeaders()

setHeaders(headers: () => Promise<Record<string, string>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L202

Parameters

ParameterType
headers() => Promise<Record<string, string>>

Returns

void


setName()

setName(name: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L190

Parameters

ParameterType
namestring

Returns

void


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L206

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Implementation of

AxAIService.setOptions

AxBaseOptimizer

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L447

Abstract base class for optimizers that provides common functionality and standardized handling of AxOptimizerArgs

Extended by

Type Parameters

Type ParameterDefault type
IN extends AxGenInAxGenIn
OUT extends AxGenOutAxGenOut

Implements

Constructors

Constructor

new AxBaseOptimizer<IN, OUT>(args: Readonly<AxOptimizerArgs>): AxBaseOptimizer<IN, OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L487

Parameters

ParameterType
argsReadonly<AxOptimizerArgs>

Returns

AxBaseOptimizer<IN, OUT>

Methods

compile()

abstract compile(
   program: Readonly<AxProgram<IN, OUT>>, 
   metricFn: AxMetricFn, 
options?: AxCompileOptions): Promise<AxOptimizerResult<OUT>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L682

Abstract method that must be implemented by concrete optimizers

Parameters

ParameterType
programReadonly<AxProgram<IN, OUT>>
metricFnAxMetricFn
options?AxCompileOptions

Returns

Promise<AxOptimizerResult<OUT>>

Implementation of

AxOptimizer.compile


compilePareto()

compilePareto(
   program: Readonly<AxProgram<IN, OUT>>, 
   metricFn: AxMultiMetricFn, 
options?: AxCompileOptions): Promise<AxParetoResult<OUT>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L750

Multi-objective optimization using Pareto frontier Default implementation that leverages the single-objective compile method

Parameters

ParameterTypeDescription
programReadonly<AxProgram<IN, OUT>>The program to optimize
metricFnAxMultiMetricFnMulti-objective metric function that returns multiple scores
options?AxCompileOptionsOptional configuration options

Returns

Promise<AxParetoResult<OUT>>

Pareto optimization result with frontier of non-dominated solutions

Implementation of

AxOptimizer.compilePareto


getStats()

getStats(): AxOptimizationStats;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L691

Get current optimization statistics

Returns

AxOptimizationStats

Implementation of

AxOptimizer.getStats


reset()

reset(): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L698

Reset optimizer state for reuse with different programs

Returns

void

Implementation of

AxOptimizer.reset


validateProgram()

validateProgram(program: Readonly<AxProgram<IN, OUT>>): object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L709

Basic program validation that can be extended by concrete optimizers

Parameters

ParameterType
programReadonly<AxProgram<IN, OUT>>

Returns

object

NameType
issuesstring[]
isValidboolean
suggestionsstring[]

Implementation of

AxOptimizer.validateProgram

AxBootstrapFewShot

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizers/bootstrapFewshot.ts#L20

Abstract base class for optimizers that provides common functionality and standardized handling of AxOptimizerArgs

Extends

Type Parameters

Type ParameterDefault type
IN extends AxGenInAxGenIn
OUT extends AxGenOutAxGenOut

Constructors

Constructor

new AxBootstrapFewShot<IN, OUT>(args: Readonly<AxOptimizerArgs & object>): AxBootstrapFewShot<IN, OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizers/bootstrapFewshot.ts#L35

Parameters

ParameterType
argsReadonly<AxOptimizerArgs & object>

Returns

AxBootstrapFewShot<IN, OUT>

Overrides

AxBaseOptimizer.constructor

Methods

compile()

compile(
   program: Readonly<AxProgram<IN, OUT>>, 
   metricFn: AxMetricFn, 
options?: AxBootstrapCompileOptions): Promise<AxOptimizerResult<OUT>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizers/bootstrapFewshot.ts#L204

Abstract method that must be implemented by concrete optimizers

Parameters

ParameterType
programReadonly<AxProgram<IN, OUT>>
metricFnAxMetricFn
options?AxBootstrapCompileOptions

Returns

Promise<AxOptimizerResult<OUT>>

Overrides

AxBaseOptimizer.compile


compilePareto()

compilePareto(
   program: Readonly<AxProgram<IN, OUT>>, 
   metricFn: AxMultiMetricFn, 
options?: AxCompileOptions): Promise<AxParetoResult<OUT>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L750

Multi-objective optimization using Pareto frontier Default implementation that leverages the single-objective compile method

Parameters

ParameterTypeDescription
programReadonly<AxProgram<IN, OUT>>The program to optimize
metricFnAxMultiMetricFnMulti-objective metric function that returns multiple scores
options?AxCompileOptionsOptional configuration options

Returns

Promise<AxParetoResult<OUT>>

Pareto optimization result with frontier of non-dominated solutions

Inherited from

AxBaseOptimizer.compilePareto


getStats()

getStats(): AxOptimizationStats;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L691

Get current optimization statistics

Returns

AxOptimizationStats

Inherited from

AxBaseOptimizer.getStats


reset()

reset(): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L698

Reset optimizer state for reuse with different programs

Returns

void

Inherited from

AxBaseOptimizer.reset


validateProgram()

validateProgram(program: Readonly<AxProgram<IN, OUT>>): object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L709

Basic program validation that can be extended by concrete optimizers

Parameters

ParameterType
programReadonly<AxProgram<IN, OUT>>

Returns

object

NameType
issuesstring[]
isValidboolean
suggestionsstring[]

Inherited from

AxBaseOptimizer.validateProgram

AxChainOfThought

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/cot.ts#L6

Extends

Extended by

Type Parameters

Type ParameterDefault type
IN extends AxGenInAxGenIn
OUT extends AxGenOutAxGenOut

Constructors

Constructor

new AxChainOfThought<IN, OUT>(signature: Readonly<string | AxSignature>, options?: Readonly<AxProgramForwardOptions & object>): AxChainOfThought<IN, OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/cot.ts#L10

Parameters

ParameterType
signatureReadonly<string | AxSignature>
options?Readonly<AxProgramForwardOptions & object>

Returns

AxChainOfThought<IN, OUT>

Overrides

AxGen.constructor

Methods

_forward1()

_forward1(
   ai: Readonly<AxAIService>, 
   values: IN | AxMessage<IN>[], 
options: Readonly<AxProgramForwardOptions>): AxGenStreamingOut<OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L521

Parameters

ParameterType
aiReadonly<AxAIService>
valuesIN | AxMessage<IN>[]
optionsReadonly<AxProgramForwardOptions>

Returns

AxGenStreamingOut<OUT>

Inherited from

AxGen._forward1


addAssert()

addAssert(fn: (values: Record<string, unknown>) => undefined | boolean | Promise<undefined | boolean>, message?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L154

Parameters

ParameterType
fn(values: Record<string, unknown>) => undefined | boolean | Promise<undefined | boolean>
message?string

Returns

void

Inherited from

AxGen.addAssert


addFieldProcessor()

addFieldProcessor(fieldName: string, fn: 
  | AxFieldProcessorProcess
  | AxStreamingFieldProcessorProcess): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L201

Parameters

ParameterType
fieldNamestring
fn| AxFieldProcessorProcess | AxStreamingFieldProcessorProcess

Returns

void

Inherited from

AxGen.addFieldProcessor


addStreamingAssert()

addStreamingAssert(
   fieldName: string, 
   fn: (content: string, done?: boolean) => undefined | boolean, 
   message?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L158

Parameters

ParameterType
fieldNamestring
fn(content: string, done?: boolean) => undefined | boolean
message?string

Returns

void

Inherited from

AxGen.addStreamingAssert


addStreamingFieldProcessor()

addStreamingFieldProcessor(fieldName: string, fn: 
  | AxFieldProcessorProcess
  | AxStreamingFieldProcessorProcess): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L194

Parameters

ParameterType
fieldNamestring
fn| AxFieldProcessorProcess | AxStreamingFieldProcessorProcess

Returns

void

Inherited from

AxGen.addStreamingFieldProcessor


forward()

forward(
   ai: Readonly<AxAIService>, 
   values: IN | AxMessage<IN>[], 
options?: Readonly<AxProgramForwardOptions>): Promise<OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L602

Parameters

ParameterType
aiReadonly<AxAIService>
valuesIN | AxMessage<IN>[]
options?Readonly<AxProgramForwardOptions>

Returns

Promise<OUT>

Inherited from

AxGen.forward


getSignature()

getSignature(): AxSignature;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L210

Returns

AxSignature

Inherited from

AxGen.getSignature


getTraces()

getTraces(): AxProgramTrace<IN, OUT>[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L307

Returns

AxProgramTrace<IN, OUT>[]

Inherited from

AxGen.getTraces


getUsage()

getUsage(): AxModelUsage & object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L321

Returns

AxModelUsage & object[]

Inherited from

AxGen.getUsage


register()

register(prog: Readonly<AxTunable<IN, OUT> & AxUsable>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L214

Parameters

ParameterType
progReadonly<AxTunable<IN, OUT> & AxUsable>

Returns

void

Inherited from

AxGen.register


resetUsage()

resetUsage(): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L331

Returns

void

Inherited from

AxGen.resetUsage


setDemos()

setDemos(demos: readonly AxProgramDemos<IN, OUT>[]): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L338

Parameters

ParameterType
demosreadonly AxProgramDemos<IN, OUT>[]

Returns

void

Inherited from

AxGen.setDemos


setExamples()

setExamples(examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L695

Parameters

ParameterType
examplesReadonly<AxProgramExamples<IN, OUT>>
options?Readonly<AxSetExamplesOptions>

Returns

void

Inherited from

AxGen.setExamples


setId()

setId(id: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L244

Parameters

ParameterType
idstring

Returns

void

Inherited from

AxGen.setId


setParentId()

setParentId(parentId: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L251

Parameters

ParameterType
parentIdstring

Returns

void

Inherited from

AxGen.setParentId


streamingForward()

streamingForward(
   ai: Readonly<AxAIService>, 
   values: IN | AxMessage<IN>[], 
options?: Readonly<AxProgramStreamingForwardOptions>): AxGenStreamingOut<OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L640

Parameters

ParameterType
aiReadonly<AxAIService>
valuesIN | AxMessage<IN>[]
options?Readonly<AxProgramStreamingForwardOptions>

Returns

AxGenStreamingOut<OUT>

Inherited from

AxGen.streamingForward

AxDB

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/wrap.ts#L19

Implements

Constructors

Constructor

new AxDB(args: Readonly<AxDBArgs>): AxDB;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/wrap.ts#L21

Parameters

ParameterType
argsReadonly<AxDBArgs>

Returns

AxDB

Methods

batchUpsert()

batchUpsert(batchReq: readonly AxDBUpsertRequest[], update?: boolean): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/wrap.ts#L46

Parameters

ParameterType
batchReqreadonly AxDBUpsertRequest[]
update?boolean

Returns

Promise<AxDBUpsertResponse>

Implementation of

AxDBService.batchUpsert


query()

query(req: Readonly<AxDBQueryRequest>): Promise<AxDBQueryResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/wrap.ts#L53

Parameters

ParameterType
reqReadonly<AxDBQueryRequest>

Returns

Promise<AxDBQueryResponse>

Implementation of

AxDBService.query


upsert()

upsert(req: Readonly<AxDBUpsertRequest>, update?: boolean): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/wrap.ts#L39

Parameters

ParameterType
reqReadonly<AxDBUpsertRequest>
update?boolean

Returns

Promise<AxDBUpsertResponse>

Implementation of

AxDBService.upsert

AxDBBase

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/base.ts#L22

Extended by

Implements

Constructors

Constructor

new AxDBBase(__namedParameters: Readonly<AxDBBaseArgs & object>): AxDBBase;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/base.ts#L44

Parameters

ParameterType
__namedParametersReadonly<AxDBBaseArgs & object>

Returns

AxDBBase

Properties

PropertyType
_batchUpsert?(batchReq: readonly AxDBUpsertRequest[], update?: boolean, options?: Readonly<AxDBBaseOpOptions>) => Promise<AxDBUpsertResponse>
_query?(req: Readonly<AxDBQueryRequest>, options?: Readonly<AxDBBaseOpOptions>) => Promise<AxDBQueryResponse>
_upsert?(req: Readonly<AxDBUpsertRequest>, update?: boolean, options?: Readonly<AxDBBaseOpOptions>) => Promise<AxDBUpsertResponse>

Methods

batchUpsert()

batchUpsert(req: readonly AxDBUpsertRequest[], update?: boolean): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/base.ts#L88

Parameters

ParameterType
reqreadonly AxDBUpsertRequest[]
update?boolean

Returns

Promise<AxDBUpsertResponse>

Implementation of

AxDBService.batchUpsert


query()

query(req: Readonly<AxDBQueryRequest>): Promise<AxDBQueryResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/base.ts#L128

Parameters

ParameterType
reqReadonly<AxDBQueryRequest>

Returns

Promise<AxDBQueryResponse>

Implementation of

AxDBService.query


upsert()

upsert(req: Readonly<AxDBUpsertRequest>, update?: boolean): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/base.ts#L54

Parameters

ParameterType
reqReadonly<AxDBUpsertRequest>
update?boolean

Returns

Promise<AxDBUpsertResponse>

Implementation of

AxDBService.upsert

AxDBCloudflare

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/cloudflare.ts#L44

Cloudflare: DB Service

Extends

Constructors

Constructor

new AxDBCloudflare(__namedParameters: Readonly<Omit<AxDBCloudflareArgs, "name">>): AxDBCloudflare;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/cloudflare.ts#L48

Parameters

ParameterType
__namedParametersReadonly<Omit<AxDBCloudflareArgs, "name">>

Returns

AxDBCloudflare

Overrides

AxDBBase.constructor

Properties

PropertyTypeInherited from
_batchUpsert?(batchReq: readonly AxDBUpsertRequest[], update?: boolean, options?: Readonly<AxDBBaseOpOptions>) => Promise<AxDBUpsertResponse>AxDBBase._batchUpsert
_query?(req: Readonly<AxDBQueryRequest>, options?: Readonly<AxDBBaseOpOptions>) => Promise<AxDBQueryResponse>AxDBBase._query

Methods

_upsert()

_upsert(
   req: Readonly<AxDBUpsertRequest>, 
   _update?: boolean, 
options?: Readonly<AxDBBaseOpOptions>): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/cloudflare.ts#L62

Parameters

ParameterType
reqReadonly<AxDBUpsertRequest>
_update?boolean
options?Readonly<AxDBBaseOpOptions>

Returns

Promise<AxDBUpsertResponse>

Overrides

AxDBBase._upsert

batchUpsert()

batchUpsert(
   batchReq: readonly AxDBUpsertRequest[], 
   update?: boolean, 
options?: Readonly<AxDBBaseOpOptions>): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/cloudflare.ts#L98

Parameters

ParameterType
batchReqreadonly AxDBUpsertRequest[]
update?boolean
options?Readonly<AxDBBaseOpOptions>

Returns

Promise<AxDBUpsertResponse>

Overrides

AxDBBase.batchUpsert


query()

query(req: Readonly<AxDBQueryRequest>, options?: Readonly<AxDBBaseOpOptions>): Promise<AxDBQueryResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/cloudflare.ts#L147

Parameters

ParameterType
reqReadonly<AxDBQueryRequest>
options?Readonly<AxDBBaseOpOptions>

Returns

Promise<AxDBQueryResponse>

Overrides

AxDBBase.query


upsert()

upsert(req: Readonly<AxDBUpsertRequest>, update?: boolean): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/base.ts#L54

Parameters

ParameterType
reqReadonly<AxDBUpsertRequest>
update?boolean

Returns

Promise<AxDBUpsertResponse>

Inherited from

AxDBBase.upsert

AxDBManager

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/docs/manager.ts#L30

Constructors

Constructor

new AxDBManager(__namedParameters: Readonly<AxDBManagerArgs>): AxDBManager;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/docs/manager.ts#L37

Parameters

ParameterType
__namedParametersReadonly<AxDBManagerArgs>

Returns

AxDBManager

Methods

insert()

insert(text: Readonly<string | string[]>, options?: Readonly<{
  abortSignal?: AbortSignal;
  batchSize?: number;
  maxWordsPerChunk?: number;
  minWordsPerChunk?: number;
}>): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/docs/manager.ts#L50

Parameters

ParameterType
textReadonly<string | string[]>
options?Readonly<{ abortSignal?: AbortSignal; batchSize?: number; maxWordsPerChunk?: number; minWordsPerChunk?: number; }>

Returns

Promise<void>


query()

query(query: Readonly<string | number | string[] | number[]>, __namedParameters: 
  | undefined
  | Readonly<{
  abortSignal?: AbortSignal;
  topPercent?: number;
}>): Promise<AxDBMatch[][]>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/docs/manager.ts#L112

Parameters

ParameterType
queryReadonly<string | number | string[] | number[]>
__namedParameters| undefined | Readonly<{ abortSignal?: AbortSignal; topPercent?: number; }>

Returns

Promise<AxDBMatch[][]>

AxDBMemory

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/memory.ts#L20

MemoryDB: DB Service

Extends

Constructors

Constructor

new AxDBMemory(__namedParameters: Readonly<Omit<AxDBMemoryArgs, "name">>): AxDBMemory;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/memory.ts#L23

Parameters

ParameterType
__namedParametersReadonly<Omit<AxDBMemoryArgs, "name">>

Returns

AxDBMemory

Overrides

AxDBBase.constructor

Methods

_batchUpsert()

_batchUpsert(
   batchReq: readonly AxDBUpsertRequest[], 
   update?: boolean, 
_options?: Readonly<AxDBBaseOpOptions>): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/memory.ts#L50

Parameters

ParameterType
batchReqreadonly AxDBUpsertRequest[]
update?boolean
_options?Readonly<AxDBBaseOpOptions>

Returns

Promise<AxDBUpsertResponse>

Overrides

AxDBBase._batchUpsert

_query()

_query(req: Readonly<AxDBQueryRequest>, _options?: Readonly<AxDBBaseOpOptions>): Promise<AxDBQueryResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/memory.ts#L65

Parameters

ParameterType
reqReadonly<AxDBQueryRequest>
_options?Readonly<AxDBBaseOpOptions>

Returns

Promise<AxDBQueryResponse>

Overrides

AxDBBase._query

_upsert()

_upsert(
   req: Readonly<AxDBUpsertRequest>, 
   _update?: boolean, 
_options?: Readonly<AxDBBaseOpOptions>): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/memory.ts#L28

Parameters

ParameterType
reqReadonly<AxDBUpsertRequest>
_update?boolean
_options?Readonly<AxDBBaseOpOptions>

Returns

Promise<AxDBUpsertResponse>

Overrides

AxDBBase._upsert

batchUpsert()

batchUpsert(req: readonly AxDBUpsertRequest[], update?: boolean): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/base.ts#L88

Parameters

ParameterType
reqreadonly AxDBUpsertRequest[]
update?boolean

Returns

Promise<AxDBUpsertResponse>

Inherited from

AxDBBase.batchUpsert


clearDB()

clearDB(): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/memory.ts#L100

Returns

void


getDB()

getDB(): AxDBState;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/memory.ts#L92

Returns

AxDBState


query()

query(req: Readonly<AxDBQueryRequest>): Promise<AxDBQueryResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/base.ts#L128

Parameters

ParameterType
reqReadonly<AxDBQueryRequest>

Returns

Promise<AxDBQueryResponse>

Inherited from

AxDBBase.query


setDB()

setDB(state: AxDBState): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/memory.ts#L96

Parameters

ParameterType
stateAxDBState

Returns

void


upsert()

upsert(req: Readonly<AxDBUpsertRequest>, update?: boolean): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/base.ts#L54

Parameters

ParameterType
reqReadonly<AxDBUpsertRequest>
update?boolean

Returns

Promise<AxDBUpsertResponse>

Inherited from

AxDBBase.upsert

AxDBPinecone

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/pinecone.ts#L58

Pinecone: DB Service

Extends

Constructors

Constructor

new AxDBPinecone(__namedParameters: Readonly<Omit<AxDBPineconeArgs, "name">>): AxDBPinecone;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/pinecone.ts#L62

Parameters

ParameterType
__namedParametersReadonly<Omit<AxDBPineconeArgs, "name">>

Returns

AxDBPinecone

Overrides

AxDBBase.constructor

Properties

PropertyTypeInherited from
_query?(req: Readonly<AxDBQueryRequest>, options?: Readonly<AxDBBaseOpOptions>) => Promise<AxDBQueryResponse>AxDBBase._query

Methods

_batchUpsert()

_batchUpsert(
   batchReq: readonly AxDBUpsertRequest[], 
   _update?: boolean, 
options?: Readonly<AxDBBaseOpOptions>): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/pinecone.ts#L85

Parameters

ParameterType
batchReqreadonly AxDBUpsertRequest[]
_update?boolean
options?Readonly<AxDBBaseOpOptions>

Returns

Promise<AxDBUpsertResponse>

Overrides

AxDBBase._batchUpsert

_upsert()

_upsert(
   req: Readonly<AxDBUpsertRequest>, 
   update?: boolean, 
options?: Readonly<AxDBBaseOpOptions>): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/pinecone.ts#L76

Parameters

ParameterType
reqReadonly<AxDBUpsertRequest>
update?boolean
options?Readonly<AxDBBaseOpOptions>

Returns

Promise<AxDBUpsertResponse>

Overrides

AxDBBase._upsert

batchUpsert()

batchUpsert(req: readonly AxDBUpsertRequest[], update?: boolean): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/base.ts#L88

Parameters

ParameterType
reqreadonly AxDBUpsertRequest[]
update?boolean

Returns

Promise<AxDBUpsertResponse>

Inherited from

AxDBBase.batchUpsert


query()

query(req: Readonly<AxDBQueryRequest>, options?: Readonly<AxDBBaseOpOptions>): Promise<AxDBQueryResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/pinecone.ts#L111

Parameters

ParameterType
reqReadonly<AxDBQueryRequest>
options?Readonly<AxDBBaseOpOptions>

Returns

Promise<AxDBQueryResponse>

Overrides

AxDBBase.query


upsert()

upsert(req: Readonly<AxDBUpsertRequest>, update?: boolean): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/base.ts#L54

Parameters

ParameterType
reqReadonly<AxDBUpsertRequest>
update?boolean

Returns

Promise<AxDBUpsertResponse>

Inherited from

AxDBBase.upsert

AxDBWeaviate

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/weaviate.ts#L39

Weaviate: DB Service

Extends

Constructors

Constructor

new AxDBWeaviate(__namedParameters: Readonly<Omit<AxDBWeaviateArgs, "name">>): AxDBWeaviate;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/weaviate.ts#L43

Parameters

ParameterType
__namedParametersReadonly<Omit<AxDBWeaviateArgs, "name">>

Returns

AxDBWeaviate

Overrides

AxDBBase.constructor

Methods

_batchUpsert()

_batchUpsert(
   batchReq: readonly AxDBUpsertRequest[], 
   update?: boolean, 
options?: Readonly<AxDBBaseOpOptions>): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/weaviate.ts#L93

Parameters

ParameterType
batchReqreadonly AxDBUpsertRequest[]
update?boolean
options?Readonly<AxDBBaseOpOptions>

Returns

Promise<AxDBUpsertResponse>

Overrides

AxDBBase._batchUpsert

_query()

_query(req: Readonly<AxDBQueryRequest>, options?: Readonly<AxDBBaseOpOptions>): Promise<AxDBQueryResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/weaviate.ts#L138

Parameters

ParameterType
reqReadonly<AxDBQueryRequest>
options?Readonly<AxDBBaseOpOptions>

Returns

Promise<AxDBQueryResponse>

Overrides

AxDBBase._query

_upsert()

_upsert(
   req: Readonly<AxDBUpsertRequest>, 
   update?: boolean, 
options?: Readonly<AxDBBaseOpOptions>): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/weaviate.ts#L57

Parameters

ParameterType
reqReadonly<AxDBUpsertRequest>
update?boolean
options?Readonly<AxDBBaseOpOptions>

Returns

Promise<AxDBUpsertResponse>

Overrides

AxDBBase._upsert

batchUpsert()

batchUpsert(req: readonly AxDBUpsertRequest[], update?: boolean): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/base.ts#L88

Parameters

ParameterType
reqreadonly AxDBUpsertRequest[]
update?boolean

Returns

Promise<AxDBUpsertResponse>

Inherited from

AxDBBase.batchUpsert


query()

query(req: Readonly<AxDBQueryRequest>): Promise<AxDBQueryResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/base.ts#L128

Parameters

ParameterType
reqReadonly<AxDBQueryRequest>

Returns

Promise<AxDBQueryResponse>

Inherited from

AxDBBase.query


upsert()

upsert(req: Readonly<AxDBUpsertRequest>, update?: boolean): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/base.ts#L54

Parameters

ParameterType
reqReadonly<AxDBUpsertRequest>
update?boolean

Returns

Promise<AxDBUpsertResponse>

Inherited from

AxDBBase.upsert

AxDefaultCostTracker

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L382

Implements

Constructors

Constructor

new AxDefaultCostTracker(options?: AxCostTrackerOptions): AxDefaultCostTracker;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L391

Parameters

ParameterType
options?AxCostTrackerOptions

Returns

AxDefaultCostTracker

Methods

getCurrentCost()

getCurrentCost(): number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L402

Returns

number

Implementation of

AxCostTracker.getCurrentCost


getTokenUsage()

getTokenUsage(): Record<string, number>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L412

Returns

Record<string, number>

Implementation of

AxCostTracker.getTokenUsage


getTotalTokens()

getTotalTokens(): number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L416

Returns

number

Implementation of

AxCostTracker.getTotalTokens


isLimitReached()

isLimitReached(): boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L420

Returns

boolean

Implementation of

AxCostTracker.isLimitReached


reset()

reset(): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L437

Returns

void

Implementation of

AxCostTracker.reset


trackTokens()

trackTokens(count: number, model: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L397

Parameters

ParameterType
countnumber
modelstring

Returns

void

Implementation of

AxCostTracker.trackTokens

AxDefaultResultReranker

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/docs/reranker.ts#L8

Extends

Constructors

Constructor

new AxDefaultResultReranker(options?: Readonly<AxProgramForwardOptions>): AxDefaultResultReranker;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/docs/reranker.ts#L12

Parameters

ParameterType
options?Readonly<AxProgramForwardOptions>

Returns

AxDefaultResultReranker

Overrides

AxGen.constructor

Methods

_forward1()

_forward1(
   ai: Readonly<AxAIService>, 
   values: 
  | AxRerankerIn
  | AxMessage<AxRerankerIn>[], 
options: Readonly<AxProgramForwardOptions>): AxGenStreamingOut<AxRerankerOut>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L521

Parameters

ParameterType
aiReadonly<AxAIService>
values| AxRerankerIn | AxMessage<AxRerankerIn>[]
optionsReadonly<AxProgramForwardOptions>

Returns

AxGenStreamingOut<AxRerankerOut>

Inherited from

AxGen._forward1


addAssert()

addAssert(fn: (values: Record<string, unknown>) => undefined | boolean | Promise<undefined | boolean>, message?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L154

Parameters

ParameterType
fn(values: Record<string, unknown>) => undefined | boolean | Promise<undefined | boolean>
message?string

Returns

void

Inherited from

AxGen.addAssert


addFieldProcessor()

addFieldProcessor(fieldName: string, fn: 
  | AxFieldProcessorProcess
  | AxStreamingFieldProcessorProcess): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L201

Parameters

ParameterType
fieldNamestring
fn| AxFieldProcessorProcess | AxStreamingFieldProcessorProcess

Returns

void

Inherited from

AxGen.addFieldProcessor


addStreamingAssert()

addStreamingAssert(
   fieldName: string, 
   fn: (content: string, done?: boolean) => undefined | boolean, 
   message?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L158

Parameters

ParameterType
fieldNamestring
fn(content: string, done?: boolean) => undefined | boolean
message?string

Returns

void

Inherited from

AxGen.addStreamingAssert


addStreamingFieldProcessor()

addStreamingFieldProcessor(fieldName: string, fn: 
  | AxFieldProcessorProcess
  | AxStreamingFieldProcessorProcess): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L194

Parameters

ParameterType
fieldNamestring
fn| AxFieldProcessorProcess | AxStreamingFieldProcessorProcess

Returns

void

Inherited from

AxGen.addStreamingFieldProcessor


forward()

forward(
   ai: Readonly<AxAIService>, 
   input: Readonly<AxRerankerIn>, 
options?: Readonly<AxProgramForwardOptions>): Promise<AxRerankerOut>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/docs/reranker.ts#L19

Parameters

ParameterType
aiReadonly<AxAIService>
inputReadonly<AxRerankerIn>
options?Readonly<AxProgramForwardOptions>

Returns

Promise<AxRerankerOut>

Overrides

AxGen.forward


getSignature()

getSignature(): AxSignature;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L210

Returns

AxSignature

Inherited from

AxGen.getSignature


getTraces()

getTraces(): AxProgramTrace<AxRerankerIn, AxRerankerOut>[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L307

Returns

AxProgramTrace<AxRerankerIn, AxRerankerOut>[]

Inherited from

AxGen.getTraces


getUsage()

getUsage(): AxModelUsage & object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L321

Returns

AxModelUsage & object[]

Inherited from

AxGen.getUsage


register()

register(prog: Readonly<AxTunable<IN, OUT> & AxUsable>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L214

Parameters

ParameterType
progReadonly<AxTunable<IN, OUT> & AxUsable>

Returns

void

Inherited from

AxGen.register


resetUsage()

resetUsage(): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L331

Returns

void

Inherited from

AxGen.resetUsage


setDemos()

setDemos(demos: readonly AxProgramDemos<AxRerankerIn, AxRerankerOut>[]): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L338

Parameters

ParameterType
demosreadonly AxProgramDemos<AxRerankerIn, AxRerankerOut>[]

Returns

void

Inherited from

AxGen.setDemos


setExamples()

setExamples(examples: Readonly<AxProgramExamples<AxRerankerIn, AxRerankerOut>>, options?: Readonly<AxSetExamplesOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L695

Parameters

ParameterType
examplesReadonly<AxProgramExamples<AxRerankerIn, AxRerankerOut>>
options?Readonly<AxSetExamplesOptions>

Returns

void

Inherited from

AxGen.setExamples


setId()

setId(id: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L244

Parameters

ParameterType
idstring

Returns

void

Inherited from

AxGen.setId


setParentId()

setParentId(parentId: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L251

Parameters

ParameterType
parentIdstring

Returns

void

Inherited from

AxGen.setParentId


streamingForward()

streamingForward(
   ai: Readonly<AxAIService>, 
   values: 
  | AxRerankerIn
  | AxMessage<AxRerankerIn>[], 
options?: Readonly<AxProgramStreamingForwardOptions>): AxGenStreamingOut<AxRerankerOut>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L640

Parameters

ParameterType
aiReadonly<AxAIService>
values| AxRerankerIn | AxMessage<AxRerankerIn>[]
options?Readonly<AxProgramStreamingForwardOptions>

Returns

AxGenStreamingOut<AxRerankerOut>

Inherited from

AxGen.streamingForward

AxDockerSession

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/docker.ts#L56

Constructors

Constructor

new AxDockerSession(apiUrl: string): AxDockerSession;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/docker.ts#L60

Parameters

ParameterTypeDefault value
apiUrlstring'http://localhost:2375'

Returns

AxDockerSession

Methods

connectToContainer()

connectToContainer(containerId: string): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/docker.ts#L186

Parameters

ParameterType
containerIdstring

Returns

Promise<void>


createContainer()

createContainer(__namedParameters: Readonly<{
  doNotPullImage?: boolean;
  imageName: string;
  tag?: string;
  volumes?: object[];
}>): Promise<{
  Id: string;
}>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/docker.ts#L80

Parameters

ParameterType
__namedParametersReadonly<{ doNotPullImage?: boolean; imageName: string; tag?: string; volumes?: object[]; }>

Returns

Promise<{ Id: string; }>


executeCommand()

executeCommand(command: string): Promise<string>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/docker.ts#L274

Parameters

ParameterType
commandstring

Returns

Promise<string>


findOrCreateContainer()

findOrCreateContainer(__namedParameters: Readonly<{
  doNotPullImage?: boolean;
  imageName: string;
  tag: string;
  volumes?: object[];
}>): Promise<{
  Id: string;
  isNew: boolean;
}>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/docker.ts#L128

Parameters

ParameterType
__namedParametersReadonly<{ doNotPullImage?: boolean; imageName: string; tag: string; volumes?: object[]; }>

Returns

Promise<{ Id: string; isNew: boolean; }>


getContainerLogs()

getContainerLogs(): Promise<string>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/docker.ts#L263

Returns

Promise<string>


listContainers()

listContainers(all: boolean): Promise<AxDockerContainer[]>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/docker.ts#L256

Parameters

ParameterTypeDefault value
allbooleanfalse

Returns

Promise<AxDockerContainer[]>


pullImage()

pullImage(imageName: string): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/docker.ts#L64

Parameters

ParameterType
imageNamestring

Returns

Promise<void>


startContainer()

startContainer(): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/docker.ts#L169

Returns

Promise<void>


stopContainers()

stopContainers(__namedParameters: Readonly<{
  remove?: boolean;
  tag?: string;
  timeout?: number;
}>): Promise<object[]>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/docker.ts#L198

Parameters

ParameterType
__namedParametersReadonly<{ remove?: boolean; tag?: string; timeout?: number; }>

Returns

Promise<object[]>


toFunction()

toFunction(): AxFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/docker.ts#L373

Returns

AxFunction

AxEmbeddingAdapter

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/embed.ts#L7

Constructors

Constructor

new AxEmbeddingAdapter(__namedParameters: Readonly<{
  ai: AxAIService;
  func: (args: readonly number[], extra?: Readonly<AxAIServiceActionOptions>) => Promise<unknown>;
  info: Readonly<{
     argumentDescription: string;
     description: string;
     name: string;
  }>;
}>): AxEmbeddingAdapter;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/embed.ts#L19

Parameters

ParameterType
__namedParametersReadonly<{ ai: AxAIService; func: (args: readonly number[], extra?: Readonly<AxAIServiceActionOptions>) => Promise<unknown>; info: Readonly<{ argumentDescription: string; description: string; name: string; }>; }>

Returns

AxEmbeddingAdapter

Methods

toFunction()

toFunction(): AxFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/embed.ts#L60

Returns

AxFunction

AxFlow

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/flow/flow.ts#L68

AxFlow - A fluent, chainable API for building and orchestrating complex, stateful AI programs.

Allows developers to define computational nodes declaratively and then compose them imperatively using loops, conditionals, and dynamic context.

Example

const flow = new AxFlow<{ topic: string }, { summary: string; analysis: string }>()
  .node('summarizer', { 'text:string': { summary: f.string() } })
  .node('analyzer', { 'text:string': { analysis: f.string() } })
  .map(input => ({ originalText: `Some long text about ${input.topic}` }))
  .execute('summarizer', state => ({ text: state.originalText }), { ai: cheapAI })
  .execute('analyzer', state => ({ text: state.originalText }), { ai: powerfulAI })
  .map(state => ({
    summary: state.summarizerResult.summary,
    analysis: state.analyzerResult.analysis
  }))

const result = await flow.forward(ai, { topic: "the future of AI" })

Extends

Type Parameters

Type Parameter
IN extends AxGenIn
OUT extends AxGenOut

Constructors

Constructor

new AxFlow<IN, OUT>(signature: NonNullable<
  | undefined
  | Readonly<
  | string
  | AxSignatureConfig
| AxSignature>>): AxFlow<IN, OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/flow/flow.ts#L78

Parameters

ParameterTypeDefault value
signatureNonNullable< | undefined | Readonly< | string | AxSignatureConfig | AxSignature>>'userInput:string -> flowOutput:string'

Returns

AxFlow<IN, OUT>

Overrides

AxProgramWithSignature.constructor

Methods

endWhile()

endWhile(): this;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/flow/flow.ts#L292

Marks the end of a loop block.

Returns

this

this (for chaining)


execute()

execute(
   nodeName: string, 
   mapping: (state: AxFlowState) => Record<string, AxFieldValue>, 
   dynamicContext?: AxFlowDynamicContext): this;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/flow/flow.ts#L212

Executes a previously defined node.

Example

flow.execute('summarizer', state => ({ text: state.originalText }), { ai: cheapAI })

Parameters

ParameterTypeDescription
nodeNamestringThe name of the node to execute (must exist in the nodes map)
mapping(state: AxFlowState) => Record<string, AxFieldValue>Function that takes the current state and returns the input object required by the node
dynamicContext?AxFlowDynamicContextOptional object to override the AI service or options for this specific step

Returns

this

this (for chaining)


forward()

forward(
   ai: Readonly<AxAIService>, 
   values: IN, 
options?: Readonly<AxProgramForwardOptions>): Promise<OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/flow/flow.ts#L340

Executes the flow with the given AI service and input values.

Parameters

ParameterTypeDescription
aiReadonly<AxAIService>The AI service to use as the default for all steps
valuesINThe input values for the flow
options?Readonly<AxProgramForwardOptions>Optional forward options to use as defaults

Returns

Promise<OUT>

Promise that resolves to the final output

Overrides

AxProgramWithSignature.forward


getSignature()

getSignature(): AxSignature;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L210

Returns

AxSignature

Inherited from

AxProgramWithSignature.getSignature


getTraces()

getTraces(): AxProgramTrace<IN, OUT>[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L307

Returns

AxProgramTrace<IN, OUT>[]

Inherited from

AxProgramWithSignature.getTraces


getUsage()

getUsage(): AxModelUsage & object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L321

Returns

AxModelUsage & object[]

Inherited from

AxProgramWithSignature.getUsage


map()

map(transform: (state: AxFlowState) => AxFlowState): this;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/flow/flow.ts#L192

Applies a synchronous transformation to the state object.

Example

flow.map(state => ({ ...state, processedText: state.text.toLowerCase() }))

Parameters

ParameterTypeDescription
transform(state: AxFlowState) => AxFlowStateFunction that takes the current state and returns a new state

Returns

this

this (for chaining)


node()

node(name: string, signature: Record<string, Record<string, unknown>>): this;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/flow/flow.ts#L99

Declares a reusable computational node and its input/output signature.

Example

flow.node('summarizer', { 'text:string': { summary: f.string() } })

Parameters

ParameterTypeDescription
namestringThe name of the node
signatureRecord<string, Record<string, unknown>>An object where the key is a string representation of inputs and the value is an object representing outputs

Returns

this

this (for chaining)


register()

register(prog: Readonly<AxTunable<IN, OUT> & AxUsable>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L214

Parameters

ParameterType
progReadonly<AxTunable<IN, OUT> & AxUsable>

Returns

void

Inherited from

AxProgramWithSignature.register


resetUsage()

resetUsage(): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L331

Returns

void

Inherited from

AxProgramWithSignature.resetUsage


setDemos()

setDemos(demos: readonly AxProgramDemos<IN, OUT>[]): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L338

Parameters

ParameterType
demosreadonly AxProgramDemos<IN, OUT>[]

Returns

void

Inherited from

AxProgramWithSignature.setDemos


setExamples()

setExamples(examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L257

Parameters

ParameterType
examplesReadonly<AxProgramExamples<IN, OUT>>
options?Readonly<AxSetExamplesOptions>

Returns

void

Inherited from

AxProgramWithSignature.setExamples


setId()

setId(id: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L244

Parameters

ParameterType
idstring

Returns

void

Inherited from

AxProgramWithSignature.setId


setParentId()

setParentId(parentId: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L251

Parameters

ParameterType
parentIdstring

Returns

void

Inherited from

AxProgramWithSignature.setParentId


streamingForward()

streamingForward(
   _ai: Readonly<AxAIService>, 
   _values: IN | AxMessage<IN>[], 
_options?: Readonly<AxProgramStreamingForwardOptions>): AxGenStreamingOut<OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L233

Parameters

ParameterType
_aiReadonly<AxAIService>
_valuesIN | AxMessage<IN>[]
_options?Readonly<AxProgramStreamingForwardOptions>

Returns

AxGenStreamingOut<OUT>

Inherited from

AxProgramWithSignature.streamingForward


while()

while(condition: (state: AxFlowState) => boolean): this;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/flow/flow.ts#L262

Marks the beginning of a loop block.

Example

flow.while(state => state.iterations < 3)
  .map(state => ({ ...state, iterations: (state.iterations || 0) + 1 }))
  .endWhile()

Parameters

ParameterTypeDescription
condition(state: AxFlowState) => booleanFunction that takes the current state and returns a boolean

Returns

this

this (for chaining)

AxFunctionProcessor

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/functions.ts#L107

Constructors

Constructor

new AxFunctionProcessor(funcList: readonly AxFunction[]): AxFunctionProcessor;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/functions.ts#L110

Parameters

ParameterType
funcListreadonly AxFunction[]

Returns

AxFunctionProcessor

Methods

execute()

execute(func: Readonly<AxChatResponseFunctionCall>, options?: Readonly<AxAIServiceActionOptions>): Promise<string>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/functions.ts#L158

Parameters

ParameterType
funcReadonly<AxChatResponseFunctionCall>
options?Readonly<AxAIServiceActionOptions>

Returns

Promise<string>

AxFunctionError

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/functions.ts#L13

Extends

  • Error

Constructors

Constructor

new AxFunctionError(fields: object[]): AxFunctionError;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/functions.ts#L14

Parameters

ParameterType
fieldsobject[]

Returns

AxFunctionError

Overrides

Error.constructor

Properties

PropertyModifierTypeDescriptionInherited from
cause?publicunknown-Error.cause
messagepublicstring-Error.message
namepublicstring-Error.name
stack?publicstring-Error.stack
stackTraceLimitstaticnumberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.Error.stackTraceLimit

Methods

getFields()

getFields(): object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/functions.ts#L24

Returns

object[]


toString()

toString(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/functions.ts#L26

Returns a string representation of an object.

Returns

string


captureStackTrace()

static captureStackTrace(targetObject: object, constructorOpt?: Function): void;

Defined in: node_modules/@types/node/globals.d.ts:145

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();

Parameters

ParameterType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

Error.captureStackTrace

prepareStackTrace()

static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;

Defined in: node_modules/@types/node/globals.d.ts:149

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Parameters

ParameterType
errError
stackTracesCallSite[]

Returns

any

Inherited from

Error.prepareStackTrace

AxGen

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L99

Extends

Extended by

Type Parameters

Type ParameterDefault type
IN extends AxGenInAxGenIn
OUT extends AxGenOutAxGenOut

Constructors

Constructor

new AxGen<IN, OUT>(signature: NonNullable<
  | undefined
  | Readonly<
  | string
  | AxSignatureConfig
| AxSignature>>, options?: Readonly<AxProgramForwardOptions>): AxGen<IN, OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L113

Parameters

ParameterType
signatureNonNullable< | undefined | Readonly< | string | AxSignatureConfig | AxSignature>>
options?Readonly<AxProgramForwardOptions>

Returns

AxGen<IN, OUT>

Overrides

AxProgramWithSignature.constructor

Methods

_forward1()

_forward1(
   ai: Readonly<AxAIService>, 
   values: IN | AxMessage<IN>[], 
options: Readonly<AxProgramForwardOptions>): AxGenStreamingOut<OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L521

Parameters

ParameterType
aiReadonly<AxAIService>
valuesIN | AxMessage<IN>[]
optionsReadonly<AxProgramForwardOptions>

Returns

AxGenStreamingOut<OUT>


addAssert()

addAssert(fn: (values: Record<string, unknown>) => undefined | boolean | Promise<undefined | boolean>, message?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L154

Parameters

ParameterType
fn(values: Record<string, unknown>) => undefined | boolean | Promise<undefined | boolean>
message?string

Returns

void


addFieldProcessor()

addFieldProcessor(fieldName: string, fn: 
  | AxFieldProcessorProcess
  | AxStreamingFieldProcessorProcess): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L201

Parameters

ParameterType
fieldNamestring
fn| AxFieldProcessorProcess | AxStreamingFieldProcessorProcess

Returns

void


addStreamingAssert()

addStreamingAssert(
   fieldName: string, 
   fn: (content: string, done?: boolean) => undefined | boolean, 
   message?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L158

Parameters

ParameterType
fieldNamestring
fn(content: string, done?: boolean) => undefined | boolean
message?string

Returns

void


addStreamingFieldProcessor()

addStreamingFieldProcessor(fieldName: string, fn: 
  | AxFieldProcessorProcess
  | AxStreamingFieldProcessorProcess): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L194

Parameters

ParameterType
fieldNamestring
fn| AxFieldProcessorProcess | AxStreamingFieldProcessorProcess

Returns

void


forward()

forward(
   ai: Readonly<AxAIService>, 
   values: IN | AxMessage<IN>[], 
options?: Readonly<AxProgramForwardOptions>): Promise<OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L602

Parameters

ParameterType
aiReadonly<AxAIService>
valuesIN | AxMessage<IN>[]
options?Readonly<AxProgramForwardOptions>

Returns

Promise<OUT>

Overrides

AxProgramWithSignature.forward


getSignature()

getSignature(): AxSignature;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L210

Returns

AxSignature

Inherited from

AxProgramWithSignature.getSignature


getTraces()

getTraces(): AxProgramTrace<IN, OUT>[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L307

Returns

AxProgramTrace<IN, OUT>[]

Inherited from

AxProgramWithSignature.getTraces


getUsage()

getUsage(): AxModelUsage & object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L321

Returns

AxModelUsage & object[]

Inherited from

AxProgramWithSignature.getUsage


register()

register(prog: Readonly<AxTunable<IN, OUT> & AxUsable>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L214

Parameters

ParameterType
progReadonly<AxTunable<IN, OUT> & AxUsable>

Returns

void

Inherited from

AxProgramWithSignature.register


resetUsage()

resetUsage(): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L331

Returns

void

Inherited from

AxProgramWithSignature.resetUsage


setDemos()

setDemos(demos: readonly AxProgramDemos<IN, OUT>[]): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L338

Parameters

ParameterType
demosreadonly AxProgramDemos<IN, OUT>[]

Returns

void

Inherited from

AxProgramWithSignature.setDemos


setExamples()

setExamples(examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L695

Parameters

ParameterType
examplesReadonly<AxProgramExamples<IN, OUT>>
options?Readonly<AxSetExamplesOptions>

Returns

void

Overrides

AxProgramWithSignature.setExamples


setId()

setId(id: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L244

Parameters

ParameterType
idstring

Returns

void

Inherited from

AxProgramWithSignature.setId


setParentId()

setParentId(parentId: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L251

Parameters

ParameterType
parentIdstring

Returns

void

Inherited from

AxProgramWithSignature.setParentId


streamingForward()

streamingForward(
   ai: Readonly<AxAIService>, 
   values: IN | AxMessage<IN>[], 
options?: Readonly<AxProgramStreamingForwardOptions>): AxGenStreamingOut<OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L640

Parameters

ParameterType
aiReadonly<AxAIService>
valuesIN | AxMessage<IN>[]
options?Readonly<AxProgramStreamingForwardOptions>

Returns

AxGenStreamingOut<OUT>

Overrides

AxProgramWithSignature.streamingForward

AxGenerateError

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L733

Extends

  • Error

Constructors

Constructor

new AxGenerateError(
   message: string, 
   details: Readonly<AxGenerateErrorDetails>, 
   options?: ErrorOptions): AxGenerateError;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L736

Parameters

ParameterType
messagestring
detailsReadonly<AxGenerateErrorDetails>
options?ErrorOptions

Returns

AxGenerateError

Overrides

Error.constructor

Properties

PropertyModifierTypeDescriptionInherited from
cause?publicunknown-Error.cause
detailsreadonlyAxGenerateErrorDetails--
messagepublicstring-Error.message
namepublicstring-Error.name
stack?publicstring-Error.stack
stackTraceLimitstaticnumberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.Error.stackTraceLimit

Methods

captureStackTrace()

static captureStackTrace(targetObject: object, constructorOpt?: Function): void;

Defined in: node_modules/@types/node/globals.d.ts:145

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();

Parameters

ParameterType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

Error.captureStackTrace

prepareStackTrace()

static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;

Defined in: node_modules/@types/node/globals.d.ts:149

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Parameters

ParameterType
errError
stackTracesCallSite[]

Returns

any

Inherited from

Error.prepareStackTrace

AxHFDataLoader

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/loader.ts#L5

Constructors

Constructor

new AxHFDataLoader(__namedParameters: Readonly<{
  config: string;
  dataset: string;
  options?: Readonly<{
     length?: number;
     offset?: number;
  }>;
  split: string;
}>): AxHFDataLoader;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/loader.ts#L14

Parameters

ParameterType
__namedParametersReadonly<{ config: string; dataset: string; options?: Readonly<{ length?: number; offset?: number; }>; split: string; }>

Returns

AxHFDataLoader

Methods

getData()

getData(): AxDataRow[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/loader.ts#L67

Returns

AxDataRow[]


getRows()

getRows<T>(__namedParameters: Readonly<{
  count: number;
  fields: readonly string[];
  renameMap?: Record<string, string>;
}>): Promise<T[]>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/loader.ts#L71

Type Parameters

Type Parameter
T

Parameters

ParameterType
__namedParametersReadonly<{ count: number; fields: readonly string[]; renameMap?: Record<string, string>; }>

Returns

Promise<T[]>


loadData()

loadData(): Promise<AxDataRow[]>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/loader.ts#L51

Returns

Promise<AxDataRow[]>


setData()

setData(rows: AxDataRow[]): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/loader.ts#L63

Parameters

ParameterType
rowsAxDataRow[]

Returns

void

AxInstanceRegistry

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/registry.ts#L10

Type Parameters

Type Parameter
T extends AxTunable<IN, OUT>
IN extends AxGenIn
OUT extends AxGenOut

Constructors

Constructor

new AxInstanceRegistry<T, IN, OUT>(): AxInstanceRegistry<T, IN, OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/registry.ts#L17

Returns

AxInstanceRegistry<T, IN, OUT>

Methods

[iterator]()

iterator: Generator<undefined | AxInstanceRegistryItem<T, IN, OUT>, void, unknown>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/registry.ts#L25

Returns

Generator<undefined | AxInstanceRegistryItem<T, IN, OUT>, void, unknown>


register()

register(instance: AxInstanceRegistryItem<T, IN, OUT>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/registry.ts#L21

Parameters

ParameterType
instanceAxInstanceRegistryItem<T, IN, OUT>

Returns

void

AxJSInterpreter

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/code.ts#L29

Constructors

Constructor

new AxJSInterpreter(__namedParameters: 
  | undefined
  | Readonly<{
  permissions?: readonly AxJSInterpreterPermission[];
}>): AxJSInterpreter;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/code.ts#L32

Parameters

ParameterType
__namedParameters| undefined | Readonly<{ permissions?: readonly AxJSInterpreterPermission[]; }>

Returns

AxJSInterpreter

Methods

toFunction()

toFunction(): AxFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/code.ts#L67

Returns

AxFunction

AxMCPHTTPSSETransport

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L8

Implements

Constructors

Constructor

new AxMCPHTTPSSETransport(sseUrl: string): AxMCPHTTPSSETransport;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L13

Parameters

ParameterType
sseUrlstring

Returns

AxMCPHTTPSSETransport

Methods

connect()

connect(): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L17

Connects to the transport if needed This method is optional and only required for transports that need connection setup

Returns

Promise<void>

Implementation of

AxMCPTransport.connect


send()

send(message: JSONRPCNotification | JSONRPCRequest<unknown>): Promise<JSONRPCResponse<unknown>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L41

Sends a JSON-RPC request or notification and returns the response

Parameters

ParameterTypeDescription
messageJSONRPCNotification | JSONRPCRequest<unknown>The JSON-RPC request or notification to send

Returns

Promise<JSONRPCResponse<unknown>>

A Promise that resolves to the JSON-RPC response

Implementation of

AxMCPTransport.send


sendNotification()

sendNotification(message: Readonly<JSONRPCNotification>): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L63

Sends a JSON-RPC notification

Parameters

ParameterTypeDescription
messageReadonly<JSONRPCNotification>The JSON-RPC notification to send

Returns

Promise<void>

Implementation of

AxMCPTransport.sendNotification

AxMCPClient

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/client.ts#L58

Constructors

Constructor

new AxMCPClient(transport: AxMCPTransport, options: Readonly<AxMCPClientOptions>): AxMCPClient;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/client.ts#L69

Parameters

ParameterType
transportAxMCPTransport
optionsReadonly<AxMCPClientOptions>

Returns

AxMCPClient

Methods

cancelRequest()

cancelRequest(id: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/client.ts#L197

Parameters

ParameterType
idstring

Returns

void


init()

init(): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/client.ts#L76

Returns

Promise<void>


ping()

ping(timeout: number): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/client.ts#L172

Parameters

ParameterTypeDefault value
timeoutnumber3000

Returns

Promise<void>


toFunction()

toFunction(): AxFunction[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/client.ts#L193

Returns

AxFunction[]

AxMCPStdioTransport

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/stdioTransport.ts#L17

Implements

Constructors

Constructor

new AxMCPStdioTransport(config: Readonly<StdioTransportConfig>): AxMCPStdioTransport;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/stdioTransport.ts#L25

Parameters

ParameterType
configReadonly<StdioTransportConfig>

Returns

AxMCPStdioTransport

Methods

connect()

connect(): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/stdioTransport.ts#L57

Connects to the transport if needed This method is optional and only required for transports that need connection setup

Returns

Promise<void>

Implementation of

AxMCPTransport.connect


send()

send(message: Readonly<JSONRPCRequest<unknown>>): Promise<JSONRPCResponse<unknown>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/stdioTransport.ts#L40

Sends a JSON-RPC request or notification and returns the response

Parameters

ParameterTypeDescription
messageReadonly<JSONRPCRequest<unknown>>The JSON-RPC request or notification to send

Returns

Promise<JSONRPCResponse<unknown>>

A Promise that resolves to the JSON-RPC response

Implementation of

AxMCPTransport.send


sendNotification()

sendNotification(message: Readonly<JSONRPCNotification>): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/stdioTransport.ts#L51

Sends a JSON-RPC notification

Parameters

ParameterTypeDescription
messageReadonly<JSONRPCNotification>The JSON-RPC notification to send

Returns

Promise<void>

Implementation of

AxMCPTransport.sendNotification

AxMCPStreambleHTTPTransport

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L97

AxMCPStreambleHTTPTransport implements the 2025-03-26 Streamable HTTP transport specification This transport uses a single HTTP endpoint that supports both POST and GET methods

Implements

Constructors

Constructor

new AxMCPStreambleHTTPTransport(mcpEndpoint: string, options?: AxMCPStreamableHTTPTransportOptions): AxMCPStreambleHTTPTransport;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L113

Parameters

ParameterType
mcpEndpointstring
options?AxMCPStreamableHTTPTransportOptions

Returns

AxMCPStreambleHTTPTransport

Methods

close()

close(): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L453

Close any open connections

Returns

void


connect()

connect(): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L171

Connects to the transport if needed This method is optional and only required for transports that need connection setup

Returns

Promise<void>

Implementation of

AxMCPTransport.connect


getHeaders()

getHeaders(): Record<string, string>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L143

Get a copy of the current custom headers

Returns

Record<string, string>


openListeningStream()

openListeningStream(): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L180

Opens an SSE stream to listen for server-initiated messages

Returns

Promise<void>


send()

send(message: Readonly<JSONRPCRequest<unknown>>): Promise<JSONRPCResponse<unknown>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L287

Sends a JSON-RPC request or notification and returns the response

Parameters

ParameterTypeDescription
messageReadonly<JSONRPCRequest<unknown>>The JSON-RPC request or notification to send

Returns

Promise<JSONRPCResponse<unknown>>

A Promise that resolves to the JSON-RPC response

Implementation of

AxMCPTransport.send


sendNotification()

sendNotification(message: Readonly<JSONRPCNotification>): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L394

Sends a JSON-RPC notification

Parameters

ParameterTypeDescription
messageReadonly<JSONRPCNotification>The JSON-RPC notification to send

Returns

Promise<void>

Implementation of

AxMCPTransport.sendNotification


setAuthorization()

setAuthorization(authorization: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L136

Update authorization header (convenience method)

Parameters

ParameterType
authorizationstring

Returns

void


setHeaders()

setHeaders(headers: Record<string, string>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L129

Update custom headers (useful for refreshing tokens)

Parameters

ParameterType
headersRecord<string, string>

Returns

void


setMessageHandler()

setMessageHandler(handler: (message: JSONRPCNotification | JSONRPCRequest<unknown>) => void): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L165

Set a handler for incoming server messages (requests/notifications)

Parameters

ParameterType
handler(message: JSONRPCNotification | JSONRPCRequest<unknown>) => void

Returns

void


terminateSession()

terminateSession(): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L426

Explicitly terminate the session (if supported by server)

Returns

Promise<void>

AxMiPRO

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizers/miproV2.ts#L35

Abstract base class for optimizers that provides common functionality and standardized handling of AxOptimizerArgs

Extends

Type Parameters

Type ParameterDefault type
IN extends AxGenInAxGenIn
OUT extends AxGenOutAxGenOut

Constructors

Constructor

new AxMiPRO<IN, OUT>(args: Readonly<AxOptimizerArgs & object>): AxMiPRO<IN, OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizers/miproV2.ts#L70

Parameters

ParameterType
argsReadonly<AxOptimizerArgs & object>

Returns

AxMiPRO<IN, OUT>

Overrides

AxBaseOptimizer.constructor

Methods

compile()

compile(
   program: Readonly<AxProgram<IN, OUT>>, 
   metricFn: AxMetricFn, 
options?: AxCompileOptions): Promise<AxMiPROResult<IN, OUT>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizers/miproV2.ts#L750

The main compile method to run MIPROv2 optimization

Parameters

ParameterType
programReadonly<AxProgram<IN, OUT>>
metricFnAxMetricFn
options?AxCompileOptions

Returns

Promise<AxMiPROResult<IN, OUT>>

Overrides

AxBaseOptimizer.compile


compilePareto()

compilePareto(
   program: Readonly<AxProgram<IN, OUT>>, 
   metricFn: AxMultiMetricFn, 
options?: AxCompileOptions): Promise<AxParetoResult<OUT>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L750

Multi-objective optimization using Pareto frontier Default implementation that leverages the single-objective compile method

Parameters

ParameterTypeDescription
programReadonly<AxProgram<IN, OUT>>The program to optimize
metricFnAxMultiMetricFnMulti-objective metric function that returns multiple scores
options?AxCompileOptionsOptional configuration options

Returns

Promise<AxParetoResult<OUT>>

Pareto optimization result with frontier of non-dominated solutions

Inherited from

AxBaseOptimizer.compilePareto


configureAuto()

configureAuto(level: "medium" | "light" | "heavy"): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizers/miproV2.ts#L111

Configures the optimizer for light, medium, or heavy optimization

Parameters

ParameterTypeDescription
level"medium" | "light" | "heavy"The optimization level: “light”, “medium”, or “heavy”

Returns

void


getConfiguration()

getConfiguration(): Record<string, unknown>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizers/miproV2.ts#L959

Get optimizer-specific configuration

Returns

Record<string, unknown>

Current optimizer configuration


getStats()

getStats(): AxOptimizationStats;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L691

Get current optimization statistics

Returns

AxOptimizationStats

Inherited from

AxBaseOptimizer.getStats


reset()

reset(): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizers/miproV2.ts#L1023

Reset optimizer state for reuse with different programs

Returns

void

Overrides

AxBaseOptimizer.reset


updateConfiguration()

updateConfiguration(config: Readonly<Record<string, unknown>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizers/miproV2.ts#L986

Update optimizer configuration

Parameters

ParameterTypeDescription
configReadonly<Record<string, unknown>>New configuration to merge with existing

Returns

void


validateProgram()

validateProgram(program: Readonly<AxProgram<IN, OUT>>): object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizers/miproV2.ts#L1038

Validate that the optimizer can handle the given program

Parameters

ParameterTypeDescription
programReadonly<AxProgram<IN, OUT>>Program to validate

Returns

object

Validation result with any issues found

NameType
issuesstring[]
isValidboolean
suggestionsstring[]

Overrides

AxBaseOptimizer.validateProgram

AxMemory

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/memory.ts#L214

Implements

Constructors

Constructor

new AxMemory(options?: object): AxMemory;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/memory.ts#L218

Parameters

ParameterType
options?{ debug?: boolean; debugHideSystemPrompt?: boolean; }
options.debug?boolean
options.debugHideSystemPrompt?boolean

Returns

AxMemory

Methods

addFunctionResults()

addFunctionResults(results: readonly AxFunctionResult[], sessionId?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/memory.ts#L254

Parameters

ParameterType
resultsreadonly AxFunctionResult[]
sessionId?string

Returns

void

Implementation of

AxAIMemory.addFunctionResults


addRequest()

addRequest(value: (
  | {
  cache?: boolean;
  content: string;
  role: "system";
}
  | {
  content:   | string
     | (
     | {
     cache?: boolean;
     text: string;
     type: "text";
   }
     | {
     cache?: boolean;
     details?: "high" | "low" | "auto";
     image: string;
     mimeType: string;
     type: "image";
   }
     | {
     cache?: boolean;
     data: string;
     format?: "wav";
     type: "audio";
   })[];
  name?: string;
  role: "user";
}
  | {
  cache?: boolean;
  content?: string;
  functionCalls?: object[];
  name?: string;
  role: "assistant";
}
  | {
  cache?: boolean;
  functionId: string;
  isError?: boolean;
  result: string;
  role: "function";
})[], sessionId?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/memory.ts#L239

Parameters

ParameterType
value( | { cache?: boolean; content: string; role: "system"; } | { content: | string | ( | { cache?: boolean; text: string; type: "text"; } | { cache?: boolean; details?: "high" | "low" | "auto"; image: string; mimeType: string; type: "image"; } | { cache?: boolean; data: string; format?: "wav"; type: "audio"; })[]; name?: string; role: "user"; } | { cache?: boolean; content?: string; functionCalls?: object[]; name?: string; role: "assistant"; } | { cache?: boolean; functionId: string; isError?: boolean; result: string; role: "function"; })[]
sessionId?string

Returns

void

Implementation of

AxAIMemory.addRequest


addResponse()

addResponse(results: readonly AxChatResponseResult[], sessionId?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/memory.ts#L246

Parameters

ParameterType
resultsreadonly AxChatResponseResult[]
sessionId?string

Returns

void

Implementation of

AxAIMemory.addResponse


addTag()

addTag(name: string, sessionId?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/memory.ts#L268

Parameters

ParameterType
namestring
sessionId?string

Returns

void

Implementation of

AxAIMemory.addTag


getLast()

getLast(sessionId?: string): 
  | undefined
  | {
  chat: object[];
  role: "function" | "system" | "user" | "assistant";
  tags?: string[];
  updatable?: boolean;
};

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/memory.ts#L280

Parameters

ParameterType
sessionId?string

Returns

| undefined | { chat: object[]; role: "function" | "system" | "user" | "assistant"; tags?: string[]; updatable?: boolean; }

Implementation of

AxAIMemory.getLast


history()

history(index: number, sessionId?: string): (
  | {
  cache?: boolean;
  content: string;
  role: "system";
}
  | {
  content:   | string
     | (
     | {
     cache?: boolean;
     text: string;
     type: "text";
   }
     | {
     cache?: boolean;
     details?: "high" | "low" | "auto";
     image: string;
     mimeType: string;
     type: "image";
   }
     | {
     cache?: boolean;
     data: string;
     format?: "wav";
     type: "audio";
   })[];
  name?: string;
  role: "user";
}
  | {
  cache?: boolean;
  content?: string;
  functionCalls?: object[];
  name?: string;
  role: "assistant";
}
  | {
  cache?: boolean;
  functionId: string;
  isError?: boolean;
  result: string;
  role: "function";
})[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/memory.ts#L276

Parameters

ParameterType
indexnumber
sessionId?string

Returns

( | { cache?: boolean; content: string; role: "system"; } | { content: | string | ( | { cache?: boolean; text: string; type: "text"; } | { cache?: boolean; details?: "high" | "low" | "auto"; image: string; mimeType: string; type: "image"; } | { cache?: boolean; data: string; format?: "wav"; type: "audio"; })[]; name?: string; role: "user"; } | { cache?: boolean; content?: string; functionCalls?: object[]; name?: string; role: "assistant"; } | { cache?: boolean; functionId: string; isError?: boolean; result: string; role: "function"; })[]

Implementation of

AxAIMemory.history


reset()

reset(sessionId?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/memory.ts#L284

Parameters

ParameterType
sessionId?string

Returns

void

Implementation of

AxAIMemory.reset


rewindToTag()

rewindToTag(name: string, sessionId?: string): AxMemoryData;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/memory.ts#L272

Parameters

ParameterType
namestring
sessionId?string

Returns

AxMemoryData

Implementation of

AxAIMemory.rewindToTag


updateResult()

updateResult(result: Readonly<AxChatResponseResult & object>, sessionId?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/memory.ts#L261

Parameters

ParameterType
resultReadonly<AxChatResponseResult & object>
sessionId?string

Returns

void

Implementation of

AxAIMemory.updateResult

AxMockAIService

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L49

Implements

Constructors

Constructor

new AxMockAIService(config: AxMockAIServiceConfig): AxMockAIService;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L61

Parameters

ParameterType
configAxMockAIServiceConfig

Returns

AxMockAIService

Methods

chat()

chat(req: Readonly<AxChatRequest<unknown>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<unknown, unknown>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L104

Parameters

ParameterType
reqReadonly<AxChatRequest<unknown>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<unknown, unknown>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Implementation of

AxAIService.chat


embed()

embed(req: Readonly<AxEmbedRequest>, _options?: Readonly<AxAIServiceActionOptions>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L147

Parameters

ParameterType
reqReadonly<AxEmbedRequest>
_options?Readonly<AxAIServiceActionOptions>

Returns

Promise<AxEmbedResponse>

Implementation of

AxAIService.embed


getFeatures()

getFeatures(_model?: string): object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L89

Parameters

ParameterType
_model?string

Returns

object

NameType
functionsboolean
streamingboolean

Implementation of

AxAIService.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L84

Returns

string

Implementation of

AxAIService.getId


getLastUsedChatModel()

getLastUsedChatModel(): unknown;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L64

Returns

unknown

Implementation of

AxAIService.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): unknown;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L67

Returns

unknown

Implementation of

AxAIService.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L70

Returns

undefined | AxModelConfig

Implementation of

AxAIService.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L190

Returns

AxLoggerFunction

Implementation of

AxAIService.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L100

Returns

AxAIServiceMetrics

Implementation of

AxAIService.getMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L96

Returns

undefined | AxAIModelList

Implementation of

AxAIService.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L80

Returns

string

Implementation of

AxAIService.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L186

Returns

Readonly<AxAIServiceOptions>

Implementation of

AxAIService.getOptions


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L182

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Implementation of

AxAIService.setOptions

AxMultiServiceRouter

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/multiservice.ts#L25

Implements

Constructors

Constructor

new AxMultiServiceRouter(services: (
  | AxAIService<string, string>
  | AxAIServiceListItem<string, string>)[]): AxMultiServiceRouter;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/multiservice.ts#L44

Constructs a new multi-service router. It validates that each service provides a unique set of model keys, then builds a lookup (map) for routing the chat/embed requests.

Parameters

ParameterType
services( | AxAIService<string, string> | AxAIServiceListItem<string, string>)[]

Returns

AxMultiServiceRouter

Methods

chat()

chat(req: Readonly<AxChatRequest<string>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<string, string>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/multiservice.ts#L122

Delegates the chat call to the service matching the provided model key.

Parameters

ParameterType
reqReadonly<AxChatRequest<string>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<string, string>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Implementation of

AxAIService.chat


embed()

embed(req: Readonly<AxEmbedRequest<string>>, options?: Readonly<AxAIServiceActionOptions<string, string>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/multiservice.ts#L152

Delegates the embed call to the service matching the provided embed model key.

Parameters

ParameterType
reqReadonly<AxEmbedRequest<string>>
options?Readonly<AxAIServiceActionOptions<string, string>>

Returns

Promise<AxEmbedResponse>

Implementation of

AxAIService.embed


getFeatures()

getFeatures(model?: string): object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/multiservice.ts#L220

If a model key is provided, delegate to the corresponding service’s features. Otherwise, returns a default feature set.

Parameters

ParameterType
model?string

Returns

object

NameType
functionCot?boolean
functionsboolean
streamingboolean

Implementation of

AxAIService.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/multiservice.ts#L183

Returns a composite ID built from the IDs of the underlying services.

Returns

string

Implementation of

AxAIService.getId


getLastUsedChatModel()

getLastUsedChatModel(): undefined | string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/multiservice.ts#L109

Returns

undefined | string

Implementation of

AxAIService.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): undefined | string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/multiservice.ts#L112

Returns

undefined | string

Implementation of

AxAIService.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/multiservice.ts#L115

Returns

undefined | AxModelConfig

Implementation of

AxAIService.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/multiservice.ts#L280

Returns the logger from the last used service, or falls back to the first service if none has been used.

Returns

AxLoggerFunction

Implementation of

AxAIService.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/multiservice.ts#L239

Returns aggregated metrics from the underlying service. Uses the metrics from the last service that was used, or falls back to the first service if none has been used.

Returns

AxAIServiceMetrics

Implementation of

AxAIService.getMetrics


getModelList()

getModelList(): AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/multiservice.ts#L202

Aggregates all available models across the underlying services.

Returns

AxAIModelList

Implementation of

AxAIService.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/multiservice.ts#L195

Returns the name of this router.

Returns

string

Implementation of

AxAIService.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/multiservice.ts#L272

Returns the options from the last used service, or falls back to the first service if none has been used.

Returns

Readonly<AxAIServiceOptions>

Implementation of

AxAIService.getOptions


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/multiservice.ts#L261

Sets options on all underlying services.

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Implementation of

AxAIService.setOptions

AxProgram

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L361

Type Parameters

Type Parameter
IN extends AxGenIn
OUT extends AxGenOut

Implements

Constructors

Constructor

new AxProgram<IN, OUT>(): AxProgram<IN, OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L374

Returns

AxProgram<IN, OUT>

Methods

forward()

forward(
   _ai: Readonly<AxAIService>, 
   _values: IN | AxMessage<IN>[], 
_options?: Readonly<AxProgramForwardOptions>): Promise<OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L386

Parameters

ParameterType
_aiReadonly<AxAIService>
_valuesIN | AxMessage<IN>[]
_options?Readonly<AxProgramForwardOptions>

Returns

Promise<OUT>


getTraces()

getTraces(): AxProgramTrace<IN, OUT>[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L435

Returns

AxProgramTrace<IN, OUT>[]

Implementation of

AxTunable.getTraces


getUsage()

getUsage(): AxModelUsage & object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L449

Returns

AxModelUsage & object[]

Implementation of

AxUsable.getUsage


register()

register(prog: Readonly<AxTunable<IN, OUT> & AxUsable>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L379

Parameters

ParameterType
progReadonly<AxTunable<IN, OUT> & AxUsable>

Returns

void


resetUsage()

resetUsage(): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L459

Returns

void

Implementation of

AxUsable.resetUsage


setDemos()

setDemos(demos: readonly AxProgramDemos<IN, OUT>[]): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L466

Parameters

ParameterType
demosreadonly AxProgramDemos<IN, OUT>[]

Returns

void

Implementation of

AxTunable.setDemos


setExamples()

setExamples(examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L422

Parameters

ParameterType
examplesReadonly<AxProgramExamples<IN, OUT>>
options?Readonly<AxSetExamplesOptions>

Returns

void

Implementation of

AxTunable.setExamples


setId()

setId(id: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L409

Parameters

ParameterType
idstring

Returns

void

Implementation of

AxTunable.setId


setParentId()

setParentId(parentId: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L416

Parameters

ParameterType
parentIdstring

Returns

void

Implementation of

AxTunable.setParentId


streamingForward()

streamingForward(
   _ai: Readonly<AxAIService>, 
   _values: IN | AxMessage<IN>[], 
_options?: Readonly<AxProgramStreamingForwardOptions>): AxGenStreamingOut<OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L398

Parameters

ParameterType
_aiReadonly<AxAIService>
_valuesIN | AxMessage<IN>[]
_options?Readonly<AxProgramStreamingForwardOptions>

Returns

AxGenStreamingOut<OUT>

AxProgramWithSignature

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L177

Extended by

Type Parameters

Type Parameter
IN extends AxGenIn
OUT extends AxGenOut

Implements

Constructors

Constructor

new AxProgramWithSignature<IN, OUT>(signature: NonNullable<
  | undefined
  | Readonly<
  | string
  | AxSignatureConfig
| AxSignature>>, options?: Readonly<AxProgramWithSignatureOptions>): AxProgramWithSignature<IN, OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L192

Parameters

ParameterType
signatureNonNullable< | undefined | Readonly< | string | AxSignatureConfig | AxSignature>>
options?Readonly<AxProgramWithSignatureOptions>

Returns

AxProgramWithSignature<IN, OUT>

Methods

forward()

forward(
   _ai: Readonly<AxAIService>, 
   _values: IN | AxMessage<IN>[], 
_options?: Readonly<AxProgramForwardOptions>): Promise<OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L221

Parameters

ParameterType
_aiReadonly<AxAIService>
_valuesIN | AxMessage<IN>[]
_options?Readonly<AxProgramForwardOptions>

Returns

Promise<OUT>


getSignature()

getSignature(): AxSignature;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L210

Returns

AxSignature


getTraces()

getTraces(): AxProgramTrace<IN, OUT>[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L307

Returns

AxProgramTrace<IN, OUT>[]

Implementation of

AxTunable.getTraces


getUsage()

getUsage(): AxModelUsage & object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L321

Returns

AxModelUsage & object[]

Implementation of

AxUsable.getUsage


register()

register(prog: Readonly<AxTunable<IN, OUT> & AxUsable>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L214

Parameters

ParameterType
progReadonly<AxTunable<IN, OUT> & AxUsable>

Returns

void


resetUsage()

resetUsage(): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L331

Returns

void

Implementation of

AxUsable.resetUsage


setDemos()

setDemos(demos: readonly AxProgramDemos<IN, OUT>[]): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L338

Parameters

ParameterType
demosreadonly AxProgramDemos<IN, OUT>[]

Returns

void

Implementation of

AxTunable.setDemos


setExamples()

setExamples(examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L257

Parameters

ParameterType
examplesReadonly<AxProgramExamples<IN, OUT>>
options?Readonly<AxSetExamplesOptions>

Returns

void

Implementation of

AxTunable.setExamples


setId()

setId(id: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L244

Parameters

ParameterType
idstring

Returns

void

Implementation of

AxTunable.setId


setParentId()

setParentId(parentId: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L251

Parameters

ParameterType
parentIdstring

Returns

void

Implementation of

AxTunable.setParentId


streamingForward()

streamingForward(
   _ai: Readonly<AxAIService>, 
   _values: IN | AxMessage<IN>[], 
_options?: Readonly<AxProgramStreamingForwardOptions>): AxGenStreamingOut<OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L233

Parameters

ParameterType
_aiReadonly<AxAIService>
_valuesIN | AxMessage<IN>[]
_options?Readonly<AxProgramStreamingForwardOptions>

Returns

AxGenStreamingOut<OUT>

AxRAG

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/rag.ts#L10

Extends

  • AxChainOfThought<{ context: string[]; question: string; }, { answer: string; }>

Constructors

Constructor

new AxRAG(queryFn: (query: string) => Promise<string>, options: Readonly<AxProgramForwardOptions & object>): AxRAG;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/rag.ts#L21

Parameters

ParameterType
queryFn(query: string) => Promise<string>
optionsReadonly<AxProgramForwardOptions & object>

Returns

AxRAG

Overrides

AxChainOfThought.constructor

Methods

_forward1()

_forward1(
   ai: Readonly<AxAIService>, 
   values: 
  | {
  context: string[];
  question: string;
}
  | AxMessage<{
  context: string[];
  question: string;
}>[], 
   options: Readonly<AxProgramForwardOptions>): AxGenStreamingOut<{
  answer: string;
}>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L521

Parameters

ParameterType
aiReadonly<AxAIService>
values| { context: string[]; question: string; } | AxMessage<{ context: string[]; question: string; }>[]
optionsReadonly<AxProgramForwardOptions>

Returns

AxGenStreamingOut<{ answer: string; }>

Inherited from

AxChainOfThought._forward1


addAssert()

addAssert(fn: (values: Record<string, unknown>) => undefined | boolean | Promise<undefined | boolean>, message?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L154

Parameters

ParameterType
fn(values: Record<string, unknown>) => undefined | boolean | Promise<undefined | boolean>
message?string

Returns

void

Inherited from

AxChainOfThought.addAssert


addFieldProcessor()

addFieldProcessor(fieldName: string, fn: 
  | AxFieldProcessorProcess
  | AxStreamingFieldProcessorProcess): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L201

Parameters

ParameterType
fieldNamestring
fn| AxFieldProcessorProcess | AxStreamingFieldProcessorProcess

Returns

void

Inherited from

AxChainOfThought.addFieldProcessor


addStreamingAssert()

addStreamingAssert(
   fieldName: string, 
   fn: (content: string, done?: boolean) => undefined | boolean, 
   message?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L158

Parameters

ParameterType
fieldNamestring
fn(content: string, done?: boolean) => undefined | boolean
message?string

Returns

void

Inherited from

AxChainOfThought.addStreamingAssert


addStreamingFieldProcessor()

addStreamingFieldProcessor(fieldName: string, fn: 
  | AxFieldProcessorProcess
  | AxStreamingFieldProcessorProcess): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L194

Parameters

ParameterType
fieldNamestring
fn| AxFieldProcessorProcess | AxStreamingFieldProcessorProcess

Returns

void

Inherited from

AxChainOfThought.addStreamingFieldProcessor


forward()

forward(
   ai: Readonly<AxAIService>, 
   values: 
  | {
  context: string[];
  question: string;
}
  | AxMessage<{
  context: string[];
  question: string;
}>[], 
   options?: Readonly<AxProgramForwardOptions>): Promise<{
  answer: string;
}>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/rag.ts#L42

Parameters

ParameterType
aiReadonly<AxAIService>
values| { context: string[]; question: string; } | AxMessage<{ context: string[]; question: string; }>[]
options?Readonly<AxProgramForwardOptions>

Returns

Promise<{ answer: string; }>

Overrides

AxChainOfThought.forward


getSignature()

getSignature(): AxSignature;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L210

Returns

AxSignature

Inherited from

AxChainOfThought.getSignature


getTraces()

getTraces(): AxProgramTrace<{
  context: string[];
  question: string;
}, {
  answer: string;
}>[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L307

Returns

AxProgramTrace<{ context: string[]; question: string; }, { answer: string; }>[]

Inherited from

AxChainOfThought.getTraces


getUsage()

getUsage(): AxModelUsage & object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L321

Returns

AxModelUsage & object[]

Inherited from

AxChainOfThought.getUsage


register()

register(prog: Readonly<AxTunable<IN, OUT> & AxUsable>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L214

Parameters

ParameterType
progReadonly<AxTunable<IN, OUT> & AxUsable>

Returns

void

Inherited from

AxChainOfThought.register


resetUsage()

resetUsage(): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L331

Returns

void

Inherited from

AxChainOfThought.resetUsage


setDemos()

setDemos(demos: readonly AxProgramDemos<{
  context: string[];
  question: string;
}, {
  answer: string;
}>[]): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L338

Parameters

ParameterType
demosreadonly AxProgramDemos<{ context: string[]; question: string; }, { answer: string; }>[]

Returns

void

Inherited from

AxChainOfThought.setDemos


setExamples()

setExamples(examples: Readonly<AxProgramExamples<{
  context: string[];
  question: string;
}, {
  answer: string;
}>>, options?: Readonly<AxSetExamplesOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L695

Parameters

ParameterType
examplesReadonly<AxProgramExamples<{ context: string[]; question: string; }, { answer: string; }>>
options?Readonly<AxSetExamplesOptions>

Returns

void

Inherited from

AxChainOfThought.setExamples


setId()

setId(id: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L244

Parameters

ParameterType
idstring

Returns

void

Inherited from

AxChainOfThought.setId


setParentId()

setParentId(parentId: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L251

Parameters

ParameterType
parentIdstring

Returns

void

Inherited from

AxChainOfThought.setParentId


streamingForward()

streamingForward(
   ai: Readonly<AxAIService>, 
   values: 
  | {
  context: string[];
  question: string;
}
  | AxMessage<{
  context: string[];
  question: string;
}>[], 
   options?: Readonly<AxProgramStreamingForwardOptions>): AxGenStreamingOut<{
  answer: string;
}>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L640

Parameters

ParameterType
aiReadonly<AxAIService>
values| { context: string[]; question: string; } | AxMessage<{ context: string[]; question: string; }>[]
options?Readonly<AxProgramStreamingForwardOptions>

Returns

AxGenStreamingOut<{ answer: string; }>

Inherited from

AxChainOfThought.streamingForward

AxPromptTemplate

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/prompt.ts#L42

Constructors

Constructor

new AxPromptTemplate(
   sig: Readonly<AxSignature>, 
   options?: Readonly<AxPromptTemplateOptions>, 
   fieldTemplates?: Record<string, AxFieldTemplateFn>): AxPromptTemplate;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/prompt.ts#L49

Parameters

ParameterType
sigReadonly<AxSignature>
options?Readonly<AxPromptTemplateOptions>
fieldTemplates?Record<string, AxFieldTemplateFn>

Returns

AxPromptTemplate

Methods

render()

render<T>(values: T | readonly AxMessage<T>[], __namedParameters: Readonly<{
  demos?: Record<string, AxFieldValue>[];
  examples?: Record<string, AxFieldValue>[];
  skipSystemPrompt?: boolean;
}>): (
  | {
  cache?: boolean;
  content: string;
  role: "system";
}
  | {
  content:   | string
     | (
     | {
     cache?: boolean;
     text: string;
     type: "text";
   }
     | {
     cache?: boolean;
     details?: "high" | "low" | "auto";
     image: string;
     mimeType: string;
     type: "image";
   }
     | {
     cache?: boolean;
     data: string;
     format?: "wav";
     type: "audio";
   })[];
  name?: string;
  role: "user";
}
  | {
  cache?: boolean;
  content?: string;
  functionCalls?: object[];
  name?: string;
  role: "assistant";
})[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/prompt.ts#L122

Type Parameters

Type Parameter
T extends AxGenIn

Parameters

ParameterType
valuesT | readonly AxMessage<T>[]
__namedParametersReadonly<{ demos?: Record<string, AxFieldValue>[]; examples?: Record<string, AxFieldValue>[]; skipSystemPrompt?: boolean; }>

Returns

( | { cache?: boolean; content: string; role: "system"; } | { content: | string | ( | { cache?: boolean; text: string; type: "text"; } | { cache?: boolean; details?: "high" | "low" | "auto"; image: string; mimeType: string; type: "image"; } | { cache?: boolean; data: string; format?: "wav"; type: "audio"; })[]; name?: string; role: "user"; } | { cache?: boolean; content?: string; functionCalls?: object[]; name?: string; role: "assistant"; })[]


renderExtraFields()

renderExtraFields(extraFields: readonly AxIField[]): (
  | {
  cache?: boolean;
  text: string;
  type: "text";
}
  | {
  cache?: boolean;
  details?: "high" | "low" | "auto";
  image: string;
  mimeType: string;
  type: "image";
}
  | {
  cache?: boolean;
  data: string;
  format?: "wav";
  type: "audio";
})[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/prompt.ts#L231

Parameters

ParameterType
extraFieldsreadonly AxIField[]

Returns

( | { cache?: boolean; text: string; type: "text"; } | { cache?: boolean; details?: "high" | "low" | "auto"; image: string; mimeType: string; type: "image"; } | { cache?: boolean; data: string; format?: "wav"; type: "audio"; })[]

AxRateLimiterTokenUsage

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/rate-limit.ts#L9

Constructors

Constructor

new AxRateLimiterTokenUsage(
   maxTokens: number, 
   refillRate: number, 
   options?: Readonly<AxRateLimiterTokenUsageOptions>): AxRateLimiterTokenUsage;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/rate-limit.ts#L16

Parameters

ParameterType
maxTokensnumber
refillRatenumber
options?Readonly<AxRateLimiterTokenUsageOptions>

Returns

AxRateLimiterTokenUsage

Methods

acquire()

acquire(tokens: number): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/rate-limit.ts#L56

Parameters

ParameterType
tokensnumber

Returns

Promise<void>

AxSignature

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/sig.ts#L55

Constructors

Constructor

new AxSignature(signature?: Readonly<
  | string
  | AxSignatureConfig
  | AxSignature>): AxSignature;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/sig.ts#L66

Parameters

ParameterType
signature?Readonly< | string | AxSignatureConfig | AxSignature>

Returns

AxSignature

Methods

addInputField()

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

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

Parameters

ParameterType
fieldReadonly<AxField>

Returns

void


addOutputField()

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

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/sig.ts#L255

Parameters

ParameterType
fieldReadonly<AxField>

Returns

void


getDescription()

getDescription(): undefined | string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/sig.ts#L354

Returns

undefined | string


getInputFields()

getInputFields(): readonly AxIField[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/sig.ts#L352

Returns

readonly AxIField[]


getOutputFields()

getOutputFields(): readonly AxIField[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/sig.ts#L353

Returns

readonly AxIField[]


hash()

hash(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/sig.ts#L541

Returns

string


setDescription()

setDescription(desc: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/sig.ts#L201

Parameters

ParameterType
descstring

Returns

void


setInputFields()

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

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/sig.ts#L296

Parameters

ParameterType
fieldsreadonly AxField[]

Returns

void


setOutputFields()

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

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/sig.ts#L324

Parameters

ParameterType
fieldsreadonly AxField[]

Returns

void


toJSON()

toJSON(): object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/sig.ts#L545

Returns

object

NameType
descriptionundefined | string
idstring
inputFieldsAxIField[]
outputFieldsAxIField[]

toJSONSchema()

toJSONSchema(): AxFunctionJSONSchema;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/sig.ts#L366

Returns

AxFunctionJSONSchema


toString()

toString(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/sig.ts#L543

Returns

string


validate()

validate(): boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/sig.ts#L520

Returns

boolean

AxSimpleClassifier

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/classifier.ts#L30

Constructors

Constructor

new AxSimpleClassifier(ai: AxAIService): AxSimpleClassifier;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/classifier.ts#L36

Parameters

ParameterType
aiAxAIService

Returns

AxSimpleClassifier

Methods

forward()

forward(text: string, options?: Readonly<AxSimpleClassifierForwardOptions>): Promise<string>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/classifier.ts#L68

Parameters

ParameterType
textstring
options?Readonly<AxSimpleClassifierForwardOptions>

Returns

Promise<string>


getState()

getState(): undefined | AxDBState;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/classifier.ts#L41

Returns

undefined | AxDBState


setClasses()

setClasses(classes: readonly AxSimpleClassifierClass[], options?: Readonly<{
  abortSignal?: AbortSignal;
}>): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/classifier.ts#L49

Parameters

ParameterType
classesreadonly AxSimpleClassifierClass[]
options?Readonly<{ abortSignal?: AbortSignal; }>

Returns

Promise<void>


setOptions()

setOptions(options: Readonly<{
  debug?: boolean;
}>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/classifier.ts#L108

Parameters

ParameterType
optionsReadonly<{ debug?: boolean; }>

Returns

void


setState()

setState(state: AxDBState): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/classifier.ts#L45

Parameters

ParameterType
stateAxDBState

Returns

void

AxTestPrompt

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/evaluate.ts#L14

Type Parameters

Type ParameterDefault type
IN extends AxGenInAxGenIn
OUT extends AxGenOutAxGenOut

Constructors

Constructor

new AxTestPrompt<IN, OUT>(__namedParameters: Readonly<AxEvaluateArgs<IN, OUT>>): AxTestPrompt<IN, OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/evaluate.ts#L22

Parameters

ParameterType
__namedParametersReadonly<AxEvaluateArgs<IN, OUT>>

Returns

AxTestPrompt<IN, OUT>

Methods

run()

run(metricFn: AxMetricFn): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/evaluate.ts#L35

Parameters

ParameterType
metricFnAxMetricFn

Returns

Promise<void>

AxSimpleClassifierClass

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/classifier.ts#L12

Constructors

Constructor

new AxSimpleClassifierClass(name: string, context: readonly string[]): AxSimpleClassifierClass;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/classifier.ts#L16

Parameters

ParameterType
namestring
contextreadonly string[]

Returns

AxSimpleClassifierClass

Methods

getContext()

getContext(): readonly string[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/classifier.ts#L25

Returns

readonly string[]


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/classifier.ts#L21

Returns

string

AxAIAnthropicModel

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L3

Enumeration Members

Enumeration MemberValue
Claude21"claude-2.1"
Claude35Haiku"claude-3-5-haiku-latest"
Claude35Sonnet"claude-3-5-sonnet-latest"
Claude37Sonnet"claude-3-7-sonnet-latest"
Claude3Haiku"claude-3-haiku-20240307"
Claude3Opus"claude-3-opus-latest"
Claude3Sonnet"claude-3-sonnet-20240229"
Claude4Opus"claude-opus-4-20250514"
Claude4Sonnet"claude-sonnet-4-20250514"
ClaudeInstant12"claude-instant-1.2"

AxAIAnthropicVertexModel

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L19

Enumeration Members

Enumeration MemberValue
Claude35Haiku"claude-3-5-haiku"
Claude35Sonnet"claude-3-5-sonnet"
Claude35SonnetV2"claude-3-5-sonnet-v2"
Claude37Sonnet"claude-3-7-sonnet"
Claude3Haiku"claude-3-haiku"
Claude3Opus"claude-3-opus"

AxAICohereModel

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L6

Cohere: Models for text generation

Enumeration Members

Enumeration MemberValue
Command"command"
CommandLight"command-light"
CommandR"command-r"
CommandRPlus"command-r-plus"

AxAIDeepSeekModel

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/deepseek/types.ts#L4

DeepSeek: Models for text generation

Enumeration Members

Enumeration MemberValue
DeepSeekChat"deepseek-chat"
DeepSeekCoder"deepseek-coder"
DeepSeekReasoner"deepseek-reasoner"

AxAICohereEmbedModel

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L16

Cohere: Models for use in embeddings

Enumeration Members

Enumeration MemberValue
EmbedEnglishLightV30"embed-english-light-v3.0"
EmbedEnglishV30"embed-english-v3.0"
EmbedMultiLingualLightV30"embed-multilingual-light-v3.0"
EmbedMultiLingualV30"embed-multilingual-v3.0"

AxAIGoogleGeminiEmbedModel

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L16

Enumeration Members

Enumeration MemberValue
GeminiEmbedding"gemini-embedding-exp"
TextEmbedding004"text-embedding-004"
TextEmbedding005"text-embedding-005"
TextEmbeddingLarge"text-embedding-large-exp-03-07"

AxAIGoogleGeminiEmbedTypes

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L38

Enumeration Members

Enumeration MemberValue
Classification"CLASSIFICATION"
Clustering"CLUSTERING"
CodeRetrievalQuery"CODE_RETRIEVAL_QUERY"
FactVerification"FACT_VERIFICATION"
QuestionAnswering"QUESTION_ANSWERING"
RetrievalDocument"RETRIEVAL_DOCUMENT"
RetrievalQuery"RETRIEVAL_QUERY"
SemanticSimilarity"SEMANTIC_SIMILARITY"

AxAIGoogleGeminiSafetyCategory

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L23

Enumeration Members

Enumeration MemberValue
HarmCategoryDangerousContent"HARM_CATEGORY_DANGEROUS_CONTENT"
HarmCategoryHarassment"HARM_CATEGORY_HARASSMENT"
HarmCategoryHateSpeech"HARM_CATEGORY_HATE_SPEECH"
HarmCategorySexuallyExplicit"HARM_CATEGORY_SEXUALLY_EXPLICIT"

AxAIGoogleGeminiModel

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L3

Enumeration Members

Enumeration MemberValue
Gemini15Flash"gemini-1.5-flash"
Gemini15Flash002"gemini-1.5-flash-002"
Gemini15Flash8B"gemini-1.5-flash-8b"
Gemini15Pro"gemini-1.5-pro"
Gemini1Pro"gemini-1.0-pro"
Gemini20Flash"gemini-2.0-flash"
Gemini20FlashLite"gemini-2.0-flash-lite-preview-02-05"
Gemini25Flash"gemini-2.5-flash"
Gemini25FlashLite"gemini-2.5-flash-lite-preview-06-17"
Gemini25Pro"gemini-2.5-pro"

AxAIGoogleGeminiSafetyThreshold

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L30

Enumeration Members

Enumeration MemberValue
BlockDefault"HARM_BLOCK_THRESHOLD_UNSPECIFIED"
BlockLowAndAbove"BLOCK_LOW_AND_ABOVE"
BlockMediumAndAbove"BLOCK_MEDIUM_AND_ABOVE"
BlockNone"BLOCK_NONE"
BlockOnlyHigh"BLOCK_ONLY_HIGH"

AxAIGrokEmbedModels

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/x-grok/types.ts#L10

Enumeration Members

Enumeration MemberValue
GrokEmbedSmall"grok-embed-small"

AxAIGrokModel

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/x-grok/types.ts#L3

Enumeration Members

Enumeration MemberValue
Grok3"grok-3"
Grok3Fast"grok-3-fast"
Grok3Mini"grok-3-mini"
Grok3MiniFast"grok-3-mini-fast"

AxAIGroqModel

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/groq/types.ts#L1

Enumeration Members

Enumeration MemberValue
Gemma2_9B"gemma2-9b-it"
Llama3_8B"llama3-8b-8192"
Llama33_70B"llama-3.3-70b-versatile"
Mixtral_8x7B"mixtral-8x7b-32768"

AxAIMistralEmbedModels

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mistral/types.ts#L14

Enumeration Members

Enumeration MemberValue
MistralEmbed"mistral-embed"

AxAIHuggingFaceModel

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/huggingface/types.ts#L3

Enumeration Members

Enumeration MemberValue
MetaLlama270BChatHF"meta-llama/Llama-2-70b-chat-hf"

AxAIMistralModel

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mistral/types.ts#L3

Enumeration Members

Enumeration MemberValue
Codestral"codestral-latest"
Mistral7B"open-mistral-7b"
Mistral8x7B"open-mixtral-8x7b"
MistralLarge"mistral-large-latest"
MistralNemo"mistral-nemo-latest"
MistralSmall"mistral-small-latest"
OpenCodestralMamba"open-codestral-mamba"
OpenMistralNemo"open-mistral-nemo-latest"

AxAIOpenAIEmbedModel

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L20

Enumeration Members

Enumeration MemberValue
TextEmbedding3Large"text-embedding-3-large"
TextEmbedding3Small"text-embedding-3-small"
TextEmbeddingAda002"text-embedding-ada-002"

AxAIOpenAIModel

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L3

Enumeration Members

Enumeration MemberValue
GPT35TextDavinci002"text-davinci-002"
GPT35Turbo"gpt-3.5-turbo"
GPT35TurboInstruct"gpt-3.5-turbo-instruct"
GPT3TextAda001"text-ada-001"
GPT3TextBabbage002"text-babbage-002"
GPT4"gpt-4"
GPT41"gpt-4.1"
GPT41Mini"gpt-4.1-mini"
GPT4ChatGPT4O"chatgpt-4o-latest"
GPT4O"gpt-4o"
GPT4OMini"gpt-4o-mini"
GPT4Turbo"gpt-4-turbo"
O1"o1"
O1Mini"o1-mini"

AxJSInterpreterPermission

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/code.ts#L11

Enumeration Members

Enumeration MemberValue
CRYPTO"crypto"
FS"node:fs"
NET"net"
OS"os"
PROCESS"process"

AxAIRekaModel

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L3

Enumeration Members

Enumeration MemberValue
RekaCore"reka-core"
RekaEdge"reka-edge"
RekaFlash"reka-flash"

AxAIOpenAIResponsesModel

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L8

Enumeration Members

Enumeration MemberValue
GPT35TextDavinci002"text-davinci-002"
GPT35Turbo"gpt-3.5-turbo"
GPT35TurboInstruct"gpt-3.5-turbo-instruct"
GPT3TextAda001"text-ada-001"
GPT3TextBabbage002"text-babbage-002"
GPT4"gpt-4"
GPT41"gpt-4.1"
GPT41Mini"gpt-4.1-mini"
GPT4ChatGPT4O"chatgpt-4o-latest"
GPT4O"gpt-4o"
GPT4OMini"gpt-4o-mini"
GPT4Turbo"gpt-4-turbo"
O1"o1"
O1Mini"o1-mini"
O3"o3"
O3Mini"o3-mini"
O4Mini"o4-mini"

AxSpanKindValues

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/trace/trace.ts#L61

Enumeration Members

Enumeration MemberValue
AGENT"agent"
TASK"task"
TOOL"tool"
UNKNOWN"unknown"
WORKFLOW"workflow"

AxLLMRequestTypeValues

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/trace/trace.ts#L54

Enumeration Members

Enumeration MemberValue
CHAT"chat"
COMPLETION"completion"
RERANK"rerank"
UNKNOWN"unknown"

ax

function ax<IN, OUT>(strings: TemplateStringsArray, ...values: readonly AxSignatureTemplateValue[]): AxGen<IN, OUT>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/template.ts#L95

Type Parameters

Type ParameterDefault type
IN extends AxGenInAxGenIn
OUT extends AxGenerateResult<AxGenOut>AxGenerateResult<AxGenOut>

Parameters

ParameterType
stringsTemplateStringsArray
valuesreadonly AxSignatureTemplateValue[]

Returns

AxGen<IN, OUT>

axAIAnthropicDefaultConfig

function axAIAnthropicDefaultConfig(): AxAIAnthropicConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/api.ts#L37

Returns

AxAIAnthropicConfig

axAIAnthropicVertexDefaultConfig

function axAIAnthropicVertexDefaultConfig(): AxAIAnthropicConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/api.ts#L51

Returns

AxAIAnthropicConfig

axAICohereCreativeConfig

axAICohereDefaultConfig

axAIDeepSeekCodeConfig

function axAIDeepSeekCodeConfig(): DeepSeekConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/deepseek/api.ts#L19

Returns

DeepSeekConfig

axAIDeepSeekDefaultConfig

function axAIDeepSeekDefaultConfig(): DeepSeekConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/deepseek/api.ts#L13

Returns

DeepSeekConfig

axAIGoogleGeminiDefaultConfig

function axAIGoogleGeminiDefaultConfig(): AxAIGoogleGeminiConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/api.ts#L68

AxAIGoogleGemini: Default Model options for text generation

Returns

AxAIGoogleGeminiConfig

axAIGoogleGeminiDefaultCreativeConfig

function axAIGoogleGeminiDefaultCreativeConfig(): AxAIGoogleGeminiConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/api.ts#L84

Returns

AxAIGoogleGeminiConfig

axAIGrokBestConfig

function axAIGrokBestConfig(): AxAIOpenAIConfig<AxAIGrokModel, GrokEmbedSmall>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/x-grok/api.ts#L23

Returns

AxAIOpenAIConfig<AxAIGrokModel, GrokEmbedSmall>

axAIGrokDefaultConfig

function axAIGrokDefaultConfig(): AxAIOpenAIConfig<AxAIGrokModel, GrokEmbedSmall>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/x-grok/api.ts#L14

Returns

AxAIOpenAIConfig<AxAIGrokModel, GrokEmbedSmall>

axAIHuggingFaceCreativeConfig

function axAIHuggingFaceCreativeConfig(): AxAIHuggingFaceConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/huggingface/api.ts#L32

Returns

AxAIHuggingFaceConfig

axAIHuggingFaceDefaultConfig

function axAIHuggingFaceDefaultConfig(): AxAIHuggingFaceConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/huggingface/api.ts#L26

Returns

AxAIHuggingFaceConfig

axAIMistralBestConfig

function axAIMistralBestConfig(): AxAIMistralConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mistral/api.ts#L24

Returns

AxAIMistralConfig

axAIMistralDefaultConfig

function axAIMistralDefaultConfig(): AxAIMistralConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mistral/api.ts#L17

Returns

AxAIMistralConfig

axAIOllamaDefaultConfig

axAIOllamaDefaultCreativeConfig

function axAIOllamaDefaultCreativeConfig(): AxAIOllamaAIConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/ollama/api.ts#L17

Returns

AxAIOllamaAIConfig

axAIOpenAIBestConfig

function axAIOpenAIBestConfig(): AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/api.ts#L48

Returns

AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>

axAIOpenAICreativeConfig

function axAIOpenAICreativeConfig(): AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/api.ts#L57

Returns

AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>

axAIOpenAIDefaultConfig

function axAIOpenAIDefaultConfig(): AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/api.ts#L38

Returns

AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>

axAIOpenAIFastConfig

function axAIOpenAIFastConfig(): AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/api.ts#L67

Returns

AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>

axAIOpenAIResponsesBestConfig

function axAIOpenAIResponsesBestConfig(): AxAIOpenAIResponsesConfig<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_api_base.ts#L39

Returns

AxAIOpenAIResponsesConfig<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel>

axAIOpenAIResponsesCreativeConfig

function axAIOpenAIResponsesCreativeConfig(): AxAIOpenAIResponsesConfig<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_api_base.ts#L48

Returns

AxAIOpenAIResponsesConfig<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel>

axAIOpenAIResponsesDefaultConfig

function axAIOpenAIResponsesDefaultConfig(): AxAIOpenAIResponsesConfig<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_api_base.ts#L27

Returns

AxAIOpenAIResponsesConfig<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel>

axAIRekaCreativeConfig

axAIRekaBestConfig

axAIRekaDefaultConfig

axAITogetherDefaultConfig

function axAITogetherDefaultConfig(): TogetherAIConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/together/api.ts#L9

Returns

TogetherAIConfig

axAIRekaFastConfig

axBaseAIDefaultCreativeConfig

function axBaseAIDefaultCreativeConfig(): AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L56

Returns

AxModelConfig

axBaseAIDefaultConfig

axCreateDefaultTextLogger

function axCreateDefaultTextLogger(output: (message: string) => void): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/loggers.ts#L67

Parameters

ParameterTypeDefault value
output(message: string) => voiddefaultOutput

Returns

AxLoggerFunction

axCreateDefaultLogger

function axCreateDefaultLogger(output: (message: string) => void): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/loggers.ts#L12

Parameters

ParameterTypeDefault value
output(message: string) => voiddefaultOutput

Returns

AxLoggerFunction

axCreateOptimizerLogger

function axCreateOptimizerLogger(output: (message: string) => void): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/loggers.ts#L103

Factory function to create an enhanced optimizer logger with clean visual formatting that works for all optimizer types using semantic tags for proper categorization

Parameters

ParameterType
output(message: string) => void

Returns

AxLoggerFunction

axValidateChatRequestMessage

function axValidateChatRequestMessage(item: 
  | {
  cache?: boolean;
  content: string;
  role: "system";
}
  | {
  content:   | string
     | (
     | {
     cache?: boolean;
     text: string;
     type: "text";
   }
     | {
     cache?: boolean;
     details?: "high" | "low" | "auto";
     image: string;
     mimeType: string;
     type: "image";
   }
     | {
     cache?: boolean;
     data: string;
     format?: "wav";
     type: "audio";
   })[];
  name?: string;
  role: "user";
}
  | {
  cache?: boolean;
  content?: string;
  functionCalls?: object[];
  name?: string;
  role: "assistant";
}
  | {
  cache?: boolean;
  functionId: string;
  isError?: boolean;
  result: string;
  role: "function";
}): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/validate.ts#L10

Validates a chat request message item to ensure it meets the required criteria

Parameters

ParameterTypeDescription
item| { cache?: boolean; content: string; role: "system"; } | { content: | string | ( | { cache?: boolean; text: string; type: "text"; } | { cache?: boolean; details?: "high" | "low" | "auto"; image: string; mimeType: string; type: "image"; } | { cache?: boolean; data: string; format?: "wav"; type: "audio"; })[]; name?: string; role: "user"; } | { cache?: boolean; content?: string; functionCalls?: object[]; name?: string; role: "assistant"; } | { cache?: boolean; functionId: string; isError?: boolean; result: string; role: "function"; }The chat request message to validate

Returns

void

Throws

When validation fails with a descriptive error message

s

function s(strings: TemplateStringsArray, ...values: readonly AxSignatureTemplateValue[]): AxSignature;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/template.ts#L44

Parameters

ParameterType
stringsTemplateStringsArray
valuesreadonly AxSignatureTemplateValue[]

Returns

AxSignature

AxAIAnthropicArgs

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/api.ts#L65

Properties

PropertyType
apiKey?string
config?Readonly<Partial<AxAIAnthropicConfig>>
models?AxAIInputModelList< | AxAIAnthropicModel | AxAIAnthropicVertexModel, undefined>
name"anthropic"
options?Readonly<AxAIServiceOptions>
projectId?string
region?string

axValidateChatResponseResult

function axValidateChatResponseResult(results: 
  | readonly AxChatResponseResult[]
  | Readonly<AxChatResponseResult>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/validate.ts#L190

Validates a chat response result to ensure it meets the required criteria

Parameters

ParameterTypeDescription
results| readonly AxChatResponseResult[] | Readonly<AxChatResponseResult>The chat response results to validate (single result or array)

Returns

void

Throws

When validation fails with a descriptive error message

AxAIAnthropicContentBlockStartEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L195

Properties

PropertyType
content_block| { text: string; type: "text"; } | { id: string; input: object; name: string; type: "tool_use"; } | { thinking: string; type: "thinking"; }
indexnumber
type"content_block_start"

AxAIAnthropicContentBlockDeltaEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L216

Properties

PropertyType
delta| { text: string; type: "text_delta"; } | { partial_json: string; type: "input_json_delta"; } | { thinking: string; type: "thinking_delta"; } | { signature: string; type: "signature_delta"; }
indexnumber
type"content_block_delta"

AxAIAnthropicContentBlockStopEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L239

Properties

PropertyType
indexnumber
type"content_block_stop"

AxAIAnthropicErrorEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L267

Properties

PropertyType
errorobject
error.messagestring
error.type"overloaded_error"
type"error"

AxAIAnthropicMessageDeltaEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L245

Properties

PropertyType
deltaobject
delta.stop_reasonnull | "end_turn" | "max_tokens" | "stop_sequence"
delta.stop_sequencenull | string
type"message_delta"
usageobject
usage.output_tokensnumber

AxAIAnthropicMessageStartEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L177

Properties

PropertyType
messageobject
message.content[]
message.idstring
message.modelstring
message.role"assistant"
message.stop_reasonnull | string
message.stop_sequencenull | string
message.type"message"
message.usageobject
message.usage.input_tokensnumber
message.usage.output_tokensnumber
type"message_start"

AxAIAnthropicMessageStopEvent

AxAIAnthropicPingEvent

AxAICohereArgs

AxAIFeatures

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L30

Properties

PropertyType
functionCot?boolean
functionsboolean
hasShowThoughts?boolean
hasThinkingBudget?boolean
streamingboolean

AxAIGoogleGeminiArgs

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/api.ts#L109

Properties

PropertyType
apiKey?string
config?Readonly<Partial<AxAIGoogleGeminiConfig>>
endpointId?string
modelInfo?AxModelInfo[]
models?AxAIInputModelList<AxAIGoogleGeminiModel, AxAIGoogleGeminiEmbedModel>
name"google-gemini"
options?Readonly<AxAIServiceOptions & AxAIGoogleGeminiOptionsTools>
projectId?string
region?string

AxAIGoogleGeminiOptionsTools

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/api.ts#L99

Properties

PropertyType
codeExecution?boolean
googleSearch?boolean
googleSearchRetrieval?object
googleSearchRetrieval.dynamicThreshold?number
googleSearchRetrieval.mode?"MODE_DYNAMIC"
urlContext?boolean

AxAIGrokOptionsTools

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/x-grok/api.ts#L42

Properties

PropertyType
searchParameters?object
searchParameters.fromDate?string
searchParameters.maxSearchResults?number
searchParameters.mode?"auto" | "on" | "off"
searchParameters.returnCitations?boolean
searchParameters.sources?AxAIGrokSearchSource[]
searchParameters.toDate?string

AxAIGrokSearchSource

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/x-grok/api.ts#L32

Properties

PropertyType
allowedWebsites?string[]
country?string
excludedWebsites?string[]
links?string[]
safeSearch?boolean
type"web" | "x" | "news" | "rss"
xHandles?string[]

AxAIHuggingFaceArgs

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/huggingface/api.ts#L38

Properties

PropertyType
apiKeystring
config?Readonly<Partial<AxAIHuggingFaceConfig>>
models?AxAIInputModelList<MetaLlama270BChatHF, undefined>
name"huggingface"
options?Readonly<AxAIServiceOptions>

AxAIMemory

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/types.ts#L17

Methods

addFunctionResults()

addFunctionResults(results: readonly AxFunctionResult[], sessionId?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/types.ts#L30

Parameters

ParameterType
resultsreadonly AxFunctionResult[]
sessionId?string

Returns

void


addRequest()

addRequest(result: (
  | {
  cache?: boolean;
  content: string;
  role: "system";
}
  | {
  content:   | string
     | (
     | {
     cache?: boolean;
     text: string;
     type: "text";
   }
     | {
     cache?: boolean;
     details?: "high" | "low" | "auto";
     image: string;
     mimeType: string;
     type: "image";
   }
     | {
     cache?: boolean;
     data: string;
     format?: "wav";
     type: "audio";
   })[];
  name?: string;
  role: "user";
}
  | {
  cache?: boolean;
  content?: string;
  functionCalls?: object[];
  name?: string;
  role: "assistant";
}
  | {
  cache?: boolean;
  functionId: string;
  isError?: boolean;
  result: string;
  role: "function";
})[], sessionId?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/types.ts#L18

Parameters

ParameterType
result( | { cache?: boolean; content: string; role: "system"; } | { content: | string | ( | { cache?: boolean; text: string; type: "text"; } | { cache?: boolean; details?: "high" | "low" | "auto"; image: string; mimeType: string; type: "image"; } | { cache?: boolean; data: string; format?: "wav"; type: "audio"; })[]; name?: string; role: "user"; } | { cache?: boolean; content?: string; functionCalls?: object[]; name?: string; role: "assistant"; } | { cache?: boolean; functionId: string; isError?: boolean; result: string; role: "function"; })[]
sessionId?string

Returns

void


addResponse()

addResponse(results: readonly AxChatResponseResult[], sessionId?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/types.ts#L20

Parameters

ParameterType
resultsreadonly AxChatResponseResult[]
sessionId?string

Returns

void


addTag()

addTag(name: string, sessionId?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/types.ts#L40

Parameters

ParameterType
namestring
sessionId?string

Returns

void


getLast()

getLast(sessionId?: string): 
  | undefined
  | {
  chat: object[];
  role: "function" | "system" | "user" | "assistant";
  tags?: string[];
  updatable?: boolean;
};

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/types.ts#L38

Parameters

ParameterType
sessionId?string

Returns

| undefined | { chat: object[]; role: "function" | "system" | "user" | "assistant"; tags?: string[]; updatable?: boolean; }


history()

history(index: number, sessionId?: string): (
  | {
  cache?: boolean;
  content: string;
  role: "system";
}
  | {
  content:   | string
     | (
     | {
     cache?: boolean;
     text: string;
     type: "text";
   }
     | {
     cache?: boolean;
     details?: "high" | "low" | "auto";
     image: string;
     mimeType: string;
     type: "image";
   }
     | {
     cache?: boolean;
     data: string;
     format?: "wav";
     type: "audio";
   })[];
  name?: string;
  role: "user";
}
  | {
  cache?: boolean;
  content?: string;
  functionCalls?: object[];
  name?: string;
  role: "assistant";
}
  | {
  cache?: boolean;
  functionId: string;
  isError?: boolean;
  result: string;
  role: "function";
})[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/types.ts#L35

Parameters

ParameterType
indexnumber
sessionId?string

Returns

( | { cache?: boolean; content: string; role: "system"; } | { content: | string | ( | { cache?: boolean; text: string; type: "text"; } | { cache?: boolean; details?: "high" | "low" | "auto"; image: string; mimeType: string; type: "image"; } | { cache?: boolean; data: string; format?: "wav"; type: "audio"; })[]; name?: string; role: "user"; } | { cache?: boolean; content?: string; functionCalls?: object[]; name?: string; role: "assistant"; } | { cache?: boolean; functionId: string; isError?: boolean; result: string; role: "function"; })[]


reset()

reset(sessionId?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/types.ts#L36

Parameters

ParameterType
sessionId?string

Returns

void


rewindToTag()

rewindToTag(name: string, sessionId?: string): AxMemoryData;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/types.ts#L41

Parameters

ParameterType
namestring
sessionId?string

Returns

AxMemoryData


updateResult()

updateResult(results: Readonly<AxChatResponseResult> & object, sessionId?: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/types.ts#L25

Parameters

ParameterType
resultsReadonly<AxChatResponseResult> & object
sessionId?string

Returns

void

AxAIOpenAIBaseArgs

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/api.ts#L94

Type Parameters

Type Parameter
TModel
TEmbedModel
TChatReq extends AxAIOpenAIChatRequest<TModel>

Properties

PropertyType
apiKeystring
apiURL?string
chatReqUpdater?ChatReqUpdater<TModel, TChatReq>
configReadonly<AxAIOpenAIConfig<TModel, TEmbedModel>>
modelInforeadonly AxModelInfo[]
models?AxAIInputModelList<TModel, TEmbedModel>
options?Readonly<AxAIServiceOptions & object>
supportFor| AxAIFeatures | (model: TModel) => AxAIFeatures

AxAIOpenAIArgs

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/api.ts#L75

Extends

  • Omit<AxAIOpenAIBaseArgs<TModel, TEmbedModel, TChatReq>, "config" | "supportFor" | "modelInfo">

Type Parameters

Type ParameterDefault type
TName"openai"
TModelAxAIOpenAIModel
TEmbedModelAxAIOpenAIEmbedModel
TChatReq extends AxAIOpenAIChatRequest<TModel>AxAIOpenAIChatRequest<TModel>

Properties

PropertyTypeInherited from
apiKeystringOmit.apiKey
apiURL?stringOmit.apiURL
chatReqUpdater?ChatReqUpdater<TModel, TChatReq>Omit.chatReqUpdater
config?Partial<Readonly<AxAIOpenAIConfig<TModel, TEmbedModel>>>-
modelInfo?AxModelInfo[]-
models?AxAIInputModelList<TModel, TEmbedModel>Omit.models
nameTName-
options?Readonly<AxAIServiceOptions & object>Omit.options

AxAIOpenAIResponseDelta

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L83

Type Parameters

Type Parameter
T

Properties

PropertyType
choicesobject[]
creatednumber
idstring
modelstring
objectstring
system_fingerprintstring
usage?AxAIOpenAIUsage

AxAIOpenAIResponsesArgs

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_api_base.ts#L141

Ready-to-use implementation of the OpenAI Responses API client This class uses OpenAI’s /v1/responses API endpoint which supports text, image, and audio inputs

Extends

  • Omit<AxAIOpenAIResponsesBaseArgs<TModel, TEmbedModel, TChatReq>, "config" | "supportFor" | "modelInfo">

Type Parameters

Type ParameterDefault type
TName"openai-responses"
TModelAxAIOpenAIResponsesModel
TEmbedModelAxAIOpenAIEmbedModel
TChatReq extends AxAIOpenAIResponsesRequest<TModel>AxAIOpenAIResponsesRequest<TModel>

Properties

PropertyTypeInherited from
apiKeystringOmit.apiKey
apiURL?stringOmit.apiURL
config?Partial<AxAIOpenAIResponsesConfig<TModel, TEmbedModel>>-
modelInfo?AxModelInfo[]-
models?AxAIInputModelList<TModel, TEmbedModel>Omit.models
nameTName-
options?object & AxAIServiceOptionsOmit.options
responsesReqUpdater?(req: Readonly<TResponsesReq>) => Readonly<TResponsesReq>Omit.responsesReqUpdater

AxAIOpenAIResponsesCodeInterpreterToolCall

AxAIOpenAIResponsesComputerToolCall

AxAIOpenAIResponsesContentPartAddedEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L341

Extends

Properties

PropertyModifierTypeOverridesInherited from
content_indexreadonlynumber--
item_idreadonlystring--
output_indexreadonlynumber--
partreadonlyReadonly< | AxAIOpenAIResponsesOutputTextContentPart | AxAIOpenAIResponsesOutputRefusalContentPart>--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.content_part.added"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesContentPartDoneEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L353

Extends

Properties

PropertyModifierTypeOverridesInherited from
content_indexreadonlynumber--
item_idreadonlystring--
output_indexreadonlynumber--
partreadonlyReadonly< | AxAIOpenAIResponsesOutputTextContentPart | AxAIOpenAIResponsesOutputRefusalContentPart>--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.content_part.done"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesDefineFunctionTool

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L135

Properties

PropertyModifierType
description?readonlystring
namereadonlystring
parametersreadonlyobject
strict?readonlyboolean
typereadonly"function"

AxAIOpenAIResponsesErrorEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L632

Extends

Properties

PropertyModifierTypeOverridesInherited from
codereadonlynull | string--
messagereadonlystring--
paramreadonlynull | string--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"error"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesFileSearchCallCompletedEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L436

Extends

Properties

PropertyModifierTypeOverridesInherited from
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.file_search_call.completed"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesFileSearchCallInProgressEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L422

Extends

Properties

PropertyModifierTypeOverridesInherited from
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.file_search_call.in_progress"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesFileSearchCallSearchingEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L429

Extends

Properties

PropertyModifierTypeOverridesInherited from
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.file_search_call.searching"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesFileSearchToolCall

AxAIOpenAIResponsesFunctionCallArgumentsDeltaEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L404

Extends

Properties

PropertyModifierTypeOverridesInherited from
deltareadonlystring--
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.function_call_arguments.delta"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesFunctionCallArgumentsDoneEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L412

Extends

Properties

PropertyModifierTypeOverridesInherited from
argumentsreadonlystring--
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.function_call_arguments.done"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesFunctionCallItem

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L215

Properties

PropertyType
argumentsstring
call_idstring
idstring
namestring
status?"in_progress" | "completed" | "incomplete" | "searching" | "failed"
type"function_call"

AxAIOpenAIResponsesImageGenerationCallCompletedEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L554

Extends

Properties

PropertyModifierTypeOverridesInherited from
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.image_generation_call.completed"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesImageGenerationCallGeneratingEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L547

Extends

Properties

PropertyModifierTypeOverridesInherited from
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.image_generation_call.generating"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesImageGenerationCallInProgressEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L540

Extends

Properties

PropertyModifierTypeOverridesInherited from
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.image_generation_call.in_progress"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesImageGenerationCallPartialImageEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L561

Extends

Properties

PropertyModifierTypeOverridesInherited from
item_idreadonlystring--
output_indexreadonlynumber--
partial_image_b64readonlystring--
partial_image_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.image_generation_call.partial_image"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesImageGenerationToolCall

AxAIOpenAIResponsesInputAudioContentPart

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L84

Properties

PropertyModifierType
input_audioreadonlyobject
input_audio.datareadonlystring
input_audio.format?readonlystring
typereadonly"input_audio"

AxAIOpenAIResponsesInputFunctionCallOutputItem

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L118

Properties

PropertyModifierType
call_idreadonlystring
id?readonlystring
outputreadonlystring
typereadonly"function_call_output"

AxAIOpenAIResponsesInputFunctionCallItem

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L107

Properties

PropertyModifierType
argumentsreadonlystring
call_idreadonlystring
id?readonlystring
namereadonlystring
typereadonly"function_call"

AxAIOpenAIResponsesInputImageUrlContentPart

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L76

Properties

PropertyModifierType
image_urlreadonlyobject
image_url.details?readonly"high" | "low" | "auto"
image_url.urlreadonlystring
typereadonly"image_url"

AxAIOpenAIResponsesInputMessageItem

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L98

Properties

PropertyModifierType
contentreadonly| string | readonly AxAIOpenAIResponsesInputContentPart[]
name?readonlystring
rolereadonly"system" | "user" | "assistant" | "developer"
typereadonly"message"

AxAIOpenAIResponsesInputTextContentPart

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L71

Properties

PropertyModifierType
textpublicstring
typereadonly"text"

AxAIOpenAIResponsesLocalShellToolCall

AxAIOpenAIResponsesMCPCallArgumentsDeltaEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L578

Extends

Properties

PropertyModifierTypeOverridesInherited from
deltareadonlyobject--
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.mcp_call.arguments.delta"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesMCPCallArgumentsDoneEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L586

Extends

Properties

PropertyModifierTypeOverridesInherited from
argumentsreadonlyobject--
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.mcp_call.arguments.done"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesMCPCallCompletedEvent

AxAIOpenAIResponsesMCPCallFailedEvent

AxAIOpenAIResponsesMCPCallInProgressEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L571

Extends

Properties

PropertyModifierTypeOverridesInherited from
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.mcp_call.in_progress"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesMCPListToolsCompletedEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L610

Extends

Properties

PropertyModifierTypeOverridesInherited from
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.mcp_list_tools.completed"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesMCPListToolsFailedEvent

AxAIOpenAIResponsesMCPToolCall

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L800

Extends

Properties

PropertyTypeOverridesInherited from
argsstring--
error?string--
idstring-AxAIOpenAIResponsesToolCallBase.id
namestring--
output?string--
server_labelstring--
status?string-AxAIOpenAIResponsesToolCallBase.status
type"mcp_call"AxAIOpenAIResponsesToolCallBase.type-

AxAIOpenAIResponsesMCPListToolsInProgressEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L605

Extends

Properties

PropertyModifierTypeOverridesInherited from
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.mcp_list_tools.in_progress"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesOutputItemAddedEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L326

Extends

Properties

PropertyModifierTypeOverridesInherited from
itemreadonlyReadonly<AxAIOpenAIResponsesOutputItem>--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.output_item.added"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesOutputItemDoneEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L333

Extends

Properties

PropertyModifierTypeOverridesInherited from
itemreadonlyReadonly<AxAIOpenAIResponsesOutputItem>--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.output_item.done"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesOutputMessageItem

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L203

Properties

PropertyType
contentreadonly ( | AxAIOpenAIResponsesOutputTextContentPart | AxAIOpenAIResponsesOutputRefusalContentPart)[]
idstring
role"assistant"
status"in_progress" | "completed" | "incomplete"
type"message"

AxAIOpenAIResponsesOutputRefusalContentPart

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L241

Properties

PropertyModifierType
refusalreadonlystring
typereadonly"refusal"

AxAIOpenAIResponsesOutputTextAnnotationAddedEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L621

Extends

Properties

PropertyModifierTypeOverridesInherited from
annotationreadonlyobject--
annotation_indexreadonlynumber--
content_indexreadonlynumber--
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.output_text_annotation.added"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesOutputTextDoneEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L375

Extends

Properties

PropertyModifierTypeOverridesInherited from
content_indexreadonlynumber--
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
textreadonlystring--
typereadonly"response.output_text.done"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesOutputTextContentPart

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L235

Properties

PropertyModifierType
annotations?readonlyreadonly unknown[]
textreadonlystring
typereadonly"output_text"

AxAIOpenAIResponsesOutputTextDeltaEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L366

Extends

Properties

PropertyModifierTypeOverridesInherited from
content_indexreadonlynumber--
deltareadonlystring--
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.output_text.delta"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesReasoningDeltaEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L466

Extends

Properties

PropertyModifierTypeOverridesInherited from
content_indexreadonlynumber--
deltareadonlyobject--
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.reasoning.delta"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesReasoningItem

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L226

Properties

PropertyModifierType
encrypted_content?readonlynull | string
idreadonlystring
status?readonly"in_progress" | "completed" | "incomplete"
summaryreadonlyreadonly (string | object)[]
typereadonly"reasoning"

AxAIOpenAIResponsesReasoningDoneEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L475

Extends

Properties

PropertyModifierTypeOverridesInherited from
content_indexreadonlynumber--
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
textreadonlystring--
typereadonly"response.reasoning.done"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesReasoningSummaryDeltaEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L521

Extends

Properties

PropertyModifierTypeOverridesInherited from
deltareadonlyobject--
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
summary_indexreadonlynumber--
typereadonly"response.reasoning_summary.delta"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesReasoningSummaryDoneEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L530

Extends

Properties

PropertyModifierTypeOverridesInherited from
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
summary_indexreadonlynumber--
textreadonlystring--
typereadonly"response.reasoning_summary.done"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesReasoningSummaryPart

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L247

Properties

PropertyModifierType
textreadonlystring
typereadonly"summary_text"

AxAIOpenAIResponsesReasoningSummaryPartAddedEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L485

Extends

Properties

PropertyModifierTypeOverridesInherited from
item_idreadonlystring--
output_indexreadonlynumber--
partreadonlyReadonly<AxAIOpenAIResponsesReasoningSummaryPart>--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
summary_indexreadonlynumber--
typereadonly"response.reasoning_summary_part.added"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesReasoningSummaryPartDoneEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L494

Extends

Properties

PropertyModifierTypeOverridesInherited from
item_idreadonlystring--
output_indexreadonlynumber--
partreadonlyReadonly<AxAIOpenAIResponsesReasoningSummaryPart>--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
summary_indexreadonlynumber--
typereadonly"response.reasoning_summary_part.done"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesReasoningSummaryTextDeltaEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L503

Extends

Properties

PropertyModifierTypeOverridesInherited from
deltareadonlystring--
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
summary_indexreadonlynumber--
typereadonly"response.reasoning_summary_text.delta"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesReasoningSummaryTextDoneEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L512

Extends

Properties

PropertyModifierTypeOverridesInherited from
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
summary_indexreadonlynumber--
textreadonlystring--
typereadonly"response.reasoning_summary_text.done"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesRefusalDeltaEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L385

Extends

Properties

PropertyModifierTypeOverridesInherited from
content_indexreadonlynumber--
deltareadonlystring--
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.refusal.delta"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesRefusalDoneEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L394

Extends

Properties

PropertyModifierTypeOverridesInherited from
content_indexreadonlynumber--
item_idreadonlystring--
output_indexreadonlynumber--
refusalreadonlystring--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.refusal.done"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesRequest

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L161

Type Parameters

Type ParameterDefault type
TModelAxAIOpenAIResponsesModel

Properties

PropertyModifierType
background?readonlynull | boolean
include?readonly| null | readonly ( | "file_search_call.results" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "reasoning.encrypted_content" | "code_interpreter_call.outputs")[]
inputreadonly| string | readonly AxAIOpenAIResponsesInputItem[]
instructions?readonlynull | string
max_output_tokens?readonlynull | number
metadata?readonlynull | Readonly<Record<string, string>>
modelreadonlyTModel
parallel_tool_calls?readonlynull | boolean
previous_response_id?readonlynull | string
reasoning?readonly| null | { effort?: null | "high" | "low" | "medium"; summary?: null | "auto" | "concise" | "detailed"; }
seed?readonlynull | number
service_tier?readonlynull | "auto" | "default" | "flex"
store?readonlynull | boolean
stream?readonlynull | boolean
temperature?readonlynull | number
text?readonly| null | { format?: | null | { type: "text"; } | { type: "json_object"; } | { json_schema?: object; type: "json_schema"; }; }
tool_choice?readonly| null | AxAIOpenAIResponsesToolChoice
tools?readonly| null | readonly AxAIOpenAIResponsesDefineFunctionTool[]
top_p?readonlynull | number
truncation?readonlynull | "auto" | "disabled"
user?readonlynull | string

AxAIOpenAIResponsesResponse

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L266

Properties

PropertyModifierType
createdreadonlynumber
idreadonlystring
modelreadonlystring
objectreadonlystring
outputreadonlyreadonly AxAIOpenAIResponsesOutputItem[]
usage?readonly| null | { completion_tokens: number; prompt_tokens: number; total_tokens: number; }

AxAIOpenAIResponsesResponseCompletedEvent

AxAIOpenAIResponsesResponseCreatedEvent

AxAIOpenAIResponsesResponseFailedEvent

AxAIOpenAIResponsesResponseDelta

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L688

Properties

PropertyModifierType
delta?readonlyobject
delta.arguments?readonlystring
delta.content?readonlystring
event?readonlystring
id?readonlystring
item?readonlyPartial<Readonly<AxAIOpenAIResponsesOutputItem>>
item_index?readonlynumber
model?readonlystring
response?readonlyReadonly<AxAIOpenAIResponsesResponse>
usage?readonly| null | { completion_tokens: number; prompt_tokens: number; total_tokens: number; }

AxAIOpenAIResponsesResponseInProgressEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L295

Extends

Properties

PropertyModifierTypeOverridesInherited from
responsereadonlyReadonly<AxAIOpenAIResponsesResponse>--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.in_progress"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesResponseIncompleteEvent

AxAIOpenAIResponsesResponseQueuedEvent

AxAIOpenAIResponsesStreamEventBase

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L283

Extended by

Properties

PropertyModifierType
sequence_numberreadonlynumber
typereadonlystring

AxAIOpenAIResponsesToolCallBase

AxAIOpenAIResponsesWebSearchCallCompletedEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L458

Extends

Properties

PropertyModifierTypeOverridesInherited from
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.web_search_call.completed"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesWebSearchCallInProgressEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L444

Extends

Properties

PropertyModifierTypeOverridesInherited from
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.web_search_call.in_progress"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesWebSearchCallSearchingEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L451

Extends

Properties

PropertyModifierTypeOverridesInherited from
item_idreadonlystring--
output_indexreadonlynumber--
sequence_numberreadonlynumber-AxAIOpenAIResponsesStreamEventBase.sequence_number
typereadonly"response.web_search_call.searching"AxAIOpenAIResponsesStreamEventBase.type-

AxAIOpenAIResponsesWebSearchToolCall

AxAIRekaArgs

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/api.ts#L53

Properties

PropertyType
apiKeystring
apiURL?string
config?Readonly<Partial<AxAIRekaConfig>>
modelInfo?readonly AxModelInfo[]
models?AxAIInputModelList<AxAIRekaModel, undefined>
name"reka"
options?Readonly<AxAIServiceOptions & object>

AxAIService

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L326

Type Parameters

Type ParameterDefault type
TModelunknown
TEmbedModelunknown

Methods

chat()

chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<TModel, TEmbedModel>>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L338

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel>>
options?Readonly<AxAIPromptConfig & AxAIServiceActionOptions<TModel, TEmbedModel>>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>


embed()

embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<TModel, TEmbedModel>>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L344

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel>>
options?Readonly<AxAIServiceActionOptions<TModel, TEmbedModel>>

Returns

Promise<AxEmbedResponse>


getFeatures()

getFeatures(model?: TModel): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L329

Parameters

ParameterType
model?TModel

Returns

AxAIFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L327

Returns

string


getLastUsedChatModel()

getLastUsedChatModel(): undefined | TModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L334

Returns

undefined | TModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): undefined | TEmbedModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L335

Returns

undefined | TEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L336

Returns

undefined | AxModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L332

Returns

AxLoggerFunction


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L331

Returns

AxAIServiceMetrics


getModelList()

getModelList(): undefined | AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L330

Returns

undefined | AxAIModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L328

Returns

string


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L350

Returns

Readonly<AxAIServiceOptions>


setOptions()

setOptions(options: Readonly<AxAIServiceOptions>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L349

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

AxAIServiceImpl

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L353

Type Parameters

Type Parameter
TModel
TEmbedModel
TChatRequest
TEmbedRequest
TChatResponse
TChatResponseDelta
TEmbedResponse

Methods

createChatReq()

createChatReq(req: Readonly<AxInternalChatRequest<TModel>>, config: Readonly<AxAIPromptConfig>): [AxAPI, TChatRequest];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L362

Parameters

ParameterType
reqReadonly<AxInternalChatRequest<TModel>>
configReadonly<AxAIPromptConfig>

Returns

[AxAPI, TChatRequest]


createChatResp()

createChatResp(resp: Readonly<TChatResponse>): AxChatResponse;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L367

Parameters

ParameterType
respReadonly<TChatResponse>

Returns

AxChatResponse


createChatStreamResp()?

optional createChatStreamResp(resp: Readonly<TChatResponseDelta>, state: object): AxChatResponse;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L369

Parameters

ParameterType
respReadonly<TChatResponseDelta>
stateobject

Returns

AxChatResponse


createEmbedReq()?

optional createEmbedReq(req: Readonly<AxInternalEmbedRequest<TEmbedModel>>): [AxAPI, TEmbedRequest];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L374

Parameters

ParameterType
reqReadonly<AxInternalEmbedRequest<TEmbedModel>>

Returns

[AxAPI, TEmbedRequest]


createEmbedResp()?

optional createEmbedResp(resp: Readonly<TEmbedResponse>): AxEmbedResponse;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L378

Parameters

ParameterType
respReadonly<TEmbedResponse>

Returns

AxEmbedResponse


getModelConfig()

getModelConfig(): AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L380

Returns

AxModelConfig


getTokenUsage()

getTokenUsage(): undefined | AxTokenUsage;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L382

Returns

undefined | AxTokenUsage

AxAIServiceMetrics

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L200

Properties

PropertyType
errorsobject
errors.chatobject
errors.chat.countnumber
errors.chat.ratenumber
errors.chat.totalnumber
errors.embedobject
errors.embed.countnumber
errors.embed.ratenumber
errors.embed.totalnumber
latencyobject
latency.chatobject
latency.chat.meannumber
latency.chat.p95number
latency.chat.p99number
latency.chat.samplesnumber[]
latency.embedobject
latency.embed.meannumber
latency.embed.p95number
latency.embed.p99number
latency.embed.samplesnumber[]

AxAPI

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L42

Extended by

Properties

PropertyType
headers?Record<string, string>
name?string
put?boolean

AxAPIConfig

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/util/apicall.ts#L49

Extends

  • AxAPI.RequestValidation.ResponseValidation

Properties

PropertyTypeInherited from
abortSignal?AbortSignal-
debug?boolean-
fetch?(input: string | URL | Request, init?: RequestInit) => Promise<Response>-
headers?Record<string, string>AxAPI.headers
name?stringAxAPI.name
put?booleanAxAPI.put
retry?Partial<RetryConfig>-
span?Span-
stream?boolean-
timeout?number-
urlstring | URL-
validateRequest?(request: unknown) => boolean | Promise<boolean>RequestValidation.validateRequest
validateResponse?(response: unknown) => boolean | Promise<boolean>ResponseValidation.validateResponse

AxAgentFeatures

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L42

Properties

PropertyTypeDescription
canConfigureSmartModelRoutingbooleanWhether this agent can use smart model routing (requires an AI service)
excludeFieldsFromPassthroughstring[]List of fields that this agent excludes from parent->child value passing

AxAgentic

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L28

Interface for agents that can be used as child agents. Provides methods to get the agent’s function definition and features.

Extends

Type Parameters

Type Parameter
IN extends AxGenIn
OUT extends AxGenOut

Properties

PropertyTypeInherited from
getTraces() => AxProgramTrace<IN, OUT>[]AxTunable.getTraces
getUsage() => AxModelUsage & object[]AxUsable.getUsage
resetUsage() => voidAxUsable.resetUsage
setDemos(demos: readonly AxProgramDemos<IN, OUT>[]) => voidAxTunable.setDemos
setExamples(examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>) => voidAxTunable.setExamples
setId(id: string) => voidAxTunable.setId
setParentId(parentId: string) => voidAxTunable.setParentId

Methods

getFeatures()

getFeatures(): AxAgentFeatures;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L32

Returns

AxAgentFeatures


getFunction()

getFunction(): AxFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L31

Returns

AxFunction

AxApacheTikaArgs

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/docs/tika.ts#L3

Properties

PropertyType
fetch?(input: string | URL | Request, init?: RequestInit) => Promise<Response>
url?string | URL

AxApacheTikaConvertOptions

AxAssertion

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/asserts.ts#L3

Properties

PropertyType
message?string

Methods

fn()

fn(values: Record<string, unknown>): undefined | boolean | Promise<undefined | boolean>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/asserts.ts#L4

Parameters

ParameterType
valuesRecord<string, unknown>

Returns

undefined | boolean | Promise<undefined | boolean>

AxBaseAIArgs

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/base.ts#L38

Type Parameters

Type Parameter
TModel
TEmbedModel

Properties

PropertyType
apiURLstring
defaultsReadonly<{ embedModel?: TEmbedModel; model: TModel; }>
headers() => Promise<Record<string, string>>
modelInforeadonly AxModelInfo[]
models?AxAIInputModelList<TModel, TEmbedModel>
namestring
options?Readonly<AxAIServiceOptions>
supportFor| AxAIFeatures | (model: TModel) => AxAIFeatures

AxBootstrapCompileOptions

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L359

Extends

Properties

PropertyTypeInherited from
earlyStoppingPatience?numberAxCompileOptions.earlyStoppingPatience
maxDemos?number-
maxIterations?numberAxCompileOptions.maxIterations
overrideCheckpointInterval?numberAxCompileOptions.overrideCheckpointInterval
overrideCheckpointLoad?AxCheckpointLoadFnAxCompileOptions.overrideCheckpointLoad
overrideCheckpointSave?AxCheckpointSaveFnAxCompileOptions.overrideCheckpointSave
overrideCostTracker?AxCostTrackerAxCompileOptions.overrideCostTracker
overrideOnEarlyStop?(reason: string, stats: Readonly<AxOptimizationStats>) => voidAxCompileOptions.overrideOnEarlyStop
overrideOnProgress?(progress: Readonly<AxOptimizationProgress>) => voidAxCompileOptions.overrideOnProgress
overrideTargetScore?numberAxCompileOptions.overrideTargetScore
overrideTeacherAI?AxAIService<unknown, unknown>AxCompileOptions.overrideTeacherAI
overrideValidationSet?readonly AxExample[]AxCompileOptions.overrideValidationSet
saveCheckpointOnComplete?booleanAxCompileOptions.saveCheckpointOnComplete
teacherProgram?Readonly<AxProgram<AxGenIn, AxGenOut>>-
validationExamples?readonly AxExample[]-
verbose?booleanAxCompileOptions.verbose

AxBootstrapOptimizerOptions

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L309

Properties

PropertyType
adaptiveBatching?boolean
batchSize?number
costMonitoring?boolean
debugMode?boolean
diversityWeight?number
dynamicTemperature?boolean
earlyStoppingPatience?number
maxDemos?number
maxExamples?number
maxRounds?number
maxTokensPerGeneration?number
qualityThreshold?number
teacherAI?AxAIService<unknown, unknown>
verboseMode?boolean

AxCompileOptions

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L196

Extended by

Properties

PropertyType
earlyStoppingPatience?number
maxIterations?number
overrideCheckpointInterval?number
overrideCheckpointLoad?AxCheckpointLoadFn
overrideCheckpointSave?AxCheckpointSaveFn
overrideCostTracker?AxCostTracker
overrideOnEarlyStop?(reason: string, stats: Readonly<AxOptimizationStats>) => void
overrideOnProgress?(progress: Readonly<AxOptimizationProgress>) => void
overrideTargetScore?number
overrideTeacherAI?AxAIService<unknown, unknown>
overrideValidationSet?readonly AxExample[]
saveCheckpointOnComplete?boolean
verbose?boolean

AxCostTracker

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L42

Methods

getCurrentCost()

getCurrentCost(): number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L44

Returns

number


getTokenUsage()

getTokenUsage(): Record<string, number>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L45

Returns

Record<string, number>


getTotalTokens()

getTotalTokens(): number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L46

Returns

number


isLimitReached()

isLimitReached(): boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L47

Returns

boolean


reset()

reset(): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L48

Returns

void


trackTokens()

trackTokens(count: number, model: string): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L43

Parameters

ParameterType
countnumber
modelstring

Returns

void

AxCostTrackerOptions

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L88

Properties

PropertyType
costPerModel?Record<string, number>
maxCost?number
maxTokens?number

AxDBBaseOpOptions

AxDBBaseArgs

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/base.ts#L13

Extended by

Properties

PropertyType
fetch?(input: string | URL | Request, init?: RequestInit) => Promise<Response>
tracer?Tracer

AxDBCloudflareArgs

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/cloudflare.ts#L34

Extends

Properties

PropertyTypeOverridesInherited from
accountIdstring--
apiKeystring--
fetch?(input: string | URL | Request, init?: RequestInit) => Promise<Response>AxDBBaseArgs.fetch-
name"cloudflare"--
tracer?Tracer-AxDBBaseArgs.tracer

AxDBLoaderOptions

AxDBManagerArgs

AxDBMatch

AxDBMemoryArgs

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/memory.ts#L11

Extends

Properties

PropertyTypeInherited from
fetch?(input: string | URL | Request, init?: RequestInit) => Promise<Response>AxDBBaseArgs.fetch
name"memory"-
tracer?TracerAxDBBaseArgs.tracer

AxDBPineconeArgs

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/pinecone.ts#L48

Extends

Properties

PropertyTypeOverridesInherited from
apiKeystring--
fetch?(input: string | URL | Request, init?: RequestInit) => Promise<Response>AxDBBaseArgs.fetch-
hoststring--
name"pinecone"--
tracer?Tracer-AxDBBaseArgs.tracer

AxDBQueryService

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/types.ts#L48

Extended by

Methods

query()

query(req: Readonly<AxDBQueryRequest>): Promise<AxDBQueryResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/types.ts#L49

Parameters

ParameterType
reqReadonly<AxDBQueryRequest>

Returns

Promise<AxDBQueryResponse>

AxDBService

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/types.ts#L36

Extends

Methods

batchUpsert()

batchUpsert(batchReq: readonly AxDBUpsertRequest[], update?: boolean): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/types.ts#L42

Parameters

ParameterType
batchReqreadonly AxDBUpsertRequest[]
update?boolean

Returns

Promise<AxDBUpsertResponse>


query()

query(req: Readonly<AxDBQueryRequest>): Promise<AxDBQueryResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/types.ts#L49

Parameters

ParameterType
reqReadonly<AxDBQueryRequest>

Returns

Promise<AxDBQueryResponse>

Inherited from

AxDBQueryService.query


upsert()

upsert(req: Readonly<AxDBUpsertRequest>, update?: boolean): Promise<AxDBUpsertResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/types.ts#L37

Parameters

ParameterType
reqReadonly<AxDBUpsertRequest>
update?boolean

Returns

Promise<AxDBUpsertResponse>

AxDBWeaviateArgs

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/weaviate.ts#L29

Extends

Properties

PropertyTypeOverridesInherited from
apiKeystring--
fetch?(input: string | URL | Request, init?: RequestInit) => Promise<Response>AxDBBaseArgs.fetch-
hoststring--
name"weaviate"--
tracer?Tracer-AxDBBaseArgs.tracer

AxDockerContainer

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/funcs/docker.ts#L3

Properties

PropertyType
Commandstring
Creatednumber
HostConfigobject
HostConfig.NetworkModestring
Idstring
Imagestring
ImageIDstring
Labelsobject
Mountsobject[]
Namesstring[]
NetworkSettingsobject
NetworkSettings.Networksobject
Portsobject[]
SizeRootFsnumber
SizeRwnumber
Stateobject
State.Deadboolean
State.Errorstring
State.ExitCodenumber
State.FinishedAtDate
State.OOMKilledboolean
State.Pausedboolean
State.Pidnumber
State.Restartingboolean
State.Runningboolean
State.StartedAtDate
State.Statusstring
Statusstring

AxFieldDescriptor

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/template.ts#L35

Properties

PropertyModifierType
description?readonlystring
isInternal?readonlyboolean
isOptional?readonlyboolean
namereadonlystring
type?readonlyAxFieldType

AxField

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/sig.ts#L13

Properties

PropertyType
description?string
isInternal?boolean
isOptional?boolean
namestring
title?string
type?object
type.isArray?boolean
type.name| "string" | "number" | "boolean" | "image" | "audio" | "code" | "json" | "datetime" | "date" | "class"
type.options?string[]

AxFieldProcessor

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/fieldProcessor.ts#L24

Properties

PropertyTypeDescription
fieldReadonly<AxField>-
process| AxFieldProcessorProcess | AxStreamingFieldProcessorProcessProcess the field value and return a new value (or undefined if no update is needed). The returned value may be merged back into memory. Param The current field value. Param Additional context (e.g. memory and session id).

AxFieldType

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/template.ts#L16

Properties

PropertyModifierType
description?readonlystring
isArray?readonlyboolean
isInternal?readonlyboolean
isOptional?readonlyboolean
options?readonlyreadonly string[]
typereadonly| "string" | "number" | "boolean" | "image" | "audio" | "code" | "json" | "datetime" | "date" | "class"

AxMCPStreamableHTTPTransportOptions

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/httpTransport.ts#L79

Properties

PropertyTypeDescription
authorization?stringAuthorization header value (convenience for common use case) If provided, will be added to the headers as ‘Authorization’
headers?Record<string, string>Custom headers to include with all HTTP requests Note: Content-Type, Accept, and Mcp-Session-Id are managed automatically

AxMCPTransport

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/transport.ts#L7

Methods

connect()?

optional connect(): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/transport.ts#L27

Connects to the transport if needed This method is optional and only required for transports that need connection setup

Returns

Promise<void>


send()

send(message: Readonly<JSONRPCRequest<unknown>>): Promise<JSONRPCResponse<unknown>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/transport.ts#L13

Sends a JSON-RPC request or notification and returns the response

Parameters

ParameterTypeDescription
messageReadonly<JSONRPCRequest<unknown>>The JSON-RPC request or notification to send

Returns

Promise<JSONRPCResponse<unknown>>

A Promise that resolves to the JSON-RPC response


sendNotification()

sendNotification(message: Readonly<JSONRPCNotification>): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mcp/transport.ts#L21

Sends a JSON-RPC notification

Parameters

ParameterTypeDescription
messageReadonly<JSONRPCNotification>The JSON-RPC notification to send

Returns

Promise<void>

AxMiPROCompileOptions

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L365

Extends

Properties

PropertyTypeInherited from
auto?"medium" | "light" | "heavy"-
customProposer?(context: Readonly<{ dataSummary: string; previousInstructions: string[]; programSummary: string; }>) => Promise<string[]>-
earlyStoppingPatience?numberAxCompileOptions.earlyStoppingPatience
instructionCandidates?string[]-
maxIterations?numberAxCompileOptions.maxIterations
overrideCheckpointInterval?numberAxCompileOptions.overrideCheckpointInterval
overrideCheckpointLoad?AxCheckpointLoadFnAxCompileOptions.overrideCheckpointLoad
overrideCheckpointSave?AxCheckpointSaveFnAxCompileOptions.overrideCheckpointSave
overrideCostTracker?AxCostTrackerAxCompileOptions.overrideCostTracker
overrideOnEarlyStop?(reason: string, stats: Readonly<AxOptimizationStats>) => voidAxCompileOptions.overrideOnEarlyStop
overrideOnProgress?(progress: Readonly<AxOptimizationProgress>) => voidAxCompileOptions.overrideOnProgress
overrideTargetScore?numberAxCompileOptions.overrideTargetScore
overrideTeacherAI?AxAIService<unknown, unknown>AxCompileOptions.overrideTeacherAI
overrideValidationSet?readonly AxExample[]AxCompileOptions.overrideValidationSet
saveCheckpointOnComplete?booleanAxCompileOptions.saveCheckpointOnComplete
teacher?Readonly<AxProgram<AxGenIn, AxGenOut>>-
validationExamples?readonly AxExample[]-
verbose?booleanAxCompileOptions.verbose

AxMiPROResult

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizers/miproV2.ts#L30

Extends

Type Parameters

Type Parameter
IN extends AxGenIn
OUT extends AxGenOut

Properties

PropertyTypeInherited from
bestScorenumberAxOptimizerResult.bestScore
configurationHistory?Record<string, unknown>[]AxOptimizerResult.configurationHistory
demos?AxProgramDemos<AxGenIn, OUT>[]AxOptimizerResult.demos
finalConfiguration?Record<string, unknown>AxOptimizerResult.finalConfiguration
optimizedGen?AxGen<IN, OUT>-
scoreHistory?number[]AxOptimizerResult.scoreHistory
statsAxOptimizationStatsAxOptimizerResult.stats

AxOptimizationCheckpoint

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L52

Properties

PropertyType
bestConfiguration?Record<string, unknown>
bestScorenumber
configurationHistoryRecord<string, unknown>[]
currentRoundnumber
examplesreadonly AxExample[]
optimizerConfigRecord<string, unknown>
optimizerStateRecord<string, unknown>
optimizerTypestring
scoreHistorynumber[]
statsAxOptimizationStats
timestampnumber
totalRoundsnumber
validationSet?readonly AxExample[]
versionstring

AxOptimizationProgress

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L24

Properties

PropertyType
bestScorenumber
convergenceInfo?object
convergenceInfo.improvementnumber
convergenceInfo.isConvergingboolean
convergenceInfo.stagnationRoundsnumber
currentConfiguration?Record<string, unknown>
currentScorenumber
roundnumber
successfulExamplesnumber
timeElapsednumber
tokensUsednumber
totalExamplesnumber
totalRoundsnumber

AxOptimizationStats

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L130

Properties

PropertyType
convergenceInfoobject
convergenceInfo.convergedboolean
convergenceInfo.convergenceThresholdnumber
convergenceInfo.finalImprovementnumber
convergenceInfo.stagnationRoundsnumber
earlyStoppedboolean
earlyStopping?object
earlyStopping.bestScoreRoundnumber
earlyStopping.patienceExhaustedboolean
earlyStopping.reasonstring
estimatedTokenUsagenumber
evaluationBreakdown?object
evaluationBreakdown.crossValidationScores?number[]
evaluationBreakdown.standardDeviation?number
evaluationBreakdown.trainingScorenumber
evaluationBreakdown.validationScorenumber
resourceUsageobject
resourceUsage.avgLatencyPerEvalnumber
resourceUsage.costByModelRecord<string, number>
resourceUsage.peakMemoryUsage?number
resourceUsage.totalTimenumber
resourceUsage.totalTokensnumber
successfulDemosnumber
totalCallsnumber

AxMiPROOptimizerOptions

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L328

Properties

PropertyType
acquisitionFunction?| "expected_improvement" | "upper_confidence_bound" | "probability_improvement"
bayesianOptimization?boolean
dataAwareProposer?boolean
earlyStoppingTrials?number
explorationWeight?number
fewshotAwareProposer?boolean
initTemperature?number
maxBootstrappedDemos?number
maxLabeledDemos?number
minibatch?boolean
minibatchFullEvalSteps?number
minibatchSize?number
minImprovementThreshold?number
numCandidates?number
numTrials?number
programAwareProposer?boolean
sampleCount?number
tipAwareProposer?boolean
verbose?boolean
viewDataBatchSize?number

AxOptimizerResult

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L168

Extended by

Type Parameters

Type Parameter
OUT extends AxGenOut

Properties

PropertyType
bestScorenumber
configurationHistory?Record<string, unknown>[]
demos?AxProgramDemos<AxGenIn, OUT>[]
finalConfiguration?Record<string, unknown>
scoreHistory?number[]
statsAxOptimizationStats

AxOptimizer

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L223

Type Parameters

Type ParameterDefault type
IN extends AxGenInAxGenIn
OUT extends AxGenOutAxGenOut

Methods

cancel()?

optional cancel(): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L276

Cancel ongoing optimization gracefully

Returns

Promise<void>

Promise that resolves when cancellation is complete


compile()

compile(
   program: Readonly<AxProgram<IN, OUT>>, 
   metricFn: AxMetricFn, 
options?: AxCompileOptions): Promise<AxOptimizerResult<OUT>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L234

Optimize a program using the provided metric function

Parameters

ParameterTypeDescription
programReadonly<AxProgram<IN, OUT>>The program to optimize (moved from constructor)
metricFnAxMetricFnEvaluation metric function to assess program performance
options?AxCompileOptionsOptional configuration options that can override constructor settings

Returns

Promise<AxOptimizerResult<OUT>>

Optimization result containing demos, stats, and configuration


compilePareto()?

optional compilePareto(
   program: Readonly<AxProgram<IN, OUT>>, 
   metricFn: AxMultiMetricFn, 
options?: AxCompileOptions): Promise<AxParetoResult<OUT>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L260

Multi-objective optimization using Pareto frontier

Parameters

ParameterTypeDescription
programReadonly<AxProgram<IN, OUT>>The program to optimize
metricFnAxMultiMetricFnMulti-objective metric function
options?AxCompileOptionsOptional configuration options

Returns

Promise<AxParetoResult<OUT>>

Pareto optimization result


compileStream()?

optional compileStream(
   program: Readonly<AxProgram<IN, OUT>>, 
   metricFn: AxMetricFn, 
options?: AxCompileOptions): AsyncIterableIterator<AxOptimizationProgress>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L247

Optimize a program with real-time streaming updates

Parameters

ParameterTypeDescription
programReadonly<AxProgram<IN, OUT>>The program to optimize
metricFnAxMetricFnEvaluation metric function
options?AxCompileOptionsOptional configuration options

Returns

AsyncIterableIterator<AxOptimizationProgress>

Async iterator yielding optimization progress


getConfiguration()?

optional getConfiguration(): Record<string, unknown>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L287

Get optimizer-specific configuration

Returns

Record<string, unknown>

Current optimizer configuration


getStats()

getStats(): AxOptimizationStats;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L270

Get current optimization statistics

Returns

AxOptimizationStats

Current optimization statistics


reset()?

optional reset(): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L281

Reset optimizer state for reuse with different programs

Returns

void


updateConfiguration()?

optional updateConfiguration(config: Readonly<Record<string, unknown>>): void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L293

Update optimizer configuration

Parameters

ParameterTypeDescription
configReadonly<Record<string, unknown>>New configuration to merge with existing

Returns

void


validateProgram()?

optional validateProgram(program: Readonly<AxProgram<IN, OUT>>): object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L300

Validate that the optimizer can handle the given program

Parameters

ParameterTypeDescription
programReadonly<AxProgram<IN, OUT>>Program to validate

Returns

object

Validation result with any issues found

NameType
issuesstring[]
isValidboolean
suggestionsstring[]

AxParetoResult

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L180

Extends

Type Parameters

Type ParameterDefault type
OUT extends AxGenOutAxGenOut

Properties

PropertyTypeInherited from
bestScorenumberAxOptimizerResult.bestScore
configurationHistory?Record<string, unknown>[]AxOptimizerResult.configurationHistory
convergenceMetrics?Record<string, number>-
demos?AxProgramDemos<AxGenIn, OUT>[]AxOptimizerResult.demos
finalConfiguration?Record<string, unknown>AxOptimizerResult.finalConfiguration
hypervolume?number-
paretoFrontreadonly object[]-
paretoFrontSizenumber-
scoreHistory?number[]AxOptimizerResult.scoreHistory
statsAxOptimizationStatsAxOptimizerResult.stats

AxPromptTemplateOptions

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/prompt.ts#L12

Properties

PropertyType
functions?readonly ( | AxFunction | { toFunction: () => | AxFunction | AxFunction[]; })[]
thoughtFieldName?string

AxProgramWithSignatureOptions

AxRateLimiterTokenUsageOptions

AxResponseHandlerArgs

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L68

Type Parameters

Type Parameter
T

Properties

PropertyType
aiReadonly<AxAIService>
functionsreadonly AxFunction[]
memAxAIMemory
model?string
resT
sessionId?string
span?Span
strictMode?boolean
traceId?string

AxSamplePickerOptions

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/samples.ts#L10

Type Parameters

Type Parameter
OUT extends AxGenOut

Properties

PropertyType
resultPicker?AxResultPickerFunction<OUT>

AxSignatureConfig

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/sig.ts#L49

Properties

PropertyType
description?string
inputsreadonly AxField[]
outputsreadonly AxField[]

AxSimpleClassifierForwardOptions

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/classifier.ts#L7

Properties

PropertyType
abortSignal?AbortSignal
cutoff?number

AxStreamingAssertion

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/asserts.ts#L10

Properties

PropertyType
fieldNamestring
message?string

Methods

fn()

fn(content: string, done?: boolean): undefined | boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/asserts.ts#L12

Parameters

ParameterType
contentstring
done?boolean

Returns

undefined | boolean

AxStreamingEvent

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L80

Type Parameters

Type Parameter
T

Properties

PropertyType
dataobject
data.contentDelta?string
data.error?string
data.functions?AxChatResponseFunctionCall[]
data.partialValues?Partial<T>
event"error" | "done" | "delta"

AxTunable

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L152

Extended by

Type Parameters

Type Parameter
IN extends AxGenIn
OUT extends AxGenOut

Properties

PropertyType
getTraces() => AxProgramTrace<IN, OUT>[]
setDemos(demos: readonly AxProgramDemos<IN, OUT>[]) => void
setExamples(examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>) => void
setId(id: string) => void
setParentId(parentId: string) => void

AxUsable

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L163

Extended by

Properties

PropertyType
getUsage() => AxModelUsage & object[]
resetUsage() => void

@ax-llm/ax

Enumerations

EnumerationDescription
AxAIAnthropicModel-
AxAIAnthropicVertexModel-
AxAICohereEmbedModelCohere: Models for use in embeddings
AxAICohereModelCohere: Models for text generation
AxAIDeepSeekModelDeepSeek: Models for text generation
AxAIGoogleGeminiEmbedModel-
AxAIGoogleGeminiEmbedTypes-
AxAIGoogleGeminiModel-
AxAIGoogleGeminiSafetyCategory-
AxAIGoogleGeminiSafetyThreshold-
AxAIGrokEmbedModels-
AxAIGrokModel-
AxAIGroqModel-
AxAIHuggingFaceModel-
AxAIMistralEmbedModels-
AxAIMistralModel-
AxAIOpenAIEmbedModel-
AxAIOpenAIModel-
AxAIOpenAIResponsesModel-
AxAIRekaModel-
AxJSInterpreterPermission-
AxLLMRequestTypeValues-
AxSpanKindValues-

Classes

ClassDescription
AxAgentAn AI agent that can process inputs using an AI service and coordinate with child agents. Supports features like smart model routing and automatic input field passing to child agents.
AxAI-
AxAIAnthropic-
AxAIAzureOpenAI-
AxAICohere-
AxAIDeepSeek-
AxAIGoogleGeminiAxAIGoogleGemini: AI Service
AxAIGrok-
AxAIGroq-
AxAIHuggingFace-
AxAIMistral-
AxAIOllamaOllamaAI: AI Service
AxAIOpenAI-
AxAIOpenAIBase-
AxAIOpenAIResponsesBase class for OpenAI AI services using the /v1/responses API endpoint
AxAIOpenAIResponsesBaseBase class for OpenAI AI services using the /v1/responses API endpoint
AxAIOpenAIResponsesImpl-
AxAIRefusalError-
AxAIReka-
AxAIServiceAbortedError-
AxAIServiceAuthenticationError-
AxAIServiceError-
AxAIServiceNetworkError-
AxAIServiceResponseError-
AxAIServiceStatusError-
AxAIServiceStreamTerminatedError-
AxAIServiceTimeoutError-
AxAITogether-
AxApacheTika-
AxAssertionError-
AxBalancerBalancer that rotates through services.
AxBaseAI-
AxBaseOptimizerAbstract base class for optimizers that provides common functionality and standardized handling of AxOptimizerArgs
AxBootstrapFewShotAbstract base class for optimizers that provides common functionality and standardized handling of AxOptimizerArgs
AxChainOfThought-
AxDB-
AxDBBase-
AxDBCloudflareCloudflare: DB Service
AxDBManager-
AxDBMemoryMemoryDB: DB Service
AxDBPineconePinecone: DB Service
AxDBWeaviateWeaviate: DB Service
AxDefaultCostTracker-
AxDefaultResultReranker-
AxDockerSession-
AxEmbeddingAdapter-
AxFlowAxFlow - A fluent, chainable API for building and orchestrating complex, stateful AI programs.
AxFunctionError-
AxFunctionProcessor-
AxGen-
AxGenerateError-
AxHFDataLoader-
AxInstanceRegistry-
AxJSInterpreter-
AxMCPClient-
AxMCPHTTPSSETransport-
AxMCPStdioTransport-
AxMCPStreambleHTTPTransportAxMCPStreambleHTTPTransport implements the 2025-03-26 Streamable HTTP transport specification This transport uses a single HTTP endpoint that supports both POST and GET methods
AxMemory-
AxMiPROAbstract base class for optimizers that provides common functionality and standardized handling of AxOptimizerArgs
AxMockAIService-
AxMultiServiceRouter-
AxProgram-
AxProgramWithSignature-
AxPromptTemplate-
AxRAG-
AxRateLimiterTokenUsage-
AxSignature-
AxSimpleClassifier-
AxSimpleClassifierClass-
AxTestPrompt-

Interfaces

InterfaceDescription
AxAgentFeatures-
AxAgenticInterface for agents that can be used as child agents. Provides methods to get the agent’s function definition and features.
AxAIAnthropicArgs-
AxAIAnthropicContentBlockDeltaEvent-
AxAIAnthropicContentBlockStartEvent-
AxAIAnthropicContentBlockStopEvent-
AxAIAnthropicErrorEvent-
AxAIAnthropicMessageDeltaEvent-
AxAIAnthropicMessageStartEvent-
AxAIAnthropicMessageStopEvent-
AxAIAnthropicPingEvent-
AxAICohereArgs-
AxAIFeatures-
AxAIGoogleGeminiArgs-
AxAIGoogleGeminiOptionsTools-
AxAIGrokOptionsTools-
AxAIGrokSearchSource-
AxAIHuggingFaceArgs-
AxAIMemory-
AxAIOpenAIArgs-
AxAIOpenAIBaseArgs-
AxAIOpenAIResponseDelta-
AxAIOpenAIResponsesArgsReady-to-use implementation of the OpenAI Responses API client This class uses OpenAI’s /v1/responses API endpoint which supports text, image, and audio inputs
AxAIOpenAIResponsesCodeInterpreterToolCall-
AxAIOpenAIResponsesComputerToolCall-
AxAIOpenAIResponsesContentPartAddedEvent-
AxAIOpenAIResponsesContentPartDoneEvent-
AxAIOpenAIResponsesDefineFunctionTool-
AxAIOpenAIResponsesErrorEvent-
AxAIOpenAIResponsesFileSearchCallCompletedEvent-
AxAIOpenAIResponsesFileSearchCallInProgressEvent-
AxAIOpenAIResponsesFileSearchCallSearchingEvent-
AxAIOpenAIResponsesFileSearchToolCall-
AxAIOpenAIResponsesFunctionCallArgumentsDeltaEvent-
AxAIOpenAIResponsesFunctionCallArgumentsDoneEvent-
AxAIOpenAIResponsesFunctionCallItem-
AxAIOpenAIResponsesImageGenerationCallCompletedEvent-
AxAIOpenAIResponsesImageGenerationCallGeneratingEvent-
AxAIOpenAIResponsesImageGenerationCallInProgressEvent-
AxAIOpenAIResponsesImageGenerationCallPartialImageEvent-
AxAIOpenAIResponsesImageGenerationToolCall-
AxAIOpenAIResponsesInputAudioContentPart-
AxAIOpenAIResponsesInputFunctionCallItem-
AxAIOpenAIResponsesInputFunctionCallOutputItem-
AxAIOpenAIResponsesInputImageUrlContentPart-
AxAIOpenAIResponsesInputMessageItem-
AxAIOpenAIResponsesInputTextContentPart-
AxAIOpenAIResponsesLocalShellToolCall-
AxAIOpenAIResponsesMCPCallArgumentsDeltaEvent-
AxAIOpenAIResponsesMCPCallArgumentsDoneEvent-
AxAIOpenAIResponsesMCPCallCompletedEvent-
AxAIOpenAIResponsesMCPCallFailedEvent-
AxAIOpenAIResponsesMCPCallInProgressEvent-
AxAIOpenAIResponsesMCPListToolsCompletedEvent-
AxAIOpenAIResponsesMCPListToolsFailedEvent-
AxAIOpenAIResponsesMCPListToolsInProgressEvent-
AxAIOpenAIResponsesMCPToolCall-
AxAIOpenAIResponsesOutputItemAddedEvent-
AxAIOpenAIResponsesOutputItemDoneEvent-
AxAIOpenAIResponsesOutputMessageItem-
AxAIOpenAIResponsesOutputRefusalContentPart-
AxAIOpenAIResponsesOutputTextAnnotationAddedEvent-
AxAIOpenAIResponsesOutputTextContentPart-
AxAIOpenAIResponsesOutputTextDeltaEvent-
AxAIOpenAIResponsesOutputTextDoneEvent-
AxAIOpenAIResponsesReasoningDeltaEvent-
AxAIOpenAIResponsesReasoningDoneEvent-
AxAIOpenAIResponsesReasoningItem-
AxAIOpenAIResponsesReasoningSummaryDeltaEvent-
AxAIOpenAIResponsesReasoningSummaryDoneEvent-
AxAIOpenAIResponsesReasoningSummaryPart-
AxAIOpenAIResponsesReasoningSummaryPartAddedEvent-
AxAIOpenAIResponsesReasoningSummaryPartDoneEvent-
AxAIOpenAIResponsesReasoningSummaryTextDeltaEvent-
AxAIOpenAIResponsesReasoningSummaryTextDoneEvent-
AxAIOpenAIResponsesRefusalDeltaEvent-
AxAIOpenAIResponsesRefusalDoneEvent-
AxAIOpenAIResponsesRequest-
AxAIOpenAIResponsesResponse-
AxAIOpenAIResponsesResponseCompletedEvent-
AxAIOpenAIResponsesResponseCreatedEvent-
AxAIOpenAIResponsesResponseDelta-
AxAIOpenAIResponsesResponseFailedEvent-
AxAIOpenAIResponsesResponseIncompleteEvent-
AxAIOpenAIResponsesResponseInProgressEvent-
AxAIOpenAIResponsesResponseQueuedEvent-
AxAIOpenAIResponsesStreamEventBase-
AxAIOpenAIResponsesToolCallBase-
AxAIOpenAIResponsesWebSearchCallCompletedEvent-
AxAIOpenAIResponsesWebSearchCallInProgressEvent-
AxAIOpenAIResponsesWebSearchCallSearchingEvent-
AxAIOpenAIResponsesWebSearchToolCall-
AxAIRekaArgs-
AxAIService-
AxAIServiceImpl-
AxAIServiceMetrics-
AxApacheTikaArgs-
AxApacheTikaConvertOptions-
AxAPI-
AxAPIConfig-
AxAssertion-
AxBaseAIArgs-
AxBootstrapCompileOptions-
AxBootstrapOptimizerOptions-
AxCompileOptions-
AxCostTracker-
AxCostTrackerOptions-
AxDBBaseArgs-
AxDBBaseOpOptions-
AxDBCloudflareArgs-
AxDBLoaderOptions-
AxDBManagerArgs-
AxDBMatch-
AxDBMemoryArgs-
AxDBPineconeArgs-
AxDBQueryService-
AxDBService-
AxDBWeaviateArgs-
AxDockerContainer-
AxField-
AxFieldDescriptor-
AxFieldProcessor-
AxFieldType-
AxMCPStreamableHTTPTransportOptions-
AxMCPTransport-
AxMiPROCompileOptions-
AxMiPROOptimizerOptions-
AxMiPROResult-
AxOptimizationCheckpoint-
AxOptimizationProgress-
AxOptimizationStats-
AxOptimizer-
AxOptimizerResult-
AxParetoResult-
AxProgramWithSignatureOptions-
AxPromptTemplateOptions-
AxRateLimiterTokenUsageOptions-
AxResponseHandlerArgs-
AxSamplePickerOptions-
AxSignatureConfig-
AxSimpleClassifierForwardOptions-
AxStreamingAssertion-
AxStreamingEvent-
AxTunable-
AxUsable-

Type Aliases

Type AliasDescription
AxAgentOptions-
AxAIAnthropicChatError-
AxAIAnthropicChatRequest-
AxAIAnthropicChatRequestCacheParam-
AxAIAnthropicChatResponse-
AxAIAnthropicChatResponseDelta-
AxAIAnthropicConfig-
AxAIAnthropicThinkingConfig-
AxAIAnthropicThinkingTokenBudgetLevels-
AxAIArgs-
AxAIAzureOpenAIArgs-
AxAIAzureOpenAIConfig-
AxAICohereChatRequest-
AxAICohereChatRequestToolResults-
AxAICohereChatResponse-
AxAICohereChatResponseDelta-
AxAICohereChatResponseToolCalls-
AxAICohereConfigCohere: Model options for text generation
AxAICohereEmbedRequest-
AxAICohereEmbedResponse-
AxAIDeepSeekArgs-
AxAIEmbedModels-
AxAIGoogleGeminiBatchEmbedRequestAxAIGoogleGeminiEmbedRequest: Structure for making an embedding request to the Google Gemini API.
AxAIGoogleGeminiBatchEmbedResponseAxAIGoogleGeminiEmbedResponse: Structure for handling responses from the Google Gemini API embedding requests.
AxAIGoogleGeminiChatRequest-
AxAIGoogleGeminiChatResponse-
AxAIGoogleGeminiChatResponseDelta-
AxAIGoogleGeminiConfigAxAIGoogleGeminiConfig: Configuration options for Google Gemini API
AxAIGoogleGeminiContent-
AxAIGoogleGeminiContentPart-
AxAIGoogleGeminiGenerationConfig-
AxAIGoogleGeminiSafetySettings-
AxAIGoogleGeminiThinkingConfig-
AxAIGoogleGeminiThinkingTokenBudgetLevels-
AxAIGoogleGeminiTool-
AxAIGoogleGeminiToolConfig-
AxAIGoogleGeminiToolFunctionDeclaration-
AxAIGoogleGeminiToolGoogleSearchRetrieval-
AxAIGoogleVertexBatchEmbedRequestAxAIGoogleVertexBatchEmbedRequest: Structure for making an embedding request to the Google Vertex API.
AxAIGoogleVertexBatchEmbedResponseAxAIGoogleVertexBatchEmbedResponse: Structure for handling responses from the Google Vertex API embedding requests.
AxAIGrokArgs-
AxAIGrokChatRequest-
AxAIGroqArgs-
AxAIHuggingFaceConfig-
AxAIHuggingFaceRequest-
AxAIHuggingFaceResponse-
AxAIInputModelList-
AxAIMistralArgs-
AxAIMistralChatRequest-
AxAIModelList-
AxAIModelListBase-
AxAIModels-
AxAIOllamaAIConfig-
AxAIOllamaArgs-
AxAIOpenAIAnnotation-
AxAIOpenAIChatRequest-
AxAIOpenAIChatResponse-
AxAIOpenAIChatResponseDelta-
AxAIOpenAIConfig-
AxAIOpenAIEmbedRequest-
AxAIOpenAIEmbedResponse-
AxAIOpenAILogprob-
AxAIOpenAIResponsesConfig-
AxAIOpenAIResponsesInputContentPart-
AxAIOpenAIResponsesInputItem-
AxAIOpenAIResponsesOutputItem-
AxAIOpenAIResponsesStreamEvent-
AxAIOpenAIResponsesToolCall-
AxAIOpenAIResponsesToolChoice-
AxAIOpenAIResponsesToolDefinition-
AxAIOpenAIUrlCitation-
AxAIOpenAIUsage-
AxAIPromptConfig-
AxAIRekaChatRequest-
AxAIRekaChatResponse-
AxAIRekaChatResponseDelta-
AxAIRekaConfig-
AxAIRekaUsage-
AxAIServiceActionOptions-
AxAIServiceOptions-
AxAITogetherArgs-
AxBalancerOptionsOptions for the balancer.
AxChatRequest-
AxChatResponse-
AxChatResponseFunctionCall-
AxChatResponseResult-
AxCheckpointLoadFn-
AxCheckpointSaveFn-
AxDataRow-
AxDBArgs-
AxDBCloudflareOpOptions-
AxDBMemoryOpOptions-
AxDBPineconeOpOptions-
AxDBQueryRequest-
AxDBQueryResponse-
AxDBState-
AxDBUpsertRequest-
AxDBUpsertResponse-
AxDBWeaviateOpOptions-
AxEmbedRequest-
AxEmbedResponse-
AxEvaluateArgs-
AxExample-
AxFieldProcessorProcess-
AxFieldTemplateFn-
AxFieldValue-
AxFunction-
AxFunctionHandler-
AxFunctionJSONSchema-
AxFunctionResult-
AxGenDeltaOut-
AxGenerateErrorDetails-
AxGenerateResult-
AxGenIn-
AxGenOut-
AxGenStreamingOut-
AxIField-
AxInputFunctionType-
AxInternalChatRequest-
AxInternalEmbedRequest-
AxLoggerFunction-
AxLoggerTag-
AxMemoryData-
AxMessage-
AxMetricFn-
AxMetricFnArgs-
AxMockAIServiceConfig-
AxModelConfig-
AxModelInfo-
AxModelInfoWithProvider-
AxModelUsage-
AxMultiMetricFn-
AxOptimizerArgs-
AxProgramDemos-
AxProgramExamples-
AxProgramForwardOptions-
AxProgramStreamingForwardOptions-
AxProgramTrace-
AxProgramUsage-
AxRateLimiterFunction-
AxRerankerIn-
AxRerankerOut-
AxResultPickerFunction-
AxResultPickerFunctionFieldResults-
AxResultPickerFunctionFunctionResults-
AxRewriteIn-
AxRewriteOut-
AxSetExamplesOptions-
AxSignatureTemplateValue-
AxStreamingFieldProcessorProcess-
AxTokenUsage-

Variables

VariableDescription
axAIAzureOpenAIBestConfig-
axAIAzureOpenAICreativeConfig-
axAIAzureOpenAIDefaultConfig-
axAIAzureOpenAIFastConfig-
axDefaultOptimizerLoggerDefault optimizer logger instance
AxEvalUtil-
axGlobals-
axModelInfoAnthropic-
axModelInfoCohere-
axModelInfoDeepSeek-
axModelInfoGoogleGeminiAxAIGoogleGemini: Model information
axModelInfoGrok-
axModelInfoGroqAxAIGroq: Model information
axModelInfoHuggingFaceHuggingFace: Model information
axModelInfoMistral-
axModelInfoOpenAIOpenAI: Model information
axModelInfoRekaOpenAI: Model information
axModelInfoTogether-
axSpanAttributes-
axSpanEvents-
AxStringUtil-
f-

Functions

FunctionDescription
ax-
axAIAnthropicDefaultConfig-
axAIAnthropicVertexDefaultConfig-
axAICohereCreativeConfig-
axAICohereDefaultConfig-
axAIDeepSeekCodeConfig-
axAIDeepSeekDefaultConfig-
axAIGoogleGeminiDefaultConfigAxAIGoogleGemini: Default Model options for text generation
axAIGoogleGeminiDefaultCreativeConfig-
axAIGrokBestConfig-
axAIGrokDefaultConfig-
axAIHuggingFaceCreativeConfig-
axAIHuggingFaceDefaultConfig-
axAIMistralBestConfig-
axAIMistralDefaultConfig-
axAIOllamaDefaultConfig-
axAIOllamaDefaultCreativeConfig-
axAIOpenAIBestConfig-
axAIOpenAICreativeConfig-
axAIOpenAIDefaultConfig-
axAIOpenAIFastConfig-
axAIOpenAIResponsesBestConfig-
axAIOpenAIResponsesCreativeConfig-
axAIOpenAIResponsesDefaultConfig-
axAIRekaBestConfig-
axAIRekaCreativeConfig-
axAIRekaDefaultConfig-
axAIRekaFastConfig-
axAITogetherDefaultConfig-
axBaseAIDefaultConfig-
axBaseAIDefaultCreativeConfig-
axCreateDefaultLogger-
axCreateDefaultTextLogger-
axCreateOptimizerLoggerFactory function to create an enhanced optimizer logger with clean visual formatting that works for all optimizer types using semantic tags for proper categorization
axValidateChatRequestMessageValidates a chat request message item to ensure it meets the required criteria
axValidateChatResponseResultValidates a chat response result to ensure it meets the required criteria
s-

AxAIAnthropicChatError

AxAIAnthropicChatRequest

type AxAIAnthropicChatRequest = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L52

Properties

anthropic_version?

optional anthropic_version: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L54


max_tokens?

optional max_tokens: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L114


messages

messages: (
  | {
  content:   | string
     | (
     | ... & ...
     | ... & ...
     | {
     content: ... | ...;
     is_error?: boolean;
     tool_use_id: string;
     type: "tool_result";
   })[];
  role: "user";
}
  | {
  content:   | string
     | (
     | {
     text: string;
     type: "text";
   }
     | {
     id: string;
     input: object;
     name: string;
     type: "tool_use";
   }
     | {
     signature?: string;
     thinking: string;
     type: "thinking";
   }
     | {
     signature?: string;
     thinking: string;
     type: "redacted_thinking";
   })[];
  role: "assistant";
})[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L55


metadata?

optional metadata: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L128

user_id

user_id: string;

model?

optional model: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L53


stop_sequences?

optional stop_sequences: string[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L116


stream?

optional stream: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L117


system?

optional system: 
  | string
  | object & AxAIAnthropicChatRequestCacheParam[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L118


temperature?

optional temperature: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L124


thinking?

optional thinking: AxAIAnthropicThinkingConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L127


tool_choice?

optional tool_choice: 
  | {
  type: "auto" | "any";
}
  | {
  name?: string;
  type: "tool";
};

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L113


tools?

optional tools: object & AxAIAnthropicChatRequestCacheParam[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L108


top_k?

optional top_k: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L126


top_p?

optional top_p: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L125

AxAIAnthropicChatRequestCacheParam

type AxAIAnthropicChatRequestCacheParam = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L47

Properties

cache_control?

optional cache_control: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L48

type

type: "ephemeral";

AxAIAnthropicChatResponse

type AxAIAnthropicChatResponse = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L133

Properties

content

content: (
  | {
  text: string;
  type: "text";
}
  | {
  id: string;
  input?: string;
  name: string;
  type: "tool_use";
}
  | {
  signature?: string;
  thinking: string;
  type: "thinking";
}
  | {
  signature?: string;
  thinking: string;
  type: "redacted_thinking";
})[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L137


id

id: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L134


model

model: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L159


role

role: "assistant";

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L136


stop_reason

stop_reason: "end_turn" | "max_tokens" | "stop_sequence" | "tool_use";

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L160


stop_sequence?

optional stop_sequence: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L161


type

type: "message";

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L135


usage

usage: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L162

input_tokens

input_tokens: number;

output_tokens

output_tokens: number;

AxAIAnthropicChatResponseDelta

type AxAIAnthropicChatResponseDelta = 
  | AxAIAnthropicMessageStartEvent
  | AxAIAnthropicContentBlockStartEvent
  | AxAIAnthropicContentBlockDeltaEvent
  | AxAIAnthropicContentBlockStopEvent
  | AxAIAnthropicMessageDeltaEvent
  | AxAIAnthropicMessageStopEvent
  | AxAIAnthropicPingEvent
  | AxAIAnthropicErrorEvent;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/anthropic/types.ts#L276

AxAIAnthropicConfig

AxAIAnthropicThinkingConfig

AxAIAnthropicThinkingTokenBudgetLevels

AxAIAzureOpenAIArgs

type AxAIAzureOpenAIArgs = AxAIOpenAIArgs<"azure-openai", AxAIOpenAIModel, AxAIOpenAIEmbedModel> & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/azure-openai/api.ts#L30

Type declaration

NameType
deploymentNamestring
resourceNamestring
version?string

AxAIArgs

type AxAIArgs = 
  | AxAIOpenAIArgs
  | AxAIOpenAIResponsesArgs
  | AxAIAzureOpenAIArgs
  | AxAITogetherArgs
  | AxAIAnthropicArgs
  | AxAIGroqArgs
  | AxAIGoogleGeminiArgs
  | AxAICohereArgs
  | AxAIHuggingFaceArgs
  | AxAIMistralArgs
  | AxAIDeepSeekArgs
  | AxAIOllamaArgs
  | AxAIRekaArgs;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L56

AxAIAzureOpenAIConfig

type AxAIAzureOpenAIConfig = AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/azure-openai/api.ts#L26

AxAICohereChatRequest

type AxAICohereChatRequest = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L41

Properties

chat_history

chat_history: (
  | {
  message: string;
  role: "CHATBOT";
  tool_calls?: AxAICohereChatResponseToolCalls;
}
  | {
  message: string;
  role: "SYSTEM";
}
  | {
  message: string;
  role: "USER";
}
  | {
  message?: string;
  role: "TOOL";
  tool_results: AxAICohereChatRequestToolResults;
})[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L44


end_sequences?

optional end_sequences: readonly string[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L72


frequency_penalty?

optional frequency_penalty: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L70


k?

optional k: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L68


max_tokens?

optional max_tokens: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L66


message?

optional message: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L42


model

model: AxAICohereModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L65


p?

optional p: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L69


preamble?

optional preamble: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L43


presence_penalty?

optional presence_penalty: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L71


stop_sequences?

optional stop_sequences: string[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L73


temperature?

optional temperature: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L67


tool_results?

optional tool_results: AxAICohereChatRequestToolResults;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L86


tools?

optional tools: object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L74

description

description: string;

name

name: string;

parameter_definitions

parameter_definitions: Record<string, {
  description: string;
  required: boolean;
  type: string;
}>;

AxAICohereChatRequestToolResults

type AxAICohereChatRequestToolResults = object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L36

Type declaration

NameType
callAxAICohereChatResponseToolCalls[0]
outputsobject[]

AxAICohereChatResponse

AxAICohereChatResponseDelta

type AxAICohereChatResponseDelta = AxAICohereChatResponse & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L109

Type declaration

NameType
event_type| "stream-start" | "text-generation" | "tool-calls-generation" | "stream-end"

AxAICohereChatResponseToolCalls

type AxAICohereChatResponseToolCalls = object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L31

Type declaration

NameType
namestring
parameters?object

AxAICohereConfig

type AxAICohereConfig = AxModelConfig & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/cohere/types.ts#L26

Cohere: Model options for text generation

Type declaration

NameType
embedModel?AxAICohereEmbedModel
modelAxAICohereModel

AxAICohereEmbedResponse

AxAIDeepSeekArgs

type AxAIDeepSeekArgs = AxAIOpenAIArgs<"deepseek", AxAIDeepSeekModel, undefined>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/deepseek/api.ts#L25

AxAICohereEmbedRequest

AxAIGoogleGeminiBatchEmbedRequest

type AxAIGoogleGeminiBatchEmbedRequest = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L212

AxAIGoogleGeminiEmbedRequest: Structure for making an embedding request to the Google Gemini API.

Properties

requests

requests: object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L213

content

{
  parts: object[];
}

model

model: string;

AxAIGoogleGeminiBatchEmbedResponse

type AxAIGoogleGeminiBatchEmbedResponse = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L224

AxAIGoogleGeminiEmbedResponse: Structure for handling responses from the Google Gemini API embedding requests.

Properties

embeddings

embeddings: object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L225

values

values: number[];

AxAIEmbedModels

type AxAIEmbedModels = 
  | AxAIOpenAIEmbedModel
  | AxAIGoogleGeminiEmbedModel
  | AxAICohereEmbedModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L81

AxAIGoogleGeminiChatRequest

AxAIGoogleGeminiChatResponse

type AxAIGoogleGeminiChatResponse = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L145

Properties

candidates

candidates: object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L146

citationMetadata

{
  citations: object[];
}

content

content: AxAIGoogleGeminiContent;

finishReason

finishReason: 
  | "STOP"
  | "MAX_TOKENS"
  | "SAFETY"
  | "RECITATION"
  | "OTHER"
  | "MALFORMED_FUNCTION_CALL";

usageMetadata

usageMetadata: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L171

candidatesTokenCount

candidatesTokenCount: number;

promptTokenCount

promptTokenCount: number;

thoughtsTokenCount

thoughtsTokenCount: number;

totalTokenCount

totalTokenCount: number;

AxAIGoogleGeminiChatResponseDelta

type AxAIGoogleGeminiChatResponseDelta = AxAIGoogleGeminiChatResponse;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L179

AxAIGoogleGeminiContent

AxAIGoogleGeminiConfig

type AxAIGoogleGeminiConfig = AxModelConfig & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L197

AxAIGoogleGeminiConfig: Configuration options for Google Gemini API

Type declaration

NameType
autoTruncate?boolean
dimensions?number
embedModel?AxAIGoogleGeminiEmbedModel
embedType?AxAIGoogleGeminiEmbedTypes
modelAxAIGoogleGeminiModel
safetySettings?AxAIGoogleGeminiSafetySettings
thinking?AxAIGoogleGeminiThinkingConfig
thinkingTokenBudgetLevels?AxAIGoogleGeminiThinkingTokenBudgetLevels
urlContext?string

AxAIGoogleGeminiContentPart

type AxAIGoogleGeminiContentPart = object & 
  | {
  text: string;
}
  | {
  inlineData: {
     data: string;
     mimeType: string;
  };
}
  | {
  functionCall: {
     args: object;
     name: string;
  };
}
  | {
  functionResponse: {
     name: string;
     response: object;
  };
}
  | {
  fileData: {
     fileUri: string;
     mimeType: string;
  };
}
  | {
  executableCode: object;
}
  | {
  codeExecutionResult: object;
};

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L55

Type declaration

NameType
metadata?{ videoMetadata: object; }
thought?boolean

AxAIGoogleGeminiGenerationConfig

type AxAIGoogleGeminiGenerationConfig = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L116

Properties

candidateCount?

optional candidateCount: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L121


frequencyPenalty?

optional frequencyPenalty: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L120


maxOutputTokens?

optional maxOutputTokens: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L122


responseMimeType?

optional responseMimeType: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L124


stopSequences?

optional stopSequences: readonly string[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L123


temperature?

optional temperature: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L117


thinkingConfig?

optional thinkingConfig: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L125

includeThoughts?

optional includeThoughts: boolean;

thinkingBudget?

optional thinkingBudget: number;

topK?

optional topK: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L119


topP?

optional topP: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L118

AxAIGoogleGeminiSafetySettings

AxAIGoogleGeminiThinkingConfig

AxAIGoogleGeminiThinkingTokenBudgetLevels

AxAIGoogleGeminiTool

type AxAIGoogleGeminiTool = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L101

Properties

code_execution?

optional code_execution: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L103


function_declarations?

optional function_declarations: AxAIGoogleGeminiToolFunctionDeclaration[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L102


optional google_search: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L105


google_search_retrieval?

optional google_search_retrieval: AxAIGoogleGeminiToolGoogleSearchRetrieval;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L104


url_context?

optional url_context: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L106

AxAIGoogleGeminiToolFunctionDeclaration

AxAIGoogleGeminiToolConfig

type AxAIGoogleGeminiToolConfig = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L109

Properties

function_calling_config

function_calling_config: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L110

allowed_function_names?

optional allowed_function_names: string[];

mode

mode: "ANY" | "NONE" | "AUTO";

AxAIGoogleVertexBatchEmbedRequest

type AxAIGoogleVertexBatchEmbedRequest = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L233

AxAIGoogleVertexBatchEmbedRequest: Structure for making an embedding request to the Google Vertex API.

Properties

instances

instances: object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L234

content

content: string;

task_type?

optional task_type: AxAIGoogleGeminiEmbedTypes;

parameters

parameters: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L238

autoTruncate?

optional autoTruncate: boolean;

outputDimensionality?

optional outputDimensionality: number;

AxAIGoogleGeminiToolGoogleSearchRetrieval

type AxAIGoogleGeminiToolGoogleSearchRetrieval = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L94

Properties

dynamic_retrieval_config

dynamic_retrieval_config: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L95

dynamic_threshold?

optional dynamic_threshold: number;

mode?

optional mode: "MODE_DYNAMIC";

AxAIGrokArgs

type AxAIGrokArgs = AxAIOpenAIArgs<"grok", AxAIGrokModel, AxAIGrokEmbedModels, AxAIGrokChatRequest> & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/x-grok/api.ts#L64

Type declaration

NameType
modelInfo?AxModelInfo[]
options?Readonly<AxAIServiceOptions & AxAIGrokOptionsTools> & object

AxAIGoogleVertexBatchEmbedResponse

type AxAIGoogleVertexBatchEmbedResponse = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L247

AxAIGoogleVertexBatchEmbedResponse: Structure for handling responses from the Google Vertex API embedding requests.

Properties

predictions

predictions: object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/types.ts#L248

embeddings

{
  values: number[];
}

AxAIGrokChatRequest

type AxAIGrokChatRequest = AxAIOpenAIChatRequest<AxAIGrokModel> & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/x-grok/api.ts#L53

Type declaration

NameType
search_parameters?{ from_date?: string; max_search_results?: number; mode?: "auto" | "on" | "off"; return_citations?: boolean; sources?: AxAIGrokSearchSource[]; to_date?: string; }

AxAIGroqArgs

type AxAIGroqArgs = AxAIOpenAIArgs<"groq", AxAIGroqModel, undefined> & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/groq/api.ts#L22

Type declaration

NameType
modelInfo?AxModelInfo[]
options?Readonly<AxAIServiceOptions> & object

AxAIHuggingFaceConfig

type AxAIHuggingFaceConfig = AxModelConfig & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/huggingface/types.ts#L7

Type declaration

NameType
doSample?boolean
maxTime?number
modelAxAIHuggingFaceModel
returnFullText?boolean
useCache?boolean
waitForModel?boolean

AxAIHuggingFaceRequest

type AxAIHuggingFaceRequest = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/huggingface/types.ts#L16

Properties

inputs

inputs: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/huggingface/types.ts#L18


model

model: AxAIHuggingFaceModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/huggingface/types.ts#L17


options?

optional options: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/huggingface/types.ts#L30

use_cache?

optional use_cache: boolean;

wait_for_model?

optional wait_for_model: boolean;

parameters

parameters: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/huggingface/types.ts#L19

do_sample?

optional do_sample: boolean;

max_new_tokens?

optional max_new_tokens: number;

max_time?

optional max_time: number;

num_return_sequences?

optional num_return_sequences: number;

repetition_penalty?

optional repetition_penalty: number;

return_full_text?

optional return_full_text: boolean;

temperature?

optional temperature: number;

top_k?

optional top_k: number;

top_p?

optional top_p: number;

AxAIHuggingFaceResponse

AxAIInputModelList

type AxAIInputModelList<TModel, TEmbedModel> = AxAIModelListBase & object & 
  | {
  model: TModel;
}
  | {
  embedModel: TEmbedModel;
}[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L9

Type Parameters

Type Parameter
TModel
TEmbedModel

AxAIMistralArgs

type AxAIMistralArgs = AxAIOpenAIArgs<"mistral", AxAIMistralModel, AxAIMistralEmbedModels> & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mistral/api.ts#L70

Type declaration

NameType
modelInfo?AxModelInfo[]
options?Readonly<AxAIServiceOptions> & object

AxAIMistralChatRequest

type AxAIMistralChatRequest = Omit<AxAIOpenAIChatRequest<AxAIMistralModel>, "max_completion_tokens" | "stream_options" | "messages"> & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mistral/api.ts#L30

Type declaration

NameType
max_tokens?number
messages( | { content: string; role: "system"; } | { content: | string | ( | { text: …; type: …; } | { image_url: …; type: …; })[]; name?: string; role: "user"; } | { content: string; name?: string; role: "assistant"; tool_calls?: object[]; } | { content: string; role: "tool"; tool_call_id: string; })[]

AxAIModelList

type AxAIModelList = AxAIModelListBase & 
  | {
  model: string;
}
  | {
  embedModel: string;
}[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L18

AxAIModelListBase

AxAIOllamaAIConfig

type AxAIOllamaAIConfig = AxAIOpenAIConfig<string, string>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/ollama/api.ts#L8

AxAIModels

type AxAIModels = 
  | AxAIOpenAIModel
  | AxAIAnthropicModel
  | AxAIGroqModel
  | AxAIGoogleGeminiModel
  | AxAICohereModel
  | AxAIHuggingFaceModel
  | AxAIMistralModel
  | AxAIDeepSeekModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/wrap.ts#L71

AxAIOllamaArgs

type AxAIOllamaArgs = AxAIOpenAIArgs<"ollama", string, string> & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/ollama/api.ts#L24

Type declaration

NameType
embedModel?string
model?string
url?string

AxAIOpenAIAnnotation

AxAIOpenAIChatRequest

type AxAIOpenAIChatRequest<TModel> = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L97

Type Parameters

Type Parameter
TModel

Properties

frequency_penalty?

optional frequency_penalty: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L181


logit_bias?

optional logit_bias: Map<string, number>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L182


max_completion_tokens?

optional max_completion_tokens: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L174


messages

messages: (
  | {
  content: string;
  role: "system";
}
  | {
  content:   | string
     | (
     | {
     text: string;
     type: string;
   }
     | {
     image_url: {
        details?: ...;
        url: ...;
     };
     type: "image_url";
   }
     | {
     input_audio: {
        data: ...;
        format?: ...;
     };
     type: "input_audio";
   }
     | {
     file: {
        file_data: ...;
        filename: ...;
     };
     type: "file";
   })[];
  name?: string;
  role: "user";
}
  | {
  content:   | string
     | {
     text: string;
     type: string;
   };
  name?: string;
  role: "assistant";
}
  | {
  content?:   | string
     | {
     text: string;
     type: string;
   };
  name?: string;
  role: "assistant";
  tool_calls: object[];
}
  | {
  content: string;
  role: "tool";
  tool_call_id: string;
})[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L101


model

model: TModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L98


n?

optional n: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L177


organization?

optional organization: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L184


presence_penalty?

optional presence_penalty: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L180


reasoning_effort?

optional reasoning_effort: "low" | "medium" | "high";

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L99


response_format?

optional response_format: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L173

type

type: string;

stop?

optional stop: readonly string[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L179


store?

optional store: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L100


stream?

optional stream: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L178


temperature?

optional temperature: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L175


tool_choice?

optional tool_choice: 
  | "none"
  | "auto"
  | "required"
  | {
  function: {
     name: string;
  };
  type: "function";
};

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L168


tools?

optional tools: object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L160

function

{
  description: string;
  name: string;
  parameters?: object;
}

type

type: "function";

top_p?

optional top_p: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L176


user?

optional user: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L183


web_search_options?

optional web_search_options: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L185

search_context_size?

optional search_context_size: "low" | "medium" | "high";

user_location?

optional user_location: 
  | {
  approximate: {
     city?: string;
     country?: string;
     region?: string;
     timezone?: string;
     type: "approximate";
  };
}
  | null;

AxAIOpenAIChatResponseDelta

type AxAIOpenAIChatResponseDelta = AxAIOpenAIResponseDelta<{
  annotations?: AxAIOpenAIAnnotation[];
  content: string | null;
  reasoning_content?: string;
  refusal?: string | null;
  role?: string;
  tool_calls?: NonNullable<...[...][0]["message"]["tool_calls"]>[0] & object[];
}>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L231

AxAIOpenAIChatResponse

type AxAIOpenAIChatResponse = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L199

Properties

choices

choices: object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L204

finish_reason

finish_reason: "stop" | "length" | "content_filter" | "tool_calls";

index

index: number;

message

{
  annotations?: AxAIOpenAIAnnotation[];
  content: string | null;
  reasoning_content?: string;
  refusal: string | null;
  role: string;
  tool_calls?: object[];
}

created

created: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L202


error?

optional error: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L222

code

code: number;

message

message: string;

param

param: string;

type

type: string;

id

id: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L200


model

model: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L203


object

object: "chat.completion";

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L201


system_fingerprint

system_fingerprint: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L228


usage?

optional usage: AxAIOpenAIUsage;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L221

AxAIOpenAIConfig

type AxAIOpenAIConfig<TModel, TEmbedModel> = Omit<AxModelConfig, "topK"> & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/chat_types.ts#L38

Type declaration

NameType
bestOf?number
dimensions?number
echo?boolean
embedModel?TEmbedModel
logitBias?Map<string, number>
logprobs?number
modelTModel
reasoningEffort?"low" | "medium" | "high"
responseFormat?"json_object"
serviceTier?"auto" | "default" | "flex"
stop?string[]
store?boolean
suffix?string | null
user?string
webSearchOptions?{ searchContextSize?: "low" | "medium" | "high"; userLocation?: | { approximate: { city?: string; country?: string; region?: string; timezone?: string; type: "approximate"; }; } | null; }

Type Parameters

Type Parameter
TModel
TEmbedModel

AxAIOpenAIEmbedRequest

AxAIOpenAIEmbedResponse

AxAIOpenAILogprob

AxAIOpenAIResponsesConfig

type AxAIOpenAIResponsesConfig<TModel, TEmbedModel> = Omit<AxModelConfig, "topK"> & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L726

Type declaration

NameType
bestOf?number
dimensions?number
echo?boolean
embedModel?TEmbedModel
logitBias?Map<string, number>
logprobs?number
modelTModel
parallelToolCalls?boolean
reasoningEffort?"low" | "medium" | "high"
responseFormat?"text" | "json_object" | "json_schema"
seed?number
serviceTier?"auto" | "default" | "flex"
stop?string[]
store?boolean
suffix?string | null
systemPrompt?string
user?string

Type Parameters

Type Parameter
TModel
TEmbedModel

AxAIOpenAIResponsesInputContentPart

type AxAIOpenAIResponsesInputContentPart = 
  | AxAIOpenAIResponsesInputTextContentPart
  | AxAIOpenAIResponsesInputImageUrlContentPart
  | AxAIOpenAIResponsesInputAudioContentPart;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L92

AxAIOpenAIResponsesInputItem

type AxAIOpenAIResponsesInputItem = 
  | string
  | AxAIOpenAIResponsesInputMessageItem
  | AxAIOpenAIResponsesInputFunctionCallItem
  | AxAIOpenAIResponsesInputFunctionCallOutputItem;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L128

AxAIOpenAIResponsesOutputItem

type AxAIOpenAIResponsesOutputItem = 
  | AxAIOpenAIResponsesOutputMessageItem
  | AxAIOpenAIResponsesFunctionCallItem
  | AxAIOpenAIResponsesReasoningItem
  | AxAIOpenAIResponsesFileSearchToolCall
  | AxAIOpenAIResponsesWebSearchToolCall
  | AxAIOpenAIResponsesComputerToolCall
  | AxAIOpenAIResponsesCodeInterpreterToolCall
  | AxAIOpenAIResponsesImageGenerationToolCall
  | AxAIOpenAIResponsesLocalShellToolCall
  | AxAIOpenAIResponsesMCPToolCall;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L253

AxAIOpenAIResponsesStreamEvent

type AxAIOpenAIResponsesStreamEvent = 
  | AxAIOpenAIResponsesResponseCreatedEvent
  | AxAIOpenAIResponsesResponseInProgressEvent
  | AxAIOpenAIResponsesResponseCompletedEvent
  | AxAIOpenAIResponsesResponseFailedEvent
  | AxAIOpenAIResponsesResponseIncompleteEvent
  | AxAIOpenAIResponsesResponseQueuedEvent
  | AxAIOpenAIResponsesOutputItemAddedEvent
  | AxAIOpenAIResponsesOutputItemDoneEvent
  | AxAIOpenAIResponsesContentPartAddedEvent
  | AxAIOpenAIResponsesContentPartDoneEvent
  | AxAIOpenAIResponsesOutputTextDeltaEvent
  | AxAIOpenAIResponsesOutputTextDoneEvent
  | AxAIOpenAIResponsesRefusalDeltaEvent
  | AxAIOpenAIResponsesRefusalDoneEvent
  | AxAIOpenAIResponsesFunctionCallArgumentsDeltaEvent
  | AxAIOpenAIResponsesFunctionCallArgumentsDoneEvent
  | AxAIOpenAIResponsesFileSearchCallInProgressEvent
  | AxAIOpenAIResponsesFileSearchCallSearchingEvent
  | AxAIOpenAIResponsesFileSearchCallCompletedEvent
  | AxAIOpenAIResponsesWebSearchCallInProgressEvent
  | AxAIOpenAIResponsesWebSearchCallSearchingEvent
  | AxAIOpenAIResponsesWebSearchCallCompletedEvent
  | AxAIOpenAIResponsesReasoningDeltaEvent
  | AxAIOpenAIResponsesReasoningDoneEvent
  | AxAIOpenAIResponsesReasoningSummaryPartAddedEvent
  | AxAIOpenAIResponsesReasoningSummaryPartDoneEvent
  | AxAIOpenAIResponsesReasoningSummaryTextDeltaEvent
  | AxAIOpenAIResponsesReasoningSummaryTextDoneEvent
  | AxAIOpenAIResponsesReasoningSummaryDeltaEvent
  | AxAIOpenAIResponsesReasoningSummaryDoneEvent
  | AxAIOpenAIResponsesImageGenerationCallInProgressEvent
  | AxAIOpenAIResponsesImageGenerationCallGeneratingEvent
  | AxAIOpenAIResponsesImageGenerationCallCompletedEvent
  | AxAIOpenAIResponsesImageGenerationCallPartialImageEvent
  | AxAIOpenAIResponsesMCPCallInProgressEvent
  | AxAIOpenAIResponsesMCPCallArgumentsDeltaEvent
  | AxAIOpenAIResponsesMCPCallArgumentsDoneEvent
  | AxAIOpenAIResponsesMCPCallCompletedEvent
  | AxAIOpenAIResponsesMCPCallFailedEvent
  | AxAIOpenAIResponsesMCPListToolsInProgressEvent
  | AxAIOpenAIResponsesMCPListToolsCompletedEvent
  | AxAIOpenAIResponsesMCPListToolsFailedEvent
  | AxAIOpenAIResponsesOutputTextAnnotationAddedEvent
  | AxAIOpenAIResponsesErrorEvent;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L641

AxAIOpenAIResponsesToolCall

type AxAIOpenAIResponsesToolCall = 
  | AxAIOpenAIResponsesFunctionCallItem
  | AxAIOpenAIResponsesFileSearchToolCall
  | AxAIOpenAIResponsesWebSearchToolCall
  | AxAIOpenAIResponsesComputerToolCall
  | AxAIOpenAIResponsesCodeInterpreterToolCall
  | AxAIOpenAIResponsesImageGenerationToolCall
  | AxAIOpenAIResponsesLocalShellToolCall
  | AxAIOpenAIResponsesMCPToolCall;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L810

AxAIOpenAIResponsesToolDefinition

type AxAIOpenAIResponsesToolDefinition = AxAIOpenAIResponsesDefineFunctionTool;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L147

AxAIOpenAIUrlCitation

AxAIOpenAIResponsesToolChoice

type AxAIOpenAIResponsesToolChoice = 
  | "none"
  | "auto"
  | "required"
  | {
  name: string;
  type: "function";
}
  | {
  type: "file_search";
};

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/responses_types.ts#L151

AxAIOpenAIUsage

AxAIPromptConfig

type AxAIPromptConfig = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L287

Properties

showThoughts?

optional showThoughts: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L296


stream?

optional stream: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L288


thinkingTokenBudget?

optional thinkingTokenBudget: "minimal" | "low" | "medium" | "high" | "highest" | "none";

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L289

AxAIRekaChatRequest

type AxAIRekaChatRequest = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L20

Properties

frequency_penalty?

optional frequency_penalty: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L51


max_tokens?

optional max_tokens: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L44


messages

messages: (
  | {
  content: string | object[];
  role: "user";
}
  | {
  content: string | object[];
  role: "assistant";
})[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L22


model

model: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L21


presence_penalty?

optional presence_penalty: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L50


response_format?

optional response_format: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L43

type

type: string;

stop?

optional stop: readonly string[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L49


stream?

optional stream: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L48


temperature?

optional temperature: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L45


top_k?

optional top_k: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L47


top_p?

optional top_p: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L46


usage?

optional usage: AxAIRekaUsage;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L42


use_search_engine?

optional use_search_engine: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L52

AxAIRekaChatResponse

type AxAIRekaChatResponse = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L55

Properties

id

id: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L56


model

model: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L57


responses

responses: object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L58

finish_reason

finish_reason: "stop" | "length" | "context";

message

{
  content:   | string
     | {
     text: string;
     type: "text";
   };
}

usage?

optional usage: AxAIRekaUsage;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L69

AxAIRekaChatResponseDelta

type AxAIRekaChatResponseDelta = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L72

Properties

id

id: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L73


model

model: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L74


responses

responses: object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L75

chunk

chunk: AxAIRekaChatResponse["responses"][0]["message"];

finish_reason

finish_reason: AxAIRekaChatResponse["responses"][0]["finish_reason"];

usage?

optional usage: AxAIRekaUsage;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L79

AxAIRekaConfig

type AxAIRekaConfig = Omit<AxModelConfig, "topK"> & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/types.ts#L9

Type declaration

NameType
modelAxAIRekaModel
stop?readonly string[]
useSearchEngine?boolean

AxAIRekaUsage

AxAIServiceActionOptions

type AxAIServiceActionOptions<TModel, TEmbedModel> = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L310

Type Parameters

Type ParameterDefault type
TModelunknown
TEmbedModelunknown

Properties

abortSignal?

optional abortSignal: AbortSignal;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L322


ai?

optional ai: Readonly<AxAIService<TModel, TEmbedModel>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L314


debug?

optional debug: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L319


debugHideSystemPrompt?

optional debugHideSystemPrompt: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L320


logger?

optional logger: AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L323


rateLimiter?

optional rateLimiter: AxRateLimiterFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L318


sessionId?

optional sessionId: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L315


timeout?

optional timeout: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L317


traceContext?

optional traceContext: Context;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L321


traceId?

optional traceId: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L316

AxAIServiceOptions

AxAITogetherArgs

type AxAITogetherArgs = AxAIOpenAIArgs<"together", string, unknown>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/together/api.ts#L16

AxBalancerOptions

type AxBalancerOptions = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L31

Options for the balancer.

Properties

comparator()?

optional comparator: (a: AxAIService, b: AxAIService) => number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L32

Parameters

ParameterType
aAxAIService
bAxAIService

Returns

number


debug?

optional debug: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L33


initialBackoffMs?

optional initialBackoffMs: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L34


maxBackoffMs?

optional maxBackoffMs: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L35


maxRetries?

optional maxRetries: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/balance.ts#L36

AxAgentOptions

type AxAgentOptions = Omit<AxProgramForwardOptions, "functions"> & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/prompts/agent.ts#L35

Type declaration

NameTypeDescription
debug?boolean-
disableSmartModelRouting?boolean-
excludeFieldsFromPassthrough?string[]List of field names that should not be automatically passed from parent to child agents

AxChatResponse

AxChatRequest

type AxChatRequest<TModel> = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L138

Type Parameters

Type ParameterDefault type
TModelstring

Properties

chatPrompt

chatPrompt: (
  | {
  cache?: boolean;
  content: string;
  role: "system";
}
  | {
  content:   | string
     | (
     | {
     cache?: boolean;
     text: string;
     type: "text";
   }
     | {
     cache?: boolean;
     details?: ... | ... | ...;
     image: string;
     mimeType: string;
     type: "image";
   }
     | {
     cache?: boolean;
     data: string;
     format?: "wav";
     type: "audio";
   })[];
  name?: string;
  role: "user";
}
  | {
  cache?: boolean;
  content?: string;
  functionCalls?: object[];
  name?: string;
  role: "assistant";
}
  | {
  cache?: boolean;
  functionId: string;
  isError?: boolean;
  result: string;
  role: "function";
})[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L139


functionCall?

optional functionCall: 
  | "none"
  | "auto"
  | "required"
  | {
  function: {
     name: string;
  };
  type: "function";
};

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L191


functions?

optional functions: Readonly<{
  description: string;
  name: string;
  parameters?: AxFunctionJSONSchema;
}>[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L186


model?

optional model: TModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L197


modelConfig?

optional modelConfig: AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L196

AxChatResponseFunctionCall

AxChatResponseResult

type AxChatResponseResult = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L89

Properties

annotations?

optional annotations: object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L100

type

type: "url_citation";

url_citation

{
  description?: string;
  title?: string;
  url: string;
}

content?

optional content: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L91


finishReason?

optional finishReason: "stop" | "length" | "function_call" | "content_filter" | "error";

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L108


functionCalls?

optional functionCalls: object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L95

function

{
  name: string;
  params?: string | object;
}

id

id: string;

type

type: "function";

id?

optional id: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L94


index

index: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L90


name?

optional name: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L93


thought?

optional thought: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L92

AxCheckpointLoadFn

type AxCheckpointLoadFn = (checkpointId: string) => Promise<
  | AxOptimizationCheckpoint
| null>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L83

Parameters

ParameterType
checkpointIdstring

Returns

Promise< | AxOptimizationCheckpoint | null>

AxDBArgs

type AxDBArgs = 
  | AxDBCloudflareArgs
  | AxDBPineconeArgs
  | AxDBWeaviateArgs
  | AxDBMemoryArgs;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/wrap.ts#L13

AxCheckpointSaveFn

type AxCheckpointSaveFn = (checkpoint: Readonly<AxOptimizationCheckpoint>) => Promise<string>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L80

Parameters

ParameterType
checkpointReadonly<AxOptimizationCheckpoint>

Returns

Promise<string>

AxDBCloudflareOpOptions

AxDBMemoryOpOptions

AxDBPineconeOpOptions

AxDBQueryRequest

AxDBQueryResponse

type AxDBQueryResponse = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/types.ts#L27

Properties

matches

matches: object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/types.ts#L28

id

id: string;

metadata?

optional metadata: Record<string, string>;

score

score: number;

table?

optional table: string;

AxDBState

type AxDBState = Record<string, Record<string, AxDBUpsertRequest>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/db/memory.ts#L15

AxDBUpsertRequest

AxDBUpsertResponse

AxDBWeaviateOpOptions

AxDataRow

AxEmbedRequest

type AxEmbedRequest<TEmbedModel> = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L232

Type Parameters

Type ParameterDefault type
TEmbedModelstring

Properties

embedModel?

optional embedModel: TEmbedModel;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L234


texts?

optional texts: readonly string[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L233

AxEmbedResponse

AxEvaluateArgs

AxExample

AxFieldProcessorProcess

type AxFieldProcessorProcess = (value: AxFieldValue, context?: Readonly<{
  done?: boolean;
  sessionId?: string;
  values?: AxGenOut;
}>) => unknown | Promise<unknown>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/fieldProcessor.ts#L7

Parameters

ParameterType
valueAxFieldValue
context?Readonly<{ done?: boolean; sessionId?: string; values?: AxGenOut; }>

Returns

unknown | Promise<unknown>

AxFieldValue

type AxFieldValue = 
  | string
  | string[]
  | number
  | boolean
  | object
  | null
  | undefined
  | {
  data: string;
  mimeType: string;
}
  | object[]
  | {
  data: string;
  format?: "wav";
}
  | object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/types.ts#L1

AxFieldTemplateFn

type AxFieldTemplateFn = (field: Readonly<AxField>, value: Readonly<AxFieldValue>) => any[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/prompt.ts#L37

Parameters

ParameterType
fieldReadonly<AxField>
valueReadonly<AxFieldValue>

Returns

any[]

AxFunction

AxFunctionHandler

type AxFunctionHandler = (args?: any, extra?: Readonly<{
  ai?: AxAIService;
  debug?: boolean;
  sessionId?: string;
  traceId?: string;
}>) => unknown;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L53

Parameters

ParameterType
args?any
extra?Readonly<{ ai?: AxAIService; debug?: boolean; sessionId?: string; traceId?: string; }>

Returns

unknown

AxFunctionJSONSchema

AxFunctionResult

type AxFunctionResult = Extract<AxChatRequest["chatPrompt"][number], {
  role: "function";
}> & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L84

Type declaration

NameType
indexnumber

AxGenIn

type AxGenIn = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/types.ts#L14

Index Signature

[key: string]: AxFieldValue

AxGenDeltaOut

AxGenOut

type AxGenOut = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/types.ts#L16

Index Signature

[key: string]: AxFieldValue

AxGenStreamingOut

type AxGenStreamingOut<OUT> = AsyncGenerator<AxGenDeltaOut<OUT>, void, unknown>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L127

Type Parameters

Type Parameter
OUT extends AxGenOut

AxGenerateErrorDetails

type AxGenerateErrorDetails = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L720

Properties

maxTokens?

optional maxTokens: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L722


model?

optional model: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L721


signature

signature: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L724

description?

optional description: string;

input

input: Readonly<AxIField[]>;

output

output: Readonly<AxIField[]>;

streaming

streaming: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L723

AxIField

type AxIField = Omit<AxField, "title"> & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/sig.ts#L36

Type declaration

NameType
titlestring

AxGenerateResult

type AxGenerateResult<OUT> = OUT & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/generate.ts#L64

Type declaration

NameType
thought?string

Type Parameters

Type Parameter
OUT extends AxGenOut

AxInputFunctionType

type AxInputFunctionType = (
  | AxFunction
  | {
  toFunction: () => 
     | AxFunction
    | AxFunction[];
})[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/functions.ts#L184

AxInternalChatRequest

type AxInternalChatRequest<TModel> = Omit<AxChatRequest, "model"> & Required<Pick<AxChatRequest<TModel>, "model">>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L229

Type Parameters

Type Parameter
TModel

AxInternalEmbedRequest

type AxInternalEmbedRequest<TEmbedModel> = Omit<AxEmbedRequest, "embedModel"> & Required<Pick<AxEmbedRequest<TEmbedModel>, "embedModel">>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L237

Type Parameters

Type Parameter
TEmbedModel

AxLoggerFunction

type AxLoggerFunction = (message: string, options?: object) => void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L282

Parameters

ParameterType
messagestring
options?{ tags?: AxLoggerTag[]; }
options.tags?AxLoggerTag[]

Returns

void

AxLoggerTag

type AxLoggerTag = 
  | "error"
  | "warning"
  | "success"
  | "functionName"
  | "functionArg"
  | "functionEnd"
  | "firstFunction"
  | "multipleFunctions"
  | "responseStart"
  | "responseContent"
  | "responseEnd"
  | "requestStart"
  | "requestContent"
  | "requestEnd"
  | "systemStart"
  | "systemContent"
  | "systemEnd"
  | "userStart"
  | "userContent"
  | "userEnd"
  | "assistantStart"
  | "assistantContent"
  | "assistantEnd"
  | "discovery"
  | "optimizer"
  | "start"
  | "config"
  | "phase"
  | "progress"
  | "result"
  | "complete"
  | "checkpoint";

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L248

AxMemoryData

type AxMemoryData = object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/mem/types.ts#L7

Type declaration

NameType
chatobject[]
roleAxChatRequest["chatPrompt"][number]["role"]
tags?string[]
updatable?boolean

AxMessage

type AxMessage<IN> = 
  | {
  role: "user";
  values: IN;
}
  | {
  role: "assistant";
  values: IN;
};

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/types.ts#L18

Type Parameters

Type Parameter
IN extends AxGenIn

AxMetricFn

type AxMetricFn = <T>(arg0: Readonly<{
  example: AxExample;
  prediction: T;
}>) => number | Promise<number>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L12

Type Parameters

Type ParameterDefault type
T extends AxGenOutAxGenOut

Parameters

ParameterType
arg0Readonly<{ example: AxExample; prediction: T; }>

Returns

number | Promise<number>

AxMetricFnArgs

AxMockAIServiceConfig

type AxMockAIServiceConfig = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L20

Properties

chatResponse?

optional chatResponse: 
  | AxChatResponse
  | ReadableStream<AxChatResponse>
  | () => Promise<
  | AxChatResponse
  | ReadableStream<AxChatResponse>>
  | (req: Readonly<AxChatRequest<unknown>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<unknown, unknown>>) => Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L28


embedModelInfo?

optional embedModelInfo: AxModelInfoWithProvider;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L24


embedResponse?

optional embedResponse: 
  | AxEmbedResponse
  | (req: Readonly<AxEmbedRequest>) => 
  | AxEmbedResponse
| Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L39


errorMessage?

optional errorMessage: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L45


features?

optional features: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L25

functions?

optional functions: boolean;

streaming?

optional streaming: boolean;

id?

optional id: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L22


latencyMs?

optional latencyMs: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L46


modelInfo?

optional modelInfo: Partial<AxModelInfoWithProvider>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L23


models?

optional models: AxAIModelList;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L26


name?

optional name: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L21


options?

optional options: AxAIServiceOptions;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L27


shouldError?

optional shouldError: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/mock/api.ts#L44

AxModelConfig

type AxModelConfig = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L40

Properties

endSequences?

optional endSequences: string[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L48


frequencyPenalty?

optional frequencyPenalty: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L46


maxTokens?

optional maxTokens: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L41


n?

optional n: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L50


presencePenalty?

optional presencePenalty: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L45


stopSequences?

optional stopSequences: string[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L47


stream?

optional stream: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L49


temperature?

optional temperature: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L42


topK?

optional topK: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L44


topP?

optional topP: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L43

AxModelInfo

type AxModelInfo = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L21

Properties

aliases?

optional aliases: string[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L27


characterIsToken?

optional characterIsToken: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L24


completionTokenCostPer1M?

optional completionTokenCostPer1M: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L26


currency?

optional currency: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L23


hasShowThoughts?

optional hasShowThoughts: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L29


hasThinkingBudget?

optional hasThinkingBudget: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L28


maxTokens?

optional maxTokens: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L30


name

name: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L22


promptTokenCostPer1M?

optional promptTokenCostPer1M: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L25

AxModelInfoWithProvider

type AxModelInfoWithProvider = AxModelInfo & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L136

Type declaration

NameType
providerstring

AxModelUsage

AxOptimizerArgs

type AxOptimizerArgs = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L98

Properties

checkpointInterval?

optional checkpointInterval: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L118


checkpointLoad?

optional checkpointLoad: AxCheckpointLoadFn;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L117


checkpointSave?

optional checkpointSave: AxCheckpointSaveFn;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L116


costTracker?

optional costTracker: AxCostTracker;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L113


examples

examples: readonly AxExample[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L101


logger?

optional logger: AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L122


minSuccessRate?

optional minSuccessRate: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L107


onEarlyStop()?

optional onEarlyStop: (reason: string, stats: Readonly<AxOptimizationStats>) => void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L112

Parameters

ParameterType
reasonstring
statsReadonly<AxOptimizationStats>

Returns

void


onProgress()?

optional onProgress: (progress: Readonly<AxOptimizationProgress>) => void;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L111

Parameters

ParameterType
progressReadonly<AxOptimizationProgress>

Returns

void


resumeFromCheckpoint?

optional resumeFromCheckpoint: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L119


seed?

optional seed: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L126


studentAI

studentAI: AxAIService;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L99


targetScore?

optional targetScore: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L108


teacherAI?

optional teacherAI: AxAIService;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L100


validationSet?

optional validationSet: readonly AxExample[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L104


verbose?

optional verbose: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L123

AxMultiMetricFn

type AxMultiMetricFn = <T>(arg0: Readonly<{
  example: AxExample;
  prediction: T;
}>) => Record<string, number>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/optimizer.ts#L19

Type Parameters

Type ParameterDefault type
T extends AxGenOutAxGenOut

Parameters

ParameterType
arg0Readonly<{ example: AxExample; prediction: T; }>

Returns

Record<string, number>

AxProgramDemos

AxProgramExamples

type AxProgramExamples<IN, OUT> = 
  | AxProgramDemos<IN, OUT>
  | AxProgramDemos<IN, OUT>["traces"];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L30

Type Parameters

Type Parameter
IN extends AxGenIn
OUT extends AxGenOut

AxProgramForwardOptions

type AxProgramForwardOptions = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L57

Properties

abortSignal?

optional abortSignal: AbortSignal;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L101


ai?

optional ai: AxAIService;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L64


asserts?

optional asserts: AxAssertion[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L108


debug?

optional debug: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L86


debugHideSystemPrompt?

optional debugHideSystemPrompt: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L87


description?

optional description: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L105


excludeContentFromTrace?

optional excludeContentFromTrace: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L110


fastFail?

optional fastFail: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L85


functionCall?

optional functionCall: AxChatRequest["functionCall"];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L81


functions?

optional functions: AxInputFunctionType;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L80


logger?

optional logger: AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L102


maxRetries?

optional maxRetries: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L59


maxSteps?

optional maxSteps: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L60


mem?

optional mem: AxAIMemory;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L61


model?

optional model: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L66


modelConfig?

optional modelConfig: AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L65


promptTemplate?

optional promptTemplate: typeof AxPromptTemplate;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L107


rateLimiter?

optional rateLimiter: AxRateLimiterFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L72


resultPicker?

optional resultPicker: AxResultPickerFunction<AxGenOut>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L77


sampleCount?

optional sampleCount: number;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L76


sessionId?

optional sessionId: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L69


showThoughts?

optional showThoughts: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L97


stopFunction?

optional stopFunction: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L82


stream?

optional stream: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L75


streamingAsserts?

optional streamingAsserts: AxStreamingAssertion[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L109


strictMode?

optional strictMode: boolean;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L113


thinkingTokenBudget?

optional thinkingTokenBudget: "minimal" | "low" | "medium" | "high" | "highest" | "none";

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L90


thoughtFieldName?

optional thoughtFieldName: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L106


traceId?

optional traceId: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L70


traceLabel?

optional traceLabel: string;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L100


tracer?

optional tracer: Tracer;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L71

AxProgramStreamingForwardOptions

type AxProgramStreamingForwardOptions = Omit<AxProgramForwardOptions, "stream">;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L116

AxProgramTrace

AxRateLimiterFunction

type AxRateLimiterFunction = <T>(reqFunc: () => Promise<T | ReadableStream<T>>, info: Readonly<{
  modelUsage?: AxModelUsage;
}>) => Promise<T | ReadableStream<T>>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/types.ts#L243

Type Parameters

Type ParameterDefault type
Tunknown

Parameters

ParameterType
reqFunc() => Promise<T | ReadableStream<T>>
infoReadonly<{ modelUsage?: AxModelUsage; }>

Returns

Promise<T | ReadableStream<T>>

AxProgramUsage

type AxProgramUsage = AxChatResponse["modelUsage"] & object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L168

Type declaration

NameType
aistring
modelstring

AxRerankerIn

AxRerankerOut

AxResultPickerFunction

type AxResultPickerFunction<OUT> = (data: 
  | AxResultPickerFunctionFieldResults<OUT>
| AxResultPickerFunctionFunctionResults) => number | Promise<number>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L51

Type Parameters

Type Parameter
OUT extends AxGenOut

Parameters

ParameterType
data| AxResultPickerFunctionFieldResults<OUT> | AxResultPickerFunctionFunctionResults

Returns

number | Promise<number>

AxResultPickerFunctionFieldResults

type AxResultPickerFunctionFieldResults<OUT> = object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L34

Type Parameters

Type Parameter
OUT extends AxGenOut

Properties

results

results: readonly object[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L36


type

type: "fields";

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/program.ts#L35

AxRewriteIn

AxResultPickerFunctionFunctionResults

AxSetExamplesOptions

AxRewriteOut

AxSignatureTemplateValue

type AxSignatureTemplateValue = 
  | string
  | AxFieldType
  | AxFieldDescriptor
  | AxSignature;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/template.ts#L10

AxStreamingFieldProcessorProcess

type AxStreamingFieldProcessorProcess = (value: string, context?: Readonly<{
  done?: boolean;
  sessionId?: string;
  values?: AxGenOut;
}>) => unknown | Promise<unknown>;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/fieldProcessor.ts#L16

Parameters

ParameterType
valuestring
context?Readonly<{ done?: boolean; sessionId?: string; values?: AxGenOut; }>

Returns

unknown | Promise<unknown>

AxEvalUtil

const AxEvalUtil: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/eval.ts#L143

Type declaration

NameType
emScore()(prediction: string, groundTruth: string) => number
f1Score()(prediction: string, groundTruth: string) => number
novelF1ScoreOptimized()(history: string, prediction: string, groundTruth: string, returnRecall: boolean) => number

AxTokenUsage

AxStringUtil

const AxStringUtil: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/strutil.ts#L66

Type declaration

NameType
batchArray()<T>(arr: readonly T[], size: number) => T[][]
dedup()(seq: readonly string[]) => string[]
extractIdAndText()(input: string) => object
extractIndexPrefixedText()(input: string) => string
splitIntoTwo()(str: string, separator: Readonly<string | RegExp>) => string[]
trimNonAlphaNum()(str: string) => string

axAIAzureOpenAIBestConfig

const axAIAzureOpenAIBestConfig: () => AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel> = axAIOpenAIBestConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/azure-openai/api.ts#L24

Returns

AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>

axAIAzureOpenAICreativeConfig

const axAIAzureOpenAICreativeConfig: () => AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel> = axAIOpenAICreativeConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/azure-openai/api.ts#L20

Returns

AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>

axAIAzureOpenAIDefaultConfig

const axAIAzureOpenAIDefaultConfig: () => AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel> = axAIOpenAIDefaultConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/azure-openai/api.ts#L18

Returns

AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>

axAIAzureOpenAIFastConfig

const axAIAzureOpenAIFastConfig: () => AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel> = axAIOpenAIFastConfig;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/azure-openai/api.ts#L22

Returns

AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>

axDefaultOptimizerLogger

const axDefaultOptimizerLogger: AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/loggers.ts#L226

Default optimizer logger instance

axGlobals

const axGlobals: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/globals.ts#L1

Type declaration

NameTypeDefault value
signatureStrictbooleantrue

axModelInfoAnthropic

axModelInfoCohere

axModelInfoGoogleGemini

const axModelInfoGoogleGemini: AxModelInfo[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/google-gemini/info.ts#L8

AxAIGoogleGemini: Model information

axModelInfoDeepSeek

axModelInfoGrok

axModelInfoGroq

const axModelInfoGroq: AxModelInfo[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/groq/info.ts#L8

AxAIGroq: Model information

axModelInfoHuggingFace

const axModelInfoHuggingFace: AxModelInfo[] = [];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/huggingface/info.ts#L6

HuggingFace: Model information

axModelInfoMistral

axModelInfoOpenAI

const axModelInfoOpenAI: AxModelInfo[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/openai/info.ts#L9

OpenAI: Model information

axModelInfoReka

const axModelInfoReka: AxModelInfo[];

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/ai/reka/info.ts#L7

OpenAI: Model information

axModelInfoTogether

axSpanAttributes

const axSpanAttributes: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/trace/trace.ts#L1

Type declaration

NameTypeDefault value
DB_IDstring'db.id'
DB_NAMESPACEstring'db.namespace'
DB_OPERATION_NAMEstring'db.operation.name'
DB_QUERY_EMBEDDINGSstring'db.query.embeddings'
DB_QUERY_EMBEDDINGS_VECTORstring'db.query.embeddings.vector'
DB_QUERY_RESULTstring'db.query.result'
DB_QUERY_RESULT_DISTANCEstring'db.query.result.distance'
DB_QUERY_RESULT_DOCUMENTstring'db.query.result.document'
DB_QUERY_RESULT_IDstring'db.query.result.id'
DB_QUERY_RESULT_METADATAstring'db.query.result.metadata'
DB_QUERY_RESULT_SCOREstring'db.query.result.score'
DB_QUERY_RESULT_VECTORstring'db.query.result.vector'
DB_QUERY_TEXTstring'db.query.text'
DB_SYSTEMstring'db.system'
DB_TABLEstring'db.table'
DB_VECTORstring'db.vector'
DB_VECTOR_QUERY_TOP_Kstring'db.vector.query.top_k'
LLM_OPERATION_NAMEstring'gen_ai.operation.name'
LLM_REQUEST_FREQUENCY_PENALTYstring'gen_ai.request.frequency_penalty'
LLM_REQUEST_LLM_IS_STREAMINGstring'gen_ai.request.llm_is_streaming'
LLM_REQUEST_MAX_TOKENSstring'gen_ai.request.max_tokens'
LLM_REQUEST_MODELstring'gen_ai.request.model'
LLM_REQUEST_PRESENCE_PENALTYstring'gen_ai.request.presence_penalty'
LLM_REQUEST_STOP_SEQUENCESstring'gen_ai.request.stop_sequences'
LLM_REQUEST_TEMPERATUREstring'gen_ai.request.temperature'
LLM_REQUEST_TOP_Kstring'gen_ai.request.top_k'
LLM_REQUEST_TOP_Pstring'gen_ai.request.top_p'
LLM_SYSTEMstring'gen_ai.system'
LLM_USAGE_INPUT_TOKENSstring'gen_ai.usage.input_tokens'
LLM_USAGE_OUTPUT_TOKENSstring'gen_ai.usage.output_tokens'
LLM_USAGE_THOUGHTS_TOKENSstring'gen_ai.usage.thoughts_tokens'
LLM_USAGE_TOTAL_TOKENSstring'gen_ai.usage.total_tokens'

axSpanEvents

const axSpanEvents: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/trace/trace.ts#L45

Type declaration

NameTypeDefault value
GEN_AI_ASSISTANT_MESSAGEstring'gen_ai.assistant.message'
GEN_AI_CHOICEstring'gen_ai.choice'
GEN_AI_SYSTEM_MESSAGEstring'gen_ai.system.message'
GEN_AI_TOOL_MESSAGEstring'gen_ai.tool.message'
GEN_AI_USAGEstring'gen_ai.usage'
GEN_AI_USER_MESSAGEstring'gen_ai.user.message'

f

const f: object;

Defined in: https://github.com/ax-llm/ax/blob/106cb89c8759fca348b2bebaf677ebb35ee6daf1/src/ax/dsp/template.ts#L246

Type declaration

NameType
array()<T>(baseType: T) => T & object
audio()(desc?: string) => AxFieldType
boolean()(desc?: string) => AxFieldType
class()(options: readonly string[], desc?: string) => AxFieldType
code()(language: string, desc?: string) => AxFieldType
date()(desc?: string) => AxFieldType
datetime()(desc?: string) => AxFieldType
image()(desc?: string) => AxFieldType
internal()<T>(baseType: T) => T & object
json()(desc?: string) => AxFieldType
number()(desc?: string) => AxFieldType
optional()<T>(baseType: T) => T & object
string()(desc?: string) => AxFieldType