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

AxAIOpenAIChatRequest

type AxAIOpenAIChatRequest<TModel> = object;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L114

Type Parameters

Type Parameter
TModel

Properties

frequency_penalty?

optional frequency_penalty: number;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L200


logit_bias?

optional logit_bias: Map<string, number>;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L201


max_completion_tokens?

optional max_completion_tokens: number;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L193


messages

messages: (
  | {
  content: string;
  role: "system";
}
  | {
  content:   | string
     | (
     | {
     text: string;
     type: string;
   }
     | {
     image_url: {
        details?: ...;
        url: ...;
     };
     type: "image_url";
   }
     | {
     input_audio: {
        data: ...;
        format?: ...;
     };
     type: "input_audio";
   }
     | {
     file: {
        file_data: ...;
        filename: ...;
     };
     type: "file";
   })[];
  name?: string;
  role: "user";
}
  | {
  content:   | string
     | {
     text: string;
     type: string;
   };
  name?: string;
  role: "assistant";
}
  | {
  content?:   | string
     | {
     text: string;
     type: string;
   };
  name?: string;
  role: "assistant";
  tool_calls: object[];
}
  | {
  content: string;
  role: "tool";
  tool_call_id: string;
})[];

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L118


model

model: TModel;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L115


n?

optional n: number;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L196


organization?

optional organization: string;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L203


presence_penalty?

optional presence_penalty: number;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L199


reasoning_effort?

optional reasoning_effort: "minimal" | "low" | "medium" | "high";

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L116


response_format?

optional response_format: 
  | {
  type: string;
}
  | {
  json_schema: any;
  type: "json_schema";
};

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L190


stop?

optional stop: readonly string[];

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L198


store?

optional store: boolean;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L117


stream?

optional stream: boolean;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L197


temperature?

optional temperature: number;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L194


tool_choice?

optional tool_choice: 
  | "none"
  | "auto"
  | "required"
  | {
  function: {
     name: string;
  };
  type: "function";
};

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L185


tools?

optional tools: object[];

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L177

function

{
  description: string;
  name: string;
  parameters?: object;
}

type

type: "function";

top_p?

optional top_p: number;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L195


user?

optional user: string;

Defined in: https://github.com/ax-llm/ax/blob/a8847bd2906efff202fde10d776fddd20fd2ff57/src/ax/ai/openai/chat_types.ts#L202


web_search_options?

optional web_search_options: object;

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

search_context_size?

optional search_context_size: "low" | "medium" | "high";

user_location?

optional user_location: 
  | {
  approximate: {
     city?: string;
     country?: string;
     region?: string;
     timezone?: string;
     type: "approximate";
  };
}
  | null;