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

AxAgentOptions

type AxAgentOptions = Omit<AxProgramForwardOptions<string>, "functions" | "description"> & object;

Defined in: https://github.com/ax-llm/ax/blob/71ea5064d766efdc031d375243a8e525911833e7/src/ax/prompts/agent.ts#L66

Type declaration

NameTypeDescription
actorCallback()?(result: Record<string, unknown>) => void | Promise<void>Called after each Actor turn with the full actor result.
actorFields?string[]Output field names the Actor should produce (in addition to javascriptCode).
actorOptions?Partial<Omit<AxProgramForwardOptions<string>, "functions"> & object>Default forward options for the Actor sub-program.
compressLog?booleanIf true, the Actor must return actionDescription and action logs will store short descriptions.
contextFieldsstring[]Input fields holding long context (will be removed from the LLM prompt).
debug?boolean-
maxBatchedLlmQueryConcurrency?numberMaximum parallel llmQuery calls in batched mode (default: 8).
maxLlmCalls?numberCap on recursive sub-LM calls (default: 50).
maxRuntimeChars?numberMaximum characters for RLM runtime payloads (default: 5000).
maxTurns?numberMaximum Actor turns before forcing Responder (default: 10).
mode?"simple" | "advanced"Sub-query execution mode (default: ‘simple’).
recursionOptions?AxAgentRecursionOptionsDefault forward options for recursive llmQuery sub-agent calls.
responderOptions?Partial<Omit<AxProgramForwardOptions<string>, "functions"> & object>Default forward options for the Responder sub-program.
runtime?AxCodeRuntimeCode runtime for the REPL loop (default: AxJSRuntime).