AxAIService Generated TypeScript API reference. typescript api api/reference build/apidocs/Interface.AxAIService.md interface AxAIService

AxAIService

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/types.ts#L1021

Type Parameters

Type ParameterDefault type
TModelunknown
TEmbedModelunknown
TModelKeystring

Methods

chat()

TypeScript
chat(req: Readonly<AxChatRequest<TModel | TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/types.ts#L1037

Parameters

ParameterType
reqReadonly<AxChatRequest<TModel | TModelKey>>
options?Readonly<AxAIServiceOptions>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>


embed()

TypeScript
embed(req: Readonly<AxEmbedRequest<TEmbedModel | TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/types.ts#L1041

Parameters

ParameterType
reqReadonly<AxEmbedRequest<TEmbedModel | TModelKey>>
options?Readonly<AxAIServiceOptions>

Returns

Promise<AxEmbedResponse>


getEstimatedCost()

TypeScript
getEstimatedCost(modelUsage?: AxModelUsage): number;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/types.ts#L1054

Parameters

ParameterType
modelUsage?AxModelUsage

Returns

number


getFeatures()

TypeScript
getFeatures(model?: TModel): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/types.ts#L1028

Parameters

ParameterType
model?TModel

Returns

AxAIFeatures


getId()

TypeScript
getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/types.ts#L1026

Returns

string


getLastUsedChatModel()

TypeScript
getLastUsedChatModel(): undefined | TModel;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/types.ts#L1033

Returns

undefined | TModel


getLastUsedEmbedModel()

TypeScript
getLastUsedEmbedModel(): undefined | TEmbedModel;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/types.ts#L1034

Returns

undefined | TEmbedModel


getLastUsedModelConfig()

TypeScript
getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/types.ts#L1035

Returns

undefined | AxModelConfig


getLogger()

TypeScript
getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/types.ts#L1031

Returns

AxLoggerFunction


getMetrics()

TypeScript
getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/types.ts#L1030

Returns

AxAIServiceMetrics


getModelList()

TypeScript
getModelList(): 
  | undefined
| AxAIModelList<TModelKey>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/types.ts#L1029

Returns

| undefined | AxAIModelList<TModelKey>


getName()

TypeScript
getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/types.ts#L1027

Returns

string


getOptions()

TypeScript
getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/types.ts#L1057

Returns

Readonly<AxAIServiceOptions>


setOptions()

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

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/types.ts#L1056

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void


speak()

TypeScript
speak(req: Readonly<AxSpeechRequest<TModel | TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxChatAudioOutput>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/types.ts#L1049

Parameters

ParameterType
reqReadonly<AxSpeechRequest<TModel | TModelKey>>
options?Readonly<AxAIServiceOptions>

Returns

Promise<AxChatAudioOutput>


transcribe()

TypeScript
transcribe(req: Readonly<AxTranscriptionRequest<TModel | TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxTranscriptionResponse>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/types.ts#L1045

Parameters

ParameterType
reqReadonly<AxTranscriptionRequest<TModel | TModelKey>>
options?Readonly<AxAIServiceOptions>

Returns

Promise<AxTranscriptionResponse>

Docs