AxJudgeOptions Generated TypeScript API reference. typescript api api/reference build/apidocs/Interface.AxJudgeOptions.md interface AxJudgeOptions

AxJudgeOptions

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/judgeTypes.ts#L9

Extends

Properties

PropertyTypeDescriptionOverridesInherited from
abortSignal?AbortSignalAbortSignal for cancelling in-flight requests.-AxJudgeForwardOptions.abortSignal
aiAxAIService-AxJudgeForwardOptions.ai-
asserts?AxAssertion<any>[]--AxJudgeForwardOptions.asserts
beta?booleanProvider-specific hint to opt in to beta API paths when available. Currently used by Google Gemini on Vertex AI to route requests through v1beta1 instead of the default stable v1 endpoint.-AxJudgeForwardOptions.beta
cachingFunction?(key: string, value?: AxGenOut) => | undefined | AxGenOut | Promise<undefined | AxGenOut>--AxJudgeForwardOptions.cachingFunction
contextCache?AxContextCacheOptionsContext caching options for large prompt prefixes. When enabled, large prompt prefixes can be cached for cost savings and lower latency on subsequent requests. Currently supported by: Google Gemini/Vertex AI-AxJudgeForwardOptions.contextCache
corsProxy?stringCORS proxy URL for browser environments. When running in a browser, API calls may be blocked by CORS. Specify a proxy URL to route requests through. Example 'https://cors-anywhere.herokuapp.com/'-AxJudgeForwardOptions.corsProxy
criteria?string---
customLabels?Record<string, string>Custom labels for OpenTelemetry metrics. These labels are merged with axGlobals.customLabels (service-level options override global settings). Example { environment: 'production', feature: 'search' }-AxJudgeForwardOptions.customLabels
customTemplate?string--AxJudgeForwardOptions.customTemplate
debug?booleanEnable debug logging for troubleshooting. When true, logs detailed information about prompts, responses, and the generation pipeline. Useful for understanding AI behavior.-AxJudgeForwardOptions.debug
debugHideSystemPrompt?booleanHide system prompt in debug output (for cleaner logs).-AxJudgeForwardOptions.debugHideSystemPrompt
description?string---
disableMemoryCleanup?boolean--AxJudgeForwardOptions.disableMemoryCleanup
excludeContentFromTrace?booleanExclude message content from OpenTelemetry traces (for privacy).-AxJudgeForwardOptions.excludeContentFromTrace
fastFail?boolean--AxJudgeForwardOptions.fastFail
fetch?{ (input: URL | RequestInfo, init?: RequestInit): Promise<Response>; (input: string | URL | Request, init?: RequestInit): Promise<Response>; }Custom fetch implementation (useful for proxies or custom HTTP handling).-AxJudgeForwardOptions.fetch
functionCall?| "auto" | "none" | "required" | { function: { name: string; }; type: "function"; }--AxJudgeForwardOptions.functionCall
functionCallMode?"prompt" | "auto" | "native"How to handle function/tool calling. - 'auto' - Let the provider decide the best approach (default) - 'native' - Use the provider’s native function calling API. Fails if the model doesn’t support it. - 'prompt' - Simulate function calling via prompt engineering. Works with any model but may be less reliable. Default 'auto'-AxJudgeForwardOptions.functionCallMode
functionResultFormatter?(result: unknown) => string--AxJudgeForwardOptions.functionResultFormatter
includeOptionalInputFieldsInSystemPrompt?boolean--AxJudgeForwardOptions.includeOptionalInputFieldsInSystemPrompt
includeRequestBodyInErrors?booleanWhether to include the request body in AxAIServiceError messages. When false, the request body is omitted from thrown errors. Useful when requests may contain sensitive data (API keys, PII) or large base64-encoded content that would bloat error logs. Default true-AxJudgeForwardOptions.includeRequestBodyInErrors
logger?AxLoggerFunctionCustom logger function for debug output.-AxJudgeForwardOptions.logger
maxRetries?number--AxJudgeForwardOptions.maxRetries
maxSteps?number--AxJudgeForwardOptions.maxSteps
mem?AxAIMemory--AxJudgeForwardOptions.mem
meter?MeterOpenTelemetry meter for metrics collection.-AxJudgeForwardOptions.meter
model?string--AxJudgeForwardOptions.model
modelConfig?AxModelConfig--AxJudgeForwardOptions.modelConfig
onFunctionCall?(call: Readonly<AxFunctionCallTrace>) => void | Promise<void>--AxJudgeForwardOptions.onFunctionCall
promptTemplate?typeof AxPromptTemplate--AxJudgeForwardOptions.promptTemplate
randomizeOrder?boolean---
rateLimiter?AxRateLimiterFunctionCustom rate limiter function to control request throughput.-AxJudgeForwardOptions.rateLimiter
resultPicker?AxResultPickerFunction<AxGenOut>--AxJudgeForwardOptions.resultPicker
retry?Partial<RetryConfig>Retry configuration for failed requests. Controls automatic retry behavior for transient errors (rate limits, timeouts, server errors).-AxJudgeForwardOptions.retry
sampleCount?number--AxJudgeForwardOptions.sampleCount
selfTuning?boolean | AxSelfTuningConfig--AxJudgeForwardOptions.selfTuning
sessionId?stringSession identifier for conversation tracking and memory isolation.-AxJudgeForwardOptions.sessionId
showThoughts?booleanInclude the model’s thinking/reasoning in the output. When true and thinkingTokenBudget is set, the model’s internal reasoning is included in the response. Useful for debugging and understanding AI behavior. Default false-AxJudgeForwardOptions.showThoughts
speech?AxSpeechConfig--AxJudgeForwardOptions.speech
stepHooks?AxStepHooks--AxJudgeForwardOptions.stepHooks
stepIndex?numberInternal: Current step index for multi-step operations.-AxJudgeForwardOptions.stepIndex
stopFunction?string | string[]--AxJudgeForwardOptions.stopFunction
stream?booleanEnable streaming responses. When true, the AI returns responses as a stream of chunks, enabling real-time display of generated text.-AxJudgeForwardOptions.stream
streamingAsserts?AxStreamingAssertion[]--AxJudgeForwardOptions.streamingAsserts
strictMode?boolean--AxJudgeForwardOptions.strictMode
structuredOutputMode?"function" | "auto" | "native"--AxJudgeForwardOptions.structuredOutputMode
thinkingTokenBudget?"high" | "low" | "minimal" | "medium" | "highest" | "none"Token budget for extended thinking (chain-of-thought reasoning). Extended thinking allows models to “think through” complex problems before responding. Higher budgets allow deeper reasoning but cost more. Approximate token allocations: - 'none' - Disabled (default) - 'minimal' - ~1,000 tokens (~750 words of thinking) - 'low' - ~4,000 tokens - 'medium' - ~10,000 tokens - 'high' - ~20,000 tokens - 'highest' - ~32,000+ tokens (provider maximum) Provider support: - Anthropic Claude: Full support with claude-sonnet-4 and above - OpenAI: Supported with o1/o3 models (uses reasoning_effort) - Google: Supported with Gemini 2.0 Flash Thinking - DeepSeek: Supported with DeepSeek V4 models Example // Enable medium thinking for complex reasoning await gen.forward(ai, values, { thinkingTokenBudget: 'medium' });-AxJudgeForwardOptions.thinkingTokenBudget
thoughtFieldName?string--AxJudgeForwardOptions.thoughtFieldName
timeout?numberRequest timeout in milliseconds. Default 300000 (5 minutes)-AxJudgeForwardOptions.timeout
traceContext?ContextOpenTelemetry trace context for distributed tracing.-AxJudgeForwardOptions.traceContext
traceLabel?string--AxJudgeForwardOptions.traceLabel
tracer?TracerOpenTelemetry tracer for distributed tracing.-AxJudgeForwardOptions.tracer
useExpensiveModel?"yes"Hint to use a more capable (and expensive) model for complex tasks. Some providers offer tiered models. Setting this to ‘yes’ requests the higher-capability tier when available.-AxJudgeForwardOptions.useExpensiveModel
verbose?booleanEnable low-level HTTP request/response logging. More verbose than debug. Shows raw HTTP traffic including headers. Useful for debugging API issues.-AxJudgeForwardOptions.verbose
webSocket?anyCustom WebSocket constructor for providers that use realtime WebSocket transports.-AxJudgeForwardOptions.webSocket
Docs