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

AxAIWebLLMChatRequest

type AxAIWebLLMChatRequest = object;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/webllm/types.ts#L47

WebLLM: Chat request structure Based on OpenAI-compatible API from WebLLM

Properties

frequency_penalty?

optional frequency_penalty: number;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/webllm/types.ts#L64


logit_bias?

optional logit_bias: Record<number, number>;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/webllm/types.ts#L65


logprobs?

optional logprobs: boolean;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/webllm/types.ts#L66


max_tokens?

optional max_tokens: number;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/webllm/types.ts#L60


messages

messages: object[];

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/webllm/types.ts#L49

content?

optional content: string;

function_call?

{
  arguments: string;
  name: string;
}

name?

optional name: string;

role

role: "system" | "user" | "assistant" | "function";

model

model: AxAIWebLLMModel;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/webllm/types.ts#L48


n?

optional n: number;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/webllm/types.ts#L68


presence_penalty?

optional presence_penalty: number;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/webllm/types.ts#L63


stop?

optional stop: string | string[];

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/webllm/types.ts#L62


stream?

optional stream: boolean;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/webllm/types.ts#L61


temperature?

optional temperature: number;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/webllm/types.ts#L58


tool_choice?

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

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/webllm/types.ts#L77


tools?

optional tools: object[];

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/webllm/types.ts#L69

function

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

type

type: "function";

top_logprobs?

optional top_logprobs: number;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/webllm/types.ts#L67


top_p?

optional top_p: number;

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/webllm/types.ts#L59