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

AxAIOpenAIChatResponse

type AxAIOpenAIChatResponse = object;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/openai/chat_types.ts#L204

Properties

choices

choices: object[];

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/openai/chat_types.ts#L209

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/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/openai/chat_types.ts#L207


error?

optional error: object;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/openai/chat_types.ts#L227

code

code: number;

message

message: string;

param

param: string;

type

type: string;

id

id: string;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/openai/chat_types.ts#L205


model

model: string;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/openai/chat_types.ts#L208


object

object: "chat.completion";

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/openai/chat_types.ts#L206


system_fingerprint

system_fingerprint: string;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/openai/chat_types.ts#L233


usage?

optional usage: AxAIOpenAIUsage;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/openai/chat_types.ts#L226