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

AxMockAIService

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L65

Type Parameters

Type Parameter
TModelKey

Implements

Constructors

Constructor

TypeScript
new AxMockAIService<TModelKey>(config: AxMockAIServiceConfig<TModelKey>): AxMockAIService<TModelKey>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L79

Parameters

ParameterType
configAxMockAIServiceConfig<TModelKey>

Returns

AxMockAIService<TModelKey>

Methods

chat()

TypeScript
chat(req: Readonly<AxChatRequest<unknown>>, _options?: Readonly<AxAIServiceOptions>): Promise<
  | AxChatResponse
| ReadableStream<AxChatResponse>>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L154

Parameters

ParameterType
reqReadonly<AxChatRequest<unknown>>
_options?Readonly<AxAIServiceOptions>

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Implementation of

AxAIService.chat


embed()

TypeScript
embed(req: Readonly<AxEmbedRequest>, _options?: Readonly<AxAIServiceOptions>): Promise<AxEmbedResponse>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L197

Parameters

ParameterType
reqReadonly<AxEmbedRequest>
_options?Readonly<AxAIServiceOptions>

Returns

Promise<AxEmbedResponse>

Implementation of

AxAIService.embed


getEstimatedCost()

TypeScript
getEstimatedCost(): number;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L150

Returns

number

Implementation of

AxAIService.getEstimatedCost


getFeatures()

TypeScript
getFeatures(_model?: string): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L107

Parameters

ParameterType
_model?string

Returns

AxAIFeatures

Implementation of

AxAIService.getFeatures


getId()

TypeScript
getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L102

Returns

string

Implementation of

AxAIService.getId


getLastUsedChatModel()

TypeScript
getLastUsedChatModel(): unknown;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L82

Returns

unknown

Implementation of

AxAIService.getLastUsedChatModel


getLastUsedEmbedModel()

TypeScript
getLastUsedEmbedModel(): unknown;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L85

Returns

unknown

Implementation of

AxAIService.getLastUsedEmbedModel


getLastUsedModelConfig()

TypeScript
getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L88

Returns

undefined | AxModelConfig

Implementation of

AxAIService.getLastUsedModelConfig


getLogger()

TypeScript
getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L281

Returns

AxLoggerFunction

Implementation of

AxAIService.getLogger


getMetrics()

TypeScript
getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L146

Returns

AxAIServiceMetrics

Implementation of

AxAIService.getMetrics


getModelList()

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

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L142

Returns

| undefined | AxAIModelList<TModelKey>

Implementation of

AxAIService.getModelList


getName()

TypeScript
getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L98

Returns

string

Implementation of

AxAIService.getName


getOptions()

TypeScript
getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L277

Returns

Readonly<AxAIServiceOptions>

Implementation of

AxAIService.getOptions


setOptions()

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

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L273

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Implementation of

AxAIService.setOptions


speak()

TypeScript
speak(req: Readonly<AxSpeechRequest<unknown>>, _options?: Readonly<AxAIServiceOptions>): Promise<AxChatAudioOutput>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L250

Parameters

ParameterType
reqReadonly<AxSpeechRequest<unknown>>
_options?Readonly<AxAIServiceOptions>

Returns

Promise<AxChatAudioOutput>

Implementation of

AxAIService.speak


transcribe()

TypeScript
transcribe(req: Readonly<AxTranscriptionRequest<unknown>>, _options?: Readonly<AxAIServiceOptions>): Promise<AxTranscriptionResponse>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/mock/api.ts#L234

Parameters

ParameterType
reqReadonly<AxTranscriptionRequest<unknown>>
_options?Readonly<AxAIServiceOptions>

Returns

Promise<AxTranscriptionResponse>

Implementation of

AxAIService.transcribe

Docs