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

AxAIAnthropicChatRequest

type AxAIAnthropicChatRequest = object;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/ai/anthropic/types.ts#L117

Properties

anthropic_version?

optional anthropic_version: string;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/ai/anthropic/types.ts#L119


max_tokens?

optional max_tokens: number;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/ai/anthropic/types.ts#L184


messages

messages: (
  | {
  content:   | string
     | (
     | ... & ...
     | ... & ...
     | {
     content: ... | ...;
     is_error?: boolean;
     tool_use_id: string;
     type: "tool_result";
   })[];
  role: "user";
}
  | {
  content:   | string
     | (
     | ... & ...
     | {
     signature?: string;
     thinking: string;
     type: "thinking";
   }
     | {
     data: string;
     signature?: string;
     type: "redacted_thinking";
   }
     | ... & ...)[];
  role: "assistant";
})[];

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/ai/anthropic/types.ts#L120


metadata?

optional metadata: object;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/ai/anthropic/types.ts#L203

user_id

user_id: string;

model?

optional model: string;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/ai/anthropic/types.ts#L118


output_config?

optional output_config: AxAIAnthropicOutputConfig;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/ai/anthropic/types.ts#L198


output_format?

optional output_format: object;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/ai/anthropic/types.ts#L199

schema

schema: object;

type

type: "json_schema";

stop_sequences?

optional stop_sequences: string[];

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/ai/anthropic/types.ts#L186


stream?

optional stream: boolean;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/ai/anthropic/types.ts#L187


system?

optional system: 
  | string
  | object & AxAIAnthropicChatRequestCacheParam[];

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/ai/anthropic/types.ts#L188


temperature?

optional temperature: number;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/ai/anthropic/types.ts#L194


thinking?

optional thinking: AxAIAnthropicThinkingWire;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/ai/anthropic/types.ts#L197


tool_choice?

optional tool_choice: 
  | {
  type: "auto" | "any";
}
  | {
  name?: string;
  type: "tool";
};

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/ai/anthropic/types.ts#L183


tools?

optional tools: AxAIAnthropicRequestTool[];

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/ai/anthropic/types.ts#L182


top_k?

optional top_k: number;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/ai/anthropic/types.ts#L196


top_p?

optional top_p: number;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/ai/anthropic/types.ts#L195