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

AxAIOpenAIResponses

Defined in: https://github.com/ax-llm/ax/blob/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/openai/responses_api_base.ts#L255

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

Extends

Type Parameters

Type ParameterDefault type
TModelKeystring

Constructors

Constructor

new AxAIOpenAIResponses<TModelKey>(__namedParameters: Readonly<Omit<AxAIOpenAIResponsesArgs<"openai-responses", AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel, TModelKey>, "name">>): AxAIOpenAIResponses<TModelKey>;

Defined in: https://github.com/ax-llm/ax/blob/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/openai/responses_api_base.ts#L263

Parameters

ParameterType
__namedParametersReadonly<Omit<AxAIOpenAIResponsesArgs<"openai-responses", AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel, TModelKey>, "name">>

Returns

AxAIOpenAIResponses<TModelKey>

Overrides

AxAIOpenAIResponsesBase.constructor

Accessors

debug

Get Signature

get debug(): boolean;

Defined in: https://github.com/ax-llm/ax/blob/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/base.ts#L281

Returns

boolean

Inherited from

AxAIOpenAIResponsesBase.debug

Methods

chat()

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

Defined in: https://github.com/ax-llm/ax/blob/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/base.ts#L873

Parameters

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

Returns

Promise< | AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxAIOpenAIResponsesBase.chat


embed()

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

Defined in: https://github.com/ax-llm/ax/blob/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/base.ts#L1379

Parameters

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

Returns

Promise<AxEmbedResponse>

Inherited from

AxAIOpenAIResponsesBase.embed


getFeatures()

getFeatures(model?: AxAIOpenAIResponsesModel): AxAIFeatures;

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

Parameters

ParameterType
model?AxAIOpenAIResponsesModel

Returns

AxAIFeatures

Inherited from

AxAIOpenAIResponsesBase.getFeatures


getId()

getId(): string;

Defined in: https://github.com/ax-llm/ax/blob/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/base.ts#L269

Returns

string

Inherited from

AxAIOpenAIResponsesBase.getId


getLastUsedChatModel()

getLastUsedChatModel(): 
  | undefined
  | AxAIOpenAIResponsesModel;

Defined in: https://github.com/ax-llm/ax/blob/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/base.ts#L354

Returns

| undefined | AxAIOpenAIResponsesModel

Inherited from

AxAIOpenAIResponsesBase.getLastUsedChatModel


getLastUsedEmbedModel()

getLastUsedEmbedModel(): 
  | undefined
  | AxAIOpenAIEmbedModel;

Defined in: https://github.com/ax-llm/ax/blob/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/base.ts#L358

Returns

| undefined | AxAIOpenAIEmbedModel

Inherited from

AxAIOpenAIResponsesBase.getLastUsedEmbedModel


getLastUsedModelConfig()

getLastUsedModelConfig(): undefined | AxModelConfig;

Defined in: https://github.com/ax-llm/ax/blob/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/base.ts#L362

Returns

undefined | AxModelConfig

Inherited from

AxAIOpenAIResponsesBase.getLastUsedModelConfig


getLogger()

getLogger(): AxLoggerFunction;

Defined in: https://github.com/ax-llm/ax/blob/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/base.ts#L313

Returns

AxLoggerFunction

Inherited from

AxAIOpenAIResponsesBase.getLogger


getMetrics()

getMetrics(): AxAIServiceMetrics;

Defined in: https://github.com/ax-llm/ax/blob/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/base.ts#L869

Returns

AxAIServiceMetrics

Inherited from

AxAIOpenAIResponsesBase.getMetrics


getModelList()

getModelList(): (
  | {
  description: string;
  embedModel?: undefined;
  key: TModelKey;
  model: string;
}
  | {
  description: string;
  embedModel: string;
  key: TModelKey;
  model?: undefined;
})[];

Defined in: https://github.com/ax-llm/ax/blob/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/base.ts#L317

Returns

( | { description: string; embedModel?: undefined; key: TModelKey; model: string; } | { description: string; embedModel: string; key: TModelKey; model?: undefined; })[]

Inherited from

AxAIOpenAIResponsesBase.getModelList


getName()

getName(): string;

Defined in: https://github.com/ax-llm/ax/blob/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/base.ts#L344

Returns

string

Inherited from

AxAIOpenAIResponsesBase.getName


getOptions()

getOptions(): Readonly<AxAIServiceOptions>;

Defined in: https://github.com/ax-llm/ax/blob/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/base.ts#L298

Returns

Readonly<AxAIServiceOptions>

Inherited from

AxAIOpenAIResponsesBase.getOptions


setAPIURL()

setAPIURL(apiURL: string): void;

Defined in: https://github.com/ax-llm/ax/blob/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/base.ts#L273

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/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/base.ts#L277

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/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/base.ts#L265

Parameters

ParameterType
namestring

Returns

void

Inherited from

AxAIOpenAIResponsesBase.setName


setOptions()

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

Defined in: https://github.com/ax-llm/ax/blob/b50783a160295ce34ac10dcaf3bd8fff4a01d535/src/ax/ai/base.ts#L285

Parameters

ParameterType
optionsReadonly<AxAIServiceOptions>

Returns

void

Inherited from

AxAIOpenAIResponsesBase.setOptions