AxJudgeOptions
Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/dsp/judgeTypes.ts#L9
Extends
Properties
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
abortSignal? | AbortSignal | AbortSignal for cancelling in-flight requests. | - | AxJudgeForwardOptions.abortSignal |
ai | AxAIService | - | AxJudgeForwardOptions.ai | - |
asserts? | AxAssertion<any>[] | - | - | AxJudgeForwardOptions.asserts |
beta? | boolean | Provider-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? | AxContextCacheOptions | Context 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? | string | CORS 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? | boolean | Enable debug logging for troubleshooting. When true, logs detailed information about prompts, responses, and the generation pipeline. Useful for understanding AI behavior. | - | AxJudgeForwardOptions.debug |
debugHideSystemPrompt? | boolean | Hide system prompt in debug output (for cleaner logs). | - | AxJudgeForwardOptions.debugHideSystemPrompt |
description? | string | - | - | - |
disableMemoryCleanup? | boolean | - | - | AxJudgeForwardOptions.disableMemoryCleanup |
excludeContentFromTrace? | boolean | Exclude 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? | boolean | Whether 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? | AxLoggerFunction | Custom logger function for debug output. | - | AxJudgeForwardOptions.logger |
maxRetries? | number | - | - | AxJudgeForwardOptions.maxRetries |
maxSteps? | number | - | - | AxJudgeForwardOptions.maxSteps |
mem? | AxAIMemory | - | - | AxJudgeForwardOptions.mem |
meter? | Meter | OpenTelemetry 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? | AxRateLimiterFunction | Custom 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? | string | Session identifier for conversation tracking and memory isolation. | - | AxJudgeForwardOptions.sessionId |
showThoughts? | boolean | Include 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? | number | Internal: Current step index for multi-step operations. | - | AxJudgeForwardOptions.stepIndex |
stopFunction? | string | string[] | - | - | AxJudgeForwardOptions.stopFunction |
stream? | boolean | Enable 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? | number | Request timeout in milliseconds. Default 300000 (5 minutes) | - | AxJudgeForwardOptions.timeout |
traceContext? | Context | OpenTelemetry trace context for distributed tracing. | - | AxJudgeForwardOptions.traceContext |
traceLabel? | string | - | - | AxJudgeForwardOptions.traceLabel |
tracer? | Tracer | OpenTelemetry 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? | boolean | Enable low-level HTTP request/response logging. More verbose than debug. Shows raw HTTP traffic including headers. Useful for debugging API issues. | - | AxJudgeForwardOptions.verbose |
webSocket? | any | Custom WebSocket constructor for providers that use realtime WebSocket transports. | - | AxJudgeForwardOptions.webSocket |