Documentation

Build LLM-powered agents
with production-ready TypeScript

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

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

AxMockAIService

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/mock/api.ts#L51

Type Parameters

Type Parameter
TModelKey

Implements

Constructors

Constructor

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

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

Parameters

ParameterType
configAxMockAIServiceConfig<TModelKey>

Returns

AxMockAIService<TModelKey>

Methods

chat()

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

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/mock/api.ts#L136

Parameters

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

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Implementation of

AxAIService.chat


embed()

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

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/mock/api.ts#L179

Parameters

ParameterType
reqReadonly<AxEmbedRequest>
_options?Readonly<AxAIServiceOptions>

Returns

Promise<AxEmbedResponse>

Implementation of

AxAIService.embed


getFeatures()

getFeatures(_model?: string): AxAIFeatures;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/mock/api.ts#L93

Parameters

ParameterType
_model?string

Returns

AxAIFeatures

Implementation of

AxAIService.getFeatures


getId()

getId(): string;

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

Returns

string

Implementation of

AxAIService.getId


getLastUsedChatModel()

getLastUsedChatModel(): unknown;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/mock/api.ts#L68

Returns

unknown

Implementation of

AxAIService.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): unknown;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/mock/api.ts#L71

Returns

unknown

Implementation of

AxAIService.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/mock/api.ts#L74

Returns

undefined | AxModelConfig

Implementation of

AxAIService.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/mock/api.ts#L224

Returns

AxLoggerFunction

Implementation of

AxAIService.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/mock/api.ts#L132

Returns

AxAIServiceMetrics

Implementation of

AxAIService.getMetrics


getModelList()

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

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/mock/api.ts#L128

Returns

| undefined | AxAIModelList<TModelKey>

Implementation of

AxAIService.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/mock/api.ts#L84

Returns

string

Implementation of

AxAIService.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/mock/api.ts#L220

Returns

Readonly<AxAIServiceOptions>

Implementation of

AxAIService.getOptions


setOptions()

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

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/mock/api.ts#L216

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Implementation of

AxAIService.setOptions