@ax-llm/ax 11.0.52 → 11.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.cts CHANGED
@@ -28,6 +28,7 @@ interface AxAPIConfig extends AxAPI, RequestValidation, ResponseValidation {
28
28
  span?: Span;
29
29
  timeout?: number;
30
30
  retry?: Partial<RetryConfig>;
31
+ abortSignal?: AbortSignal;
31
32
  }
32
33
  declare class AxAIServiceError extends Error {
33
34
  readonly url: string;
@@ -58,6 +59,9 @@ declare class AxAIServiceStreamTerminatedError extends AxAIServiceError {
58
59
  declare class AxAIServiceTimeoutError extends AxAIServiceError {
59
60
  constructor(url: string, timeoutMs: number, requestBody?: unknown, context?: Record<string, unknown>);
60
61
  }
62
+ declare class AxAIServiceAbortedError extends AxAIServiceError {
63
+ constructor(url: string, reason?: string, requestBody?: unknown, context?: Record<string, unknown>);
64
+ }
61
65
  declare class AxAIServiceAuthenticationError extends AxAIServiceError {
62
66
  constructor(url: string, requestBody: unknown, responseBody: unknown, context?: Record<string, unknown>);
63
67
  }
@@ -93,6 +97,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
93
97
  private timeout?;
94
98
  private excludeContentFromTrace?;
95
99
  private models?;
100
+ private abortSignal?;
96
101
  private modelInfo;
97
102
  private modelUsage?;
98
103
  private embedModelUsage?;
@@ -342,6 +347,7 @@ type AxAIServiceOptions = {
342
347
  tracer?: Tracer;
343
348
  timeout?: number;
344
349
  excludeContentFromTrace?: boolean;
350
+ abortSignal?: AbortSignal;
345
351
  };
346
352
  type AxAIServiceActionOptions<TModel = unknown, TEmbedModel = unknown> = {
347
353
  ai?: Readonly<AxAIService<TModel, TEmbedModel>>;
@@ -353,6 +359,7 @@ type AxAIServiceActionOptions<TModel = unknown, TEmbedModel = unknown> = {
353
359
  debugHideSystemPrompt?: boolean;
354
360
  hideThought?: boolean;
355
361
  traceContext?: Context;
362
+ abortSignal?: AbortSignal;
356
363
  };
357
364
  interface AxAIService<TModel = unknown, TEmbedModel = unknown> {
358
365
  getId(): string;
@@ -2240,6 +2247,7 @@ type AxProgramForwardOptions = {
2240
2247
  debugHideSystemPrompt?: boolean;
2241
2248
  thinkingTokenBudget?: 'minimal' | 'low' | 'medium' | 'high' | 'highest' | 'none';
2242
2249
  traceLabel?: string;
2250
+ abortSignal?: AbortSignal;
2243
2251
  };
2244
2252
  type AxProgramStreamingForwardOptions = Omit<AxProgramForwardOptions, 'stream'>;
2245
2253
  type AxGenDeltaOut<OUT extends AxGenOut> = {
@@ -2247,8 +2255,11 @@ type AxGenDeltaOut<OUT extends AxGenOut> = {
2247
2255
  delta: Partial<OUT>;
2248
2256
  };
2249
2257
  type AxGenStreamingOut<OUT extends AxGenOut> = AsyncGenerator<AxGenDeltaOut<OUT>, void | OUT, unknown>;
2258
+ type AxSetExamplesOptions = {
2259
+ optionalOutputFields?: string[];
2260
+ };
2250
2261
  interface AxTunable {
2251
- setExamples: (examples: Readonly<AxProgramExamples>) => void;
2262
+ setExamples: (examples: Readonly<AxProgramExamples>, options?: Readonly<AxSetExamplesOptions>) => void;
2252
2263
  setId: (id: string) => void;
2253
2264
  setParentId: (parentId: string) => void;
2254
2265
  getTraces: () => AxProgramTrace[];
@@ -2269,6 +2280,7 @@ declare class AxProgramWithSignature<IN extends AxGenIn | ReadonlyArray<AxMessag
2269
2280
  protected signature: AxSignature;
2270
2281
  protected sigHash: string;
2271
2282
  protected examples?: Record<string, AxFieldValue>[];
2283
+ protected examplesOptions?: AxSetExamplesOptions;
2272
2284
  protected demos?: Record<string, AxFieldValue>[];
2273
2285
  protected trace?: Record<string, AxFieldValue>;
2274
2286
  protected usage: AxProgramUsage[];
@@ -2281,7 +2293,7 @@ declare class AxProgramWithSignature<IN extends AxGenIn | ReadonlyArray<AxMessag
2281
2293
  streamingForward(_ai: Readonly<AxAIService>, _values: IN, _options?: Readonly<AxProgramStreamingForwardOptions>): AxGenStreamingOut<OUT>;
2282
2294
  setId(id: string): void;
2283
2295
  setParentId(parentId: string): void;
2284
- setExamples(examples: Readonly<AxProgramExamples>): void;
2296
+ setExamples(examples: Readonly<AxProgramExamples>, options?: Readonly<AxSetExamplesOptions>): void;
2285
2297
  private _setExamples;
2286
2298
  getTraces(): AxProgramTrace[];
2287
2299
  getUsage(): AxProgramUsage[];
@@ -2299,7 +2311,7 @@ declare class AxProgram<IN extends AxGenIn, OUT extends AxGenOut> implements AxT
2299
2311
  streamingForward(_ai: Readonly<AxAIService>, _values: IN, _options?: Readonly<AxProgramStreamingForwardOptions>): AxGenStreamingOut<OUT>;
2300
2312
  setId(id: string): void;
2301
2313
  setParentId(parentId: string): void;
2302
- setExamples(examples: Readonly<AxProgramExamples>): void;
2314
+ setExamples(examples: Readonly<AxProgramExamples>, options?: Readonly<AxSetExamplesOptions>): void;
2303
2315
  getTraces(): AxProgramTrace[];
2304
2316
  getUsage(): AxProgramUsage[];
2305
2317
  resetUsage(): void;
@@ -2354,6 +2366,8 @@ type Writeable<T> = {
2354
2366
  interface AxPromptTemplateOptions {
2355
2367
  functions?: Readonly<AxInputFunctionType>;
2356
2368
  thoughtFieldName?: string;
2369
+ strictExamples?: boolean;
2370
+ optionalOutputFields?: string[];
2357
2371
  }
2358
2372
  type AxChatRequestChatPrompt = Writeable<AxChatRequest['chatPrompt'][0]>;
2359
2373
  type ChatRequestUserMessage = Exclude<Extract<AxChatRequestChatPrompt, {
@@ -2366,6 +2380,8 @@ declare class AxPromptTemplate {
2366
2380
  private task;
2367
2381
  private readonly thoughtFieldName;
2368
2382
  private readonly functions?;
2383
+ private readonly strictExamples;
2384
+ private readonly optionalOutputFields;
2369
2385
  constructor(sig: Readonly<AxSignature>, options?: Readonly<AxPromptTemplateOptions>, fieldTemplates?: Record<string, AxFieldTemplateFn>);
2370
2386
  render: <T extends AxGenIn>(values: T | ReadonlyArray<AxMessage>, // Allow T (AxGenIn) or array of AxMessages
2371
2387
  { examples, demos, }: Readonly<{
@@ -2405,6 +2421,8 @@ interface AxGenOptions {
2405
2421
  stream?: boolean;
2406
2422
  description?: string;
2407
2423
  thoughtFieldName?: string;
2424
+ strictExamples?: boolean;
2425
+ optionalOutputFields?: string[];
2408
2426
  functions?: AxInputFunctionType;
2409
2427
  functionCall?: AxChatRequest['functionCall'];
2410
2428
  stopFunction?: string;
@@ -2471,6 +2489,7 @@ declare class AxGen<IN extends AxGenIn | ReadonlyArray<AxMessage> = AxGenIn | Re
2471
2489
  version: number;
2472
2490
  delta: Partial<OUT>;
2473
2491
  }, void, unknown>;
2492
+ setExamples(examples: Readonly<AxProgramExamples>, options?: Readonly<AxSetExamplesOptions>): void;
2474
2493
  }
2475
2494
  type AxGenerateErrorDetails = {
2476
2495
  model?: string;
@@ -2530,7 +2549,7 @@ declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut = AxGenOut> imple
2530
2549
  agents?: AxAgentic[];
2531
2550
  functions?: AxInputFunctionType;
2532
2551
  }>, options?: Readonly<AxAgentOptions>);
2533
- setExamples(examples: Readonly<AxProgramExamples>): void;
2552
+ setExamples(examples: Readonly<AxProgramExamples>, options?: Readonly<AxSetExamplesOptions>): void;
2534
2553
  setId(id: string): void;
2535
2554
  setParentId(parentId: string): void;
2536
2555
  getTraces(): AxProgramTrace[];
@@ -2868,9 +2887,11 @@ declare class AxDBManager {
2868
2887
  batchSize?: number;
2869
2888
  maxWordsPerChunk?: number;
2870
2889
  minWordsPerChunk?: number;
2890
+ abortSignal?: AbortSignal;
2871
2891
  }>) => Promise<void>;
2872
- query: (query: Readonly<string | string[] | number | number[]>, { topPercent }?: Readonly<{
2892
+ query: (query: Readonly<string | string[] | number | number[]>, { topPercent, abortSignal, }?: Readonly<{
2873
2893
  topPercent?: number;
2894
+ abortSignal?: AbortSignal;
2874
2895
  }> | undefined) => Promise<AxDBMatch[][]>;
2875
2896
  }
2876
2897
 
@@ -3371,6 +3392,7 @@ declare class AxRateLimiterTokenUsage {
3371
3392
 
3372
3393
  interface AxSimpleClassifierForwardOptions {
3373
3394
  cutoff?: number;
3395
+ abortSignal?: AbortSignal;
3374
3396
  }
3375
3397
  declare class AxSimpleClassifierClass {
3376
3398
  private readonly name;
@@ -3386,7 +3408,9 @@ declare class AxSimpleClassifier {
3386
3408
  constructor(ai: AxAIService);
3387
3409
  getState(): AxDBState | undefined;
3388
3410
  setState(state: AxDBState): void;
3389
- setClasses: (classes: readonly AxSimpleClassifierClass[]) => Promise<void>;
3411
+ setClasses: (classes: readonly AxSimpleClassifierClass[], options?: Readonly<{
3412
+ abortSignal?: AbortSignal;
3413
+ }>) => Promise<void>;
3390
3414
  forward(text: string, options?: Readonly<AxSimpleClassifierForwardOptions>): Promise<string>;
3391
3415
  setOptions(options: Readonly<{
3392
3416
  debug?: boolean;
@@ -3428,6 +3452,74 @@ Readonly<AxAIOpenAIEmbedResponse>> {
3428
3452
  createEmbedReq(req: Readonly<AxInternalEmbedRequest<TEmbedModel>>): [AxAPI, AxAIOpenAIEmbedRequest<TEmbedModel>];
3429
3453
  }
3430
3454
 
3455
+ /**
3456
+ * Utility class for creating abortable AI requests.
3457
+ * Provides a convenient way to manage request cancellation.
3458
+ *
3459
+ * @example
3460
+ * ```typescript
3461
+ * const abortable = new AxAbortableAI(ai)
3462
+ *
3463
+ * // Start a request
3464
+ * const responsePromise = abortable.chat({
3465
+ * chatPrompt: [{ role: 'user', content: 'Hello' }]
3466
+ * })
3467
+ *
3468
+ * // Later, abort it
3469
+ * abortable.abort('User cancelled')
3470
+ *
3471
+ * try {
3472
+ * const response = await responsePromise
3473
+ * } catch (error) {
3474
+ * if (error instanceof AxAIServiceAbortedError) {
3475
+ * console.log('Request was aborted:', error.message)
3476
+ * }
3477
+ * }
3478
+ * ```
3479
+ */
3480
+ declare class AxAbortableAI<TModel = unknown, TEmbedModel = unknown> {
3481
+ private abortController;
3482
+ private readonly ai;
3483
+ constructor(ai: AxAIService<TModel, TEmbedModel>);
3484
+ /**
3485
+ * Get the current abort signal
3486
+ */
3487
+ get signal(): AbortSignal;
3488
+ /**
3489
+ * Check if the request has been aborted
3490
+ */
3491
+ get aborted(): boolean;
3492
+ /**
3493
+ * Abort the ongoing request
3494
+ * @param reason Optional reason for the abort
3495
+ */
3496
+ abort(reason?: string): void;
3497
+ /**
3498
+ * Reset the abort controller to allow new requests
3499
+ * This creates a new AbortController, allowing fresh requests
3500
+ */
3501
+ reset(): void;
3502
+ /**
3503
+ * Send a chat request with abort support
3504
+ */
3505
+ chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<TModel, TEmbedModel>>): Promise<AxChatResponse | ReadableStream$1<AxChatResponse>>;
3506
+ /**
3507
+ * Send an embed request with abort support
3508
+ */
3509
+ embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<TModel, TEmbedModel>>): Promise<AxEmbedResponse>;
3510
+ /**
3511
+ * Create a timeout-based abort after specified milliseconds
3512
+ * @param timeoutMs Timeout in milliseconds
3513
+ * @param reason Optional reason for the timeout abort
3514
+ * @returns Timeout ID that can be cleared
3515
+ */
3516
+ abortAfter(timeoutMs: number, reason?: string): NodeJS.Timeout;
3517
+ /**
3518
+ * Add an event listener for abort events
3519
+ */
3520
+ onAbort(callback: (reason?: string) => void): void;
3521
+ }
3522
+
3431
3523
  declare class AxChainOfThought<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOut> extends AxGen<IN, OUT> {
3432
3524
  constructor(signature: Readonly<AxSignature | string>, options?: Readonly<AxGenOptions & {
3433
3525
  setVisibleReasoning?: boolean;
@@ -3714,4 +3806,4 @@ declare const axModelInfoReka: AxModelInfo[];
3714
3806
 
3715
3807
  declare const axModelInfoTogether: AxModelInfo[];
3716
3808
 
3717
- export { AxAI, AxAIAnthropic, type AxAIAnthropicArgs, type AxAIAnthropicChatError, type AxAIAnthropicChatRequest, type AxAIAnthropicChatRequestCacheParam, type AxAIAnthropicChatResponse, type AxAIAnthropicChatResponseDelta, type AxAIAnthropicConfig, type AxAIAnthropicContentBlockDeltaEvent, type AxAIAnthropicContentBlockStartEvent, type AxAIAnthropicContentBlockStopEvent, type AxAIAnthropicErrorEvent, type AxAIAnthropicMessageDeltaEvent, type AxAIAnthropicMessageStartEvent, type AxAIAnthropicMessageStopEvent, AxAIAnthropicModel, type AxAIAnthropicPingEvent, AxAIAnthropicVertexModel, type AxAIArgs, AxAIAzureOpenAI, type AxAIAzureOpenAIArgs, type AxAIAzureOpenAIConfig, AxAICohere, type AxAICohereArgs, type AxAICohereChatRequest, type AxAICohereChatRequestToolResults, type AxAICohereChatResponse, type AxAICohereChatResponseDelta, type AxAICohereChatResponseToolCalls, type AxAICohereConfig, AxAICohereEmbedModel, type AxAICohereEmbedRequest, type AxAICohereEmbedResponse, AxAICohereModel, AxAIDeepSeek, type AxAIDeepSeekArgs, AxAIDeepSeekModel, type AxAIEmbedModels, type AxAIFeatures, AxAIGoogleGemini, type AxAIGoogleGeminiArgs, type AxAIGoogleGeminiBatchEmbedRequest, type AxAIGoogleGeminiBatchEmbedResponse, type AxAIGoogleGeminiChatRequest, type AxAIGoogleGeminiChatResponse, type AxAIGoogleGeminiChatResponseDelta, type AxAIGoogleGeminiConfig, type AxAIGoogleGeminiContent, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiEmbedTypes, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiThinkingConfig, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, type AxAIGoogleGeminiToolGoogleSearchRetrieval, type AxAIGoogleVertexBatchEmbedRequest, type AxAIGoogleVertexBatchEmbedResponse, AxAIGrok, type AxAIGrokArgs, type AxAIGrokChatRequest, AxAIGrokEmbedModels, AxAIGrokModel, type AxAIGrokOptionsTools, type AxAIGrokSearchSource, AxAIGroq, type AxAIGroqArgs, AxAIGroqModel, AxAIHuggingFace, type AxAIHuggingFaceArgs, type AxAIHuggingFaceConfig, AxAIHuggingFaceModel, type AxAIHuggingFaceRequest, type AxAIHuggingFaceResponse, type AxAIInputModelList, type AxAIMemory, AxAIMistral, type AxAIMistralArgs, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, type AxAIModelListBase, type AxAIModels, AxAIOllama, type AxAIOllamaAIConfig, type AxAIOllamaArgs, AxAIOpenAI, type AxAIOpenAIArgs, AxAIOpenAIBase, type AxAIOpenAIBaseArgs, type AxAIOpenAIChatRequest, type AxAIOpenAIChatResponse, type AxAIOpenAIChatResponseDelta, type AxAIOpenAIConfig, AxAIOpenAIEmbedModel, type AxAIOpenAIEmbedRequest, type AxAIOpenAIEmbedResponse, type AxAIOpenAILogprob, AxAIOpenAIModel, type AxAIOpenAIResponseDelta, AxAIOpenAIResponses, type AxAIOpenAIResponsesArgs, AxAIOpenAIResponsesBase, type AxAIOpenAIResponsesCodeInterpreterToolCall, type AxAIOpenAIResponsesComputerToolCall, type AxAIOpenAIResponsesConfig, type AxAIOpenAIResponsesContentPartAddedEvent, type AxAIOpenAIResponsesContentPartDoneEvent, type AxAIOpenAIResponsesDefineFunctionTool, type AxAIOpenAIResponsesErrorEvent, type AxAIOpenAIResponsesFileSearchCallCompletedEvent, type AxAIOpenAIResponsesFileSearchCallInProgressEvent, type AxAIOpenAIResponsesFileSearchCallSearchingEvent, type AxAIOpenAIResponsesFileSearchToolCall, type AxAIOpenAIResponsesFunctionCallArgumentsDeltaEvent, type AxAIOpenAIResponsesFunctionCallArgumentsDoneEvent, type AxAIOpenAIResponsesFunctionCallItem, type AxAIOpenAIResponsesImageGenerationCallCompletedEvent, type AxAIOpenAIResponsesImageGenerationCallGeneratingEvent, type AxAIOpenAIResponsesImageGenerationCallInProgressEvent, type AxAIOpenAIResponsesImageGenerationCallPartialImageEvent, type AxAIOpenAIResponsesImageGenerationToolCall, AxAIOpenAIResponsesImpl, type AxAIOpenAIResponsesInputAudioContentPart, type AxAIOpenAIResponsesInputContentPart, type AxAIOpenAIResponsesInputFunctionCallItem, type AxAIOpenAIResponsesInputFunctionCallOutputItem, type AxAIOpenAIResponsesInputImageUrlContentPart, type AxAIOpenAIResponsesInputItem, type AxAIOpenAIResponsesInputMessageItem, type AxAIOpenAIResponsesInputTextContentPart, type AxAIOpenAIResponsesLocalShellToolCall, type AxAIOpenAIResponsesMCPCallArgumentsDeltaEvent, type AxAIOpenAIResponsesMCPCallArgumentsDoneEvent, type AxAIOpenAIResponsesMCPCallCompletedEvent, type AxAIOpenAIResponsesMCPCallFailedEvent, type AxAIOpenAIResponsesMCPCallInProgressEvent, type AxAIOpenAIResponsesMCPListToolsCompletedEvent, type AxAIOpenAIResponsesMCPListToolsFailedEvent, type AxAIOpenAIResponsesMCPListToolsInProgressEvent, type AxAIOpenAIResponsesMCPToolCall, type AxAIOpenAIResponsesOutputItem, type AxAIOpenAIResponsesOutputItemAddedEvent, type AxAIOpenAIResponsesOutputItemDoneEvent, type AxAIOpenAIResponsesOutputMessageItem, type AxAIOpenAIResponsesOutputRefusalContentPart, type AxAIOpenAIResponsesOutputTextAnnotationAddedEvent, type AxAIOpenAIResponsesOutputTextContentPart, type AxAIOpenAIResponsesOutputTextDeltaEvent, type AxAIOpenAIResponsesOutputTextDoneEvent, type AxAIOpenAIResponsesReasoningDeltaEvent, type AxAIOpenAIResponsesReasoningDoneEvent, type AxAIOpenAIResponsesReasoningItem, type AxAIOpenAIResponsesReasoningSummaryDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryDoneEvent, type AxAIOpenAIResponsesReasoningSummaryPart, type AxAIOpenAIResponsesReasoningSummaryPartAddedEvent, type AxAIOpenAIResponsesReasoningSummaryPartDoneEvent, type AxAIOpenAIResponsesReasoningSummaryTextDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryTextDoneEvent, type AxAIOpenAIResponsesRefusalDeltaEvent, type AxAIOpenAIResponsesRefusalDoneEvent, type AxAIOpenAIResponsesRequest, type AxAIOpenAIResponsesResponse, type AxAIOpenAIResponsesResponseCompletedEvent, type AxAIOpenAIResponsesResponseCreatedEvent, type AxAIOpenAIResponsesResponseDelta, type AxAIOpenAIResponsesResponseFailedEvent, type AxAIOpenAIResponsesResponseInProgressEvent, type AxAIOpenAIResponsesResponseIncompleteEvent, type AxAIOpenAIResponsesResponseQueuedEvent, type AxAIOpenAIResponsesStreamEvent, type AxAIOpenAIResponsesStreamEventBase, type AxAIOpenAIResponsesToolCall, type AxAIOpenAIResponsesToolCallBase, type AxAIOpenAIResponsesToolChoice, type AxAIOpenAIResponsesToolDefinition, type AxAIOpenAIResponsesWebSearchCallCompletedEvent, type AxAIOpenAIResponsesWebSearchCallInProgressEvent, type AxAIOpenAIResponsesWebSearchCallSearchingEvent, type AxAIOpenAIResponsesWebSearchToolCall, type AxAIOpenAIUsage, type AxAIPromptConfig, AxAIReka, type AxAIRekaArgs, type AxAIRekaChatRequest, type AxAIRekaChatResponse, type AxAIRekaChatResponseDelta, type AxAIRekaConfig, AxAIRekaModel, type AxAIRekaUsage, type AxAIService, type AxAIServiceActionOptions, AxAIServiceAuthenticationError, AxAIServiceError, type AxAIServiceImpl, type AxAIServiceMetrics, AxAIServiceNetworkError, type AxAIServiceOptions, AxAIServiceResponseError, AxAIServiceStatusError, AxAIServiceStreamTerminatedError, AxAIServiceTimeoutError, AxAITogether, type AxAITogetherArgs, type AxAPI, type AxAPIConfig, AxAgent, type AxAgentFeatures, type AxAgentOptions, type AxAgentic, AxApacheTika, type AxApacheTikaArgs, type AxApacheTikaConvertOptions, type AxAssertion, AxAssertionError, AxBalancer, type AxBalancerOptions, AxBaseAI, type AxBaseAIArgs, AxBootstrapFewShot, AxChainOfThought, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, AxDB, type AxDBArgs, AxDBBase, type AxDBBaseArgs, type AxDBBaseOpOptions, AxDBCloudflare, type AxDBCloudflareArgs, type AxDBCloudflareOpOptions, type AxDBLoaderOptions, AxDBManager, type AxDBManagerArgs, type AxDBMatch, AxDBMemory, type AxDBMemoryArgs, type AxDBMemoryOpOptions, AxDBPinecone, type AxDBPineconeArgs, type AxDBPineconeOpOptions, type AxDBQueryRequest, type AxDBQueryResponse, type AxDBQueryService, type AxDBService, type AxDBState, type AxDBUpsertRequest, type AxDBUpsertResponse, AxDBWeaviate, type AxDBWeaviateArgs, type AxDBWeaviateOpOptions, type AxDataRow, AxDefaultQueryRewriter, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, AxEvalUtil, type AxEvaluateArgs, type AxExample, type AxField, type AxFieldProcessor, type AxFieldProcessorProcess, type AxFieldTemplateFn, type AxFieldValue, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenOptions, type AxGenOut, type AxGenStreamingOut, AxGenerateError, type AxGenerateErrorDetails, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSInterpreter, AxJSInterpreterPermission, AxLLMRequestTypeValues, AxMCPClient, AxMCPHTTPSSETransport, AxMCPStdioTransport, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPTransport, AxMemory, type AxMessage, type AxMetricFn, type AxMetricFnArgs, AxMiPRO, type AxMiPROOptions, AxMockAIService, type AxMockAIServiceConfig, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxModelUsage, AxMultiServiceRouter, type AxOptimizationStats, type AxOptimizerArgs, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramStreamingForwardOptions, type AxProgramTrace, type AxProgramUsage, AxProgramWithSignature, type AxProgramWithSignatureOptions, AxPromptTemplate, type AxPromptTemplateOptions, AxRAG, type AxRateLimiterFunction, AxRateLimiterTokenUsage, type AxRateLimiterTokenUsageOptions, type AxRerankerIn, type AxRerankerOut, type AxResponseHandlerArgs, type AxRewriteIn, type AxRewriteOut, AxSignature, AxSimpleClassifier, AxSimpleClassifierClass, type AxSimpleClassifierForwardOptions, AxSpanKindValues, type AxStreamingAssertion, type AxStreamingEvent, type AxStreamingFieldProcessorProcess, AxStringUtil, AxTestPrompt, type AxTokenUsage, type AxTunable, type AxUsable, axAIAnthropicDefaultConfig, axAIAnthropicVertexDefaultConfig, axAIAzureOpenAIBestConfig, axAIAzureOpenAICreativeConfig, axAIAzureOpenAIDefaultConfig, axAIAzureOpenAIFastConfig, axAICohereCreativeConfig, axAICohereDefaultConfig, axAIDeepSeekCodeConfig, axAIDeepSeekDefaultConfig, axAIGoogleGeminiDefaultConfig, axAIGoogleGeminiDefaultCreativeConfig, axAIGrokBestConfig, axAIGrokDefaultConfig, axAIHuggingFaceCreativeConfig, axAIHuggingFaceDefaultConfig, axAIMistralBestConfig, axAIMistralDefaultConfig, axAIOllamaDefaultConfig, axAIOllamaDefaultCreativeConfig, axAIOpenAIBestConfig, axAIOpenAICreativeConfig, axAIOpenAIDefaultConfig, axAIOpenAIFastConfig, axAIOpenAIResponsesBestConfig, axAIOpenAIResponsesCreativeConfig, axAIOpenAIResponsesDefaultConfig, axAIRekaBestConfig, axAIRekaCreativeConfig, axAIRekaDefaultConfig, axAIRekaFastConfig, axAITogetherDefaultConfig, axBaseAIDefaultConfig, axBaseAIDefaultCreativeConfig, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoReka, axModelInfoTogether, axSpanAttributes, axSpanEvents };
3809
+ export { AxAI, AxAIAnthropic, type AxAIAnthropicArgs, type AxAIAnthropicChatError, type AxAIAnthropicChatRequest, type AxAIAnthropicChatRequestCacheParam, type AxAIAnthropicChatResponse, type AxAIAnthropicChatResponseDelta, type AxAIAnthropicConfig, type AxAIAnthropicContentBlockDeltaEvent, type AxAIAnthropicContentBlockStartEvent, type AxAIAnthropicContentBlockStopEvent, type AxAIAnthropicErrorEvent, type AxAIAnthropicMessageDeltaEvent, type AxAIAnthropicMessageStartEvent, type AxAIAnthropicMessageStopEvent, AxAIAnthropicModel, type AxAIAnthropicPingEvent, AxAIAnthropicVertexModel, type AxAIArgs, AxAIAzureOpenAI, type AxAIAzureOpenAIArgs, type AxAIAzureOpenAIConfig, AxAICohere, type AxAICohereArgs, type AxAICohereChatRequest, type AxAICohereChatRequestToolResults, type AxAICohereChatResponse, type AxAICohereChatResponseDelta, type AxAICohereChatResponseToolCalls, type AxAICohereConfig, AxAICohereEmbedModel, type AxAICohereEmbedRequest, type AxAICohereEmbedResponse, AxAICohereModel, AxAIDeepSeek, type AxAIDeepSeekArgs, AxAIDeepSeekModel, type AxAIEmbedModels, type AxAIFeatures, AxAIGoogleGemini, type AxAIGoogleGeminiArgs, type AxAIGoogleGeminiBatchEmbedRequest, type AxAIGoogleGeminiBatchEmbedResponse, type AxAIGoogleGeminiChatRequest, type AxAIGoogleGeminiChatResponse, type AxAIGoogleGeminiChatResponseDelta, type AxAIGoogleGeminiConfig, type AxAIGoogleGeminiContent, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiEmbedTypes, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiThinkingConfig, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, type AxAIGoogleGeminiToolGoogleSearchRetrieval, type AxAIGoogleVertexBatchEmbedRequest, type AxAIGoogleVertexBatchEmbedResponse, AxAIGrok, type AxAIGrokArgs, type AxAIGrokChatRequest, AxAIGrokEmbedModels, AxAIGrokModel, type AxAIGrokOptionsTools, type AxAIGrokSearchSource, AxAIGroq, type AxAIGroqArgs, AxAIGroqModel, AxAIHuggingFace, type AxAIHuggingFaceArgs, type AxAIHuggingFaceConfig, AxAIHuggingFaceModel, type AxAIHuggingFaceRequest, type AxAIHuggingFaceResponse, type AxAIInputModelList, type AxAIMemory, AxAIMistral, type AxAIMistralArgs, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, type AxAIModelListBase, type AxAIModels, AxAIOllama, type AxAIOllamaAIConfig, type AxAIOllamaArgs, AxAIOpenAI, type AxAIOpenAIArgs, AxAIOpenAIBase, type AxAIOpenAIBaseArgs, type AxAIOpenAIChatRequest, type AxAIOpenAIChatResponse, type AxAIOpenAIChatResponseDelta, type AxAIOpenAIConfig, AxAIOpenAIEmbedModel, type AxAIOpenAIEmbedRequest, type AxAIOpenAIEmbedResponse, type AxAIOpenAILogprob, AxAIOpenAIModel, type AxAIOpenAIResponseDelta, AxAIOpenAIResponses, type AxAIOpenAIResponsesArgs, AxAIOpenAIResponsesBase, type AxAIOpenAIResponsesCodeInterpreterToolCall, type AxAIOpenAIResponsesComputerToolCall, type AxAIOpenAIResponsesConfig, type AxAIOpenAIResponsesContentPartAddedEvent, type AxAIOpenAIResponsesContentPartDoneEvent, type AxAIOpenAIResponsesDefineFunctionTool, type AxAIOpenAIResponsesErrorEvent, type AxAIOpenAIResponsesFileSearchCallCompletedEvent, type AxAIOpenAIResponsesFileSearchCallInProgressEvent, type AxAIOpenAIResponsesFileSearchCallSearchingEvent, type AxAIOpenAIResponsesFileSearchToolCall, type AxAIOpenAIResponsesFunctionCallArgumentsDeltaEvent, type AxAIOpenAIResponsesFunctionCallArgumentsDoneEvent, type AxAIOpenAIResponsesFunctionCallItem, type AxAIOpenAIResponsesImageGenerationCallCompletedEvent, type AxAIOpenAIResponsesImageGenerationCallGeneratingEvent, type AxAIOpenAIResponsesImageGenerationCallInProgressEvent, type AxAIOpenAIResponsesImageGenerationCallPartialImageEvent, type AxAIOpenAIResponsesImageGenerationToolCall, AxAIOpenAIResponsesImpl, type AxAIOpenAIResponsesInputAudioContentPart, type AxAIOpenAIResponsesInputContentPart, type AxAIOpenAIResponsesInputFunctionCallItem, type AxAIOpenAIResponsesInputFunctionCallOutputItem, type AxAIOpenAIResponsesInputImageUrlContentPart, type AxAIOpenAIResponsesInputItem, type AxAIOpenAIResponsesInputMessageItem, type AxAIOpenAIResponsesInputTextContentPart, type AxAIOpenAIResponsesLocalShellToolCall, type AxAIOpenAIResponsesMCPCallArgumentsDeltaEvent, type AxAIOpenAIResponsesMCPCallArgumentsDoneEvent, type AxAIOpenAIResponsesMCPCallCompletedEvent, type AxAIOpenAIResponsesMCPCallFailedEvent, type AxAIOpenAIResponsesMCPCallInProgressEvent, type AxAIOpenAIResponsesMCPListToolsCompletedEvent, type AxAIOpenAIResponsesMCPListToolsFailedEvent, type AxAIOpenAIResponsesMCPListToolsInProgressEvent, type AxAIOpenAIResponsesMCPToolCall, type AxAIOpenAIResponsesOutputItem, type AxAIOpenAIResponsesOutputItemAddedEvent, type AxAIOpenAIResponsesOutputItemDoneEvent, type AxAIOpenAIResponsesOutputMessageItem, type AxAIOpenAIResponsesOutputRefusalContentPart, type AxAIOpenAIResponsesOutputTextAnnotationAddedEvent, type AxAIOpenAIResponsesOutputTextContentPart, type AxAIOpenAIResponsesOutputTextDeltaEvent, type AxAIOpenAIResponsesOutputTextDoneEvent, type AxAIOpenAIResponsesReasoningDeltaEvent, type AxAIOpenAIResponsesReasoningDoneEvent, type AxAIOpenAIResponsesReasoningItem, type AxAIOpenAIResponsesReasoningSummaryDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryDoneEvent, type AxAIOpenAIResponsesReasoningSummaryPart, type AxAIOpenAIResponsesReasoningSummaryPartAddedEvent, type AxAIOpenAIResponsesReasoningSummaryPartDoneEvent, type AxAIOpenAIResponsesReasoningSummaryTextDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryTextDoneEvent, type AxAIOpenAIResponsesRefusalDeltaEvent, type AxAIOpenAIResponsesRefusalDoneEvent, type AxAIOpenAIResponsesRequest, type AxAIOpenAIResponsesResponse, type AxAIOpenAIResponsesResponseCompletedEvent, type AxAIOpenAIResponsesResponseCreatedEvent, type AxAIOpenAIResponsesResponseDelta, type AxAIOpenAIResponsesResponseFailedEvent, type AxAIOpenAIResponsesResponseInProgressEvent, type AxAIOpenAIResponsesResponseIncompleteEvent, type AxAIOpenAIResponsesResponseQueuedEvent, type AxAIOpenAIResponsesStreamEvent, type AxAIOpenAIResponsesStreamEventBase, type AxAIOpenAIResponsesToolCall, type AxAIOpenAIResponsesToolCallBase, type AxAIOpenAIResponsesToolChoice, type AxAIOpenAIResponsesToolDefinition, type AxAIOpenAIResponsesWebSearchCallCompletedEvent, type AxAIOpenAIResponsesWebSearchCallInProgressEvent, type AxAIOpenAIResponsesWebSearchCallSearchingEvent, type AxAIOpenAIResponsesWebSearchToolCall, type AxAIOpenAIUsage, type AxAIPromptConfig, AxAIReka, type AxAIRekaArgs, type AxAIRekaChatRequest, type AxAIRekaChatResponse, type AxAIRekaChatResponseDelta, type AxAIRekaConfig, AxAIRekaModel, type AxAIRekaUsage, type AxAIService, AxAIServiceAbortedError, type AxAIServiceActionOptions, AxAIServiceAuthenticationError, AxAIServiceError, type AxAIServiceImpl, type AxAIServiceMetrics, AxAIServiceNetworkError, type AxAIServiceOptions, AxAIServiceResponseError, AxAIServiceStatusError, AxAIServiceStreamTerminatedError, AxAIServiceTimeoutError, AxAITogether, type AxAITogetherArgs, type AxAPI, type AxAPIConfig, AxAbortableAI, AxAgent, type AxAgentFeatures, type AxAgentOptions, type AxAgentic, AxApacheTika, type AxApacheTikaArgs, type AxApacheTikaConvertOptions, type AxAssertion, AxAssertionError, AxBalancer, type AxBalancerOptions, AxBaseAI, type AxBaseAIArgs, AxBootstrapFewShot, AxChainOfThought, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, AxDB, type AxDBArgs, AxDBBase, type AxDBBaseArgs, type AxDBBaseOpOptions, AxDBCloudflare, type AxDBCloudflareArgs, type AxDBCloudflareOpOptions, type AxDBLoaderOptions, AxDBManager, type AxDBManagerArgs, type AxDBMatch, AxDBMemory, type AxDBMemoryArgs, type AxDBMemoryOpOptions, AxDBPinecone, type AxDBPineconeArgs, type AxDBPineconeOpOptions, type AxDBQueryRequest, type AxDBQueryResponse, type AxDBQueryService, type AxDBService, type AxDBState, type AxDBUpsertRequest, type AxDBUpsertResponse, AxDBWeaviate, type AxDBWeaviateArgs, type AxDBWeaviateOpOptions, type AxDataRow, AxDefaultQueryRewriter, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, AxEvalUtil, type AxEvaluateArgs, type AxExample, type AxField, type AxFieldProcessor, type AxFieldProcessorProcess, type AxFieldTemplateFn, type AxFieldValue, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenOptions, type AxGenOut, type AxGenStreamingOut, AxGenerateError, type AxGenerateErrorDetails, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSInterpreter, AxJSInterpreterPermission, AxLLMRequestTypeValues, AxMCPClient, AxMCPHTTPSSETransport, AxMCPStdioTransport, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPTransport, AxMemory, type AxMessage, type AxMetricFn, type AxMetricFnArgs, AxMiPRO, type AxMiPROOptions, AxMockAIService, type AxMockAIServiceConfig, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxModelUsage, AxMultiServiceRouter, type AxOptimizationStats, type AxOptimizerArgs, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramStreamingForwardOptions, type AxProgramTrace, type AxProgramUsage, AxProgramWithSignature, type AxProgramWithSignatureOptions, AxPromptTemplate, type AxPromptTemplateOptions, AxRAG, type AxRateLimiterFunction, AxRateLimiterTokenUsage, type AxRateLimiterTokenUsageOptions, type AxRerankerIn, type AxRerankerOut, type AxResponseHandlerArgs, type AxRewriteIn, type AxRewriteOut, type AxSetExamplesOptions, AxSignature, AxSimpleClassifier, AxSimpleClassifierClass, type AxSimpleClassifierForwardOptions, AxSpanKindValues, type AxStreamingAssertion, type AxStreamingEvent, type AxStreamingFieldProcessorProcess, AxStringUtil, AxTestPrompt, type AxTokenUsage, type AxTunable, type AxUsable, axAIAnthropicDefaultConfig, axAIAnthropicVertexDefaultConfig, axAIAzureOpenAIBestConfig, axAIAzureOpenAICreativeConfig, axAIAzureOpenAIDefaultConfig, axAIAzureOpenAIFastConfig, axAICohereCreativeConfig, axAICohereDefaultConfig, axAIDeepSeekCodeConfig, axAIDeepSeekDefaultConfig, axAIGoogleGeminiDefaultConfig, axAIGoogleGeminiDefaultCreativeConfig, axAIGrokBestConfig, axAIGrokDefaultConfig, axAIHuggingFaceCreativeConfig, axAIHuggingFaceDefaultConfig, axAIMistralBestConfig, axAIMistralDefaultConfig, axAIOllamaDefaultConfig, axAIOllamaDefaultCreativeConfig, axAIOpenAIBestConfig, axAIOpenAICreativeConfig, axAIOpenAIDefaultConfig, axAIOpenAIFastConfig, axAIOpenAIResponsesBestConfig, axAIOpenAIResponsesCreativeConfig, axAIOpenAIResponsesDefaultConfig, axAIRekaBestConfig, axAIRekaCreativeConfig, axAIRekaDefaultConfig, axAIRekaFastConfig, axAITogetherDefaultConfig, axBaseAIDefaultConfig, axBaseAIDefaultCreativeConfig, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoReka, axModelInfoTogether, axSpanAttributes, axSpanEvents };
package/index.d.ts CHANGED
@@ -28,6 +28,7 @@ interface AxAPIConfig extends AxAPI, RequestValidation, ResponseValidation {
28
28
  span?: Span;
29
29
  timeout?: number;
30
30
  retry?: Partial<RetryConfig>;
31
+ abortSignal?: AbortSignal;
31
32
  }
32
33
  declare class AxAIServiceError extends Error {
33
34
  readonly url: string;
@@ -58,6 +59,9 @@ declare class AxAIServiceStreamTerminatedError extends AxAIServiceError {
58
59
  declare class AxAIServiceTimeoutError extends AxAIServiceError {
59
60
  constructor(url: string, timeoutMs: number, requestBody?: unknown, context?: Record<string, unknown>);
60
61
  }
62
+ declare class AxAIServiceAbortedError extends AxAIServiceError {
63
+ constructor(url: string, reason?: string, requestBody?: unknown, context?: Record<string, unknown>);
64
+ }
61
65
  declare class AxAIServiceAuthenticationError extends AxAIServiceError {
62
66
  constructor(url: string, requestBody: unknown, responseBody: unknown, context?: Record<string, unknown>);
63
67
  }
@@ -93,6 +97,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
93
97
  private timeout?;
94
98
  private excludeContentFromTrace?;
95
99
  private models?;
100
+ private abortSignal?;
96
101
  private modelInfo;
97
102
  private modelUsage?;
98
103
  private embedModelUsage?;
@@ -342,6 +347,7 @@ type AxAIServiceOptions = {
342
347
  tracer?: Tracer;
343
348
  timeout?: number;
344
349
  excludeContentFromTrace?: boolean;
350
+ abortSignal?: AbortSignal;
345
351
  };
346
352
  type AxAIServiceActionOptions<TModel = unknown, TEmbedModel = unknown> = {
347
353
  ai?: Readonly<AxAIService<TModel, TEmbedModel>>;
@@ -353,6 +359,7 @@ type AxAIServiceActionOptions<TModel = unknown, TEmbedModel = unknown> = {
353
359
  debugHideSystemPrompt?: boolean;
354
360
  hideThought?: boolean;
355
361
  traceContext?: Context;
362
+ abortSignal?: AbortSignal;
356
363
  };
357
364
  interface AxAIService<TModel = unknown, TEmbedModel = unknown> {
358
365
  getId(): string;
@@ -2240,6 +2247,7 @@ type AxProgramForwardOptions = {
2240
2247
  debugHideSystemPrompt?: boolean;
2241
2248
  thinkingTokenBudget?: 'minimal' | 'low' | 'medium' | 'high' | 'highest' | 'none';
2242
2249
  traceLabel?: string;
2250
+ abortSignal?: AbortSignal;
2243
2251
  };
2244
2252
  type AxProgramStreamingForwardOptions = Omit<AxProgramForwardOptions, 'stream'>;
2245
2253
  type AxGenDeltaOut<OUT extends AxGenOut> = {
@@ -2247,8 +2255,11 @@ type AxGenDeltaOut<OUT extends AxGenOut> = {
2247
2255
  delta: Partial<OUT>;
2248
2256
  };
2249
2257
  type AxGenStreamingOut<OUT extends AxGenOut> = AsyncGenerator<AxGenDeltaOut<OUT>, void | OUT, unknown>;
2258
+ type AxSetExamplesOptions = {
2259
+ optionalOutputFields?: string[];
2260
+ };
2250
2261
  interface AxTunable {
2251
- setExamples: (examples: Readonly<AxProgramExamples>) => void;
2262
+ setExamples: (examples: Readonly<AxProgramExamples>, options?: Readonly<AxSetExamplesOptions>) => void;
2252
2263
  setId: (id: string) => void;
2253
2264
  setParentId: (parentId: string) => void;
2254
2265
  getTraces: () => AxProgramTrace[];
@@ -2269,6 +2280,7 @@ declare class AxProgramWithSignature<IN extends AxGenIn | ReadonlyArray<AxMessag
2269
2280
  protected signature: AxSignature;
2270
2281
  protected sigHash: string;
2271
2282
  protected examples?: Record<string, AxFieldValue>[];
2283
+ protected examplesOptions?: AxSetExamplesOptions;
2272
2284
  protected demos?: Record<string, AxFieldValue>[];
2273
2285
  protected trace?: Record<string, AxFieldValue>;
2274
2286
  protected usage: AxProgramUsage[];
@@ -2281,7 +2293,7 @@ declare class AxProgramWithSignature<IN extends AxGenIn | ReadonlyArray<AxMessag
2281
2293
  streamingForward(_ai: Readonly<AxAIService>, _values: IN, _options?: Readonly<AxProgramStreamingForwardOptions>): AxGenStreamingOut<OUT>;
2282
2294
  setId(id: string): void;
2283
2295
  setParentId(parentId: string): void;
2284
- setExamples(examples: Readonly<AxProgramExamples>): void;
2296
+ setExamples(examples: Readonly<AxProgramExamples>, options?: Readonly<AxSetExamplesOptions>): void;
2285
2297
  private _setExamples;
2286
2298
  getTraces(): AxProgramTrace[];
2287
2299
  getUsage(): AxProgramUsage[];
@@ -2299,7 +2311,7 @@ declare class AxProgram<IN extends AxGenIn, OUT extends AxGenOut> implements AxT
2299
2311
  streamingForward(_ai: Readonly<AxAIService>, _values: IN, _options?: Readonly<AxProgramStreamingForwardOptions>): AxGenStreamingOut<OUT>;
2300
2312
  setId(id: string): void;
2301
2313
  setParentId(parentId: string): void;
2302
- setExamples(examples: Readonly<AxProgramExamples>): void;
2314
+ setExamples(examples: Readonly<AxProgramExamples>, options?: Readonly<AxSetExamplesOptions>): void;
2303
2315
  getTraces(): AxProgramTrace[];
2304
2316
  getUsage(): AxProgramUsage[];
2305
2317
  resetUsage(): void;
@@ -2354,6 +2366,8 @@ type Writeable<T> = {
2354
2366
  interface AxPromptTemplateOptions {
2355
2367
  functions?: Readonly<AxInputFunctionType>;
2356
2368
  thoughtFieldName?: string;
2369
+ strictExamples?: boolean;
2370
+ optionalOutputFields?: string[];
2357
2371
  }
2358
2372
  type AxChatRequestChatPrompt = Writeable<AxChatRequest['chatPrompt'][0]>;
2359
2373
  type ChatRequestUserMessage = Exclude<Extract<AxChatRequestChatPrompt, {
@@ -2366,6 +2380,8 @@ declare class AxPromptTemplate {
2366
2380
  private task;
2367
2381
  private readonly thoughtFieldName;
2368
2382
  private readonly functions?;
2383
+ private readonly strictExamples;
2384
+ private readonly optionalOutputFields;
2369
2385
  constructor(sig: Readonly<AxSignature>, options?: Readonly<AxPromptTemplateOptions>, fieldTemplates?: Record<string, AxFieldTemplateFn>);
2370
2386
  render: <T extends AxGenIn>(values: T | ReadonlyArray<AxMessage>, // Allow T (AxGenIn) or array of AxMessages
2371
2387
  { examples, demos, }: Readonly<{
@@ -2405,6 +2421,8 @@ interface AxGenOptions {
2405
2421
  stream?: boolean;
2406
2422
  description?: string;
2407
2423
  thoughtFieldName?: string;
2424
+ strictExamples?: boolean;
2425
+ optionalOutputFields?: string[];
2408
2426
  functions?: AxInputFunctionType;
2409
2427
  functionCall?: AxChatRequest['functionCall'];
2410
2428
  stopFunction?: string;
@@ -2471,6 +2489,7 @@ declare class AxGen<IN extends AxGenIn | ReadonlyArray<AxMessage> = AxGenIn | Re
2471
2489
  version: number;
2472
2490
  delta: Partial<OUT>;
2473
2491
  }, void, unknown>;
2492
+ setExamples(examples: Readonly<AxProgramExamples>, options?: Readonly<AxSetExamplesOptions>): void;
2474
2493
  }
2475
2494
  type AxGenerateErrorDetails = {
2476
2495
  model?: string;
@@ -2530,7 +2549,7 @@ declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut = AxGenOut> imple
2530
2549
  agents?: AxAgentic[];
2531
2550
  functions?: AxInputFunctionType;
2532
2551
  }>, options?: Readonly<AxAgentOptions>);
2533
- setExamples(examples: Readonly<AxProgramExamples>): void;
2552
+ setExamples(examples: Readonly<AxProgramExamples>, options?: Readonly<AxSetExamplesOptions>): void;
2534
2553
  setId(id: string): void;
2535
2554
  setParentId(parentId: string): void;
2536
2555
  getTraces(): AxProgramTrace[];
@@ -2868,9 +2887,11 @@ declare class AxDBManager {
2868
2887
  batchSize?: number;
2869
2888
  maxWordsPerChunk?: number;
2870
2889
  minWordsPerChunk?: number;
2890
+ abortSignal?: AbortSignal;
2871
2891
  }>) => Promise<void>;
2872
- query: (query: Readonly<string | string[] | number | number[]>, { topPercent }?: Readonly<{
2892
+ query: (query: Readonly<string | string[] | number | number[]>, { topPercent, abortSignal, }?: Readonly<{
2873
2893
  topPercent?: number;
2894
+ abortSignal?: AbortSignal;
2874
2895
  }> | undefined) => Promise<AxDBMatch[][]>;
2875
2896
  }
2876
2897
 
@@ -3371,6 +3392,7 @@ declare class AxRateLimiterTokenUsage {
3371
3392
 
3372
3393
  interface AxSimpleClassifierForwardOptions {
3373
3394
  cutoff?: number;
3395
+ abortSignal?: AbortSignal;
3374
3396
  }
3375
3397
  declare class AxSimpleClassifierClass {
3376
3398
  private readonly name;
@@ -3386,7 +3408,9 @@ declare class AxSimpleClassifier {
3386
3408
  constructor(ai: AxAIService);
3387
3409
  getState(): AxDBState | undefined;
3388
3410
  setState(state: AxDBState): void;
3389
- setClasses: (classes: readonly AxSimpleClassifierClass[]) => Promise<void>;
3411
+ setClasses: (classes: readonly AxSimpleClassifierClass[], options?: Readonly<{
3412
+ abortSignal?: AbortSignal;
3413
+ }>) => Promise<void>;
3390
3414
  forward(text: string, options?: Readonly<AxSimpleClassifierForwardOptions>): Promise<string>;
3391
3415
  setOptions(options: Readonly<{
3392
3416
  debug?: boolean;
@@ -3428,6 +3452,74 @@ Readonly<AxAIOpenAIEmbedResponse>> {
3428
3452
  createEmbedReq(req: Readonly<AxInternalEmbedRequest<TEmbedModel>>): [AxAPI, AxAIOpenAIEmbedRequest<TEmbedModel>];
3429
3453
  }
3430
3454
 
3455
+ /**
3456
+ * Utility class for creating abortable AI requests.
3457
+ * Provides a convenient way to manage request cancellation.
3458
+ *
3459
+ * @example
3460
+ * ```typescript
3461
+ * const abortable = new AxAbortableAI(ai)
3462
+ *
3463
+ * // Start a request
3464
+ * const responsePromise = abortable.chat({
3465
+ * chatPrompt: [{ role: 'user', content: 'Hello' }]
3466
+ * })
3467
+ *
3468
+ * // Later, abort it
3469
+ * abortable.abort('User cancelled')
3470
+ *
3471
+ * try {
3472
+ * const response = await responsePromise
3473
+ * } catch (error) {
3474
+ * if (error instanceof AxAIServiceAbortedError) {
3475
+ * console.log('Request was aborted:', error.message)
3476
+ * }
3477
+ * }
3478
+ * ```
3479
+ */
3480
+ declare class AxAbortableAI<TModel = unknown, TEmbedModel = unknown> {
3481
+ private abortController;
3482
+ private readonly ai;
3483
+ constructor(ai: AxAIService<TModel, TEmbedModel>);
3484
+ /**
3485
+ * Get the current abort signal
3486
+ */
3487
+ get signal(): AbortSignal;
3488
+ /**
3489
+ * Check if the request has been aborted
3490
+ */
3491
+ get aborted(): boolean;
3492
+ /**
3493
+ * Abort the ongoing request
3494
+ * @param reason Optional reason for the abort
3495
+ */
3496
+ abort(reason?: string): void;
3497
+ /**
3498
+ * Reset the abort controller to allow new requests
3499
+ * This creates a new AbortController, allowing fresh requests
3500
+ */
3501
+ reset(): void;
3502
+ /**
3503
+ * Send a chat request with abort support
3504
+ */
3505
+ chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<TModel, TEmbedModel>>): Promise<AxChatResponse | ReadableStream$1<AxChatResponse>>;
3506
+ /**
3507
+ * Send an embed request with abort support
3508
+ */
3509
+ embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceActionOptions<TModel, TEmbedModel>>): Promise<AxEmbedResponse>;
3510
+ /**
3511
+ * Create a timeout-based abort after specified milliseconds
3512
+ * @param timeoutMs Timeout in milliseconds
3513
+ * @param reason Optional reason for the timeout abort
3514
+ * @returns Timeout ID that can be cleared
3515
+ */
3516
+ abortAfter(timeoutMs: number, reason?: string): NodeJS.Timeout;
3517
+ /**
3518
+ * Add an event listener for abort events
3519
+ */
3520
+ onAbort(callback: (reason?: string) => void): void;
3521
+ }
3522
+
3431
3523
  declare class AxChainOfThought<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOut> extends AxGen<IN, OUT> {
3432
3524
  constructor(signature: Readonly<AxSignature | string>, options?: Readonly<AxGenOptions & {
3433
3525
  setVisibleReasoning?: boolean;
@@ -3714,4 +3806,4 @@ declare const axModelInfoReka: AxModelInfo[];
3714
3806
 
3715
3807
  declare const axModelInfoTogether: AxModelInfo[];
3716
3808
 
3717
- export { AxAI, AxAIAnthropic, type AxAIAnthropicArgs, type AxAIAnthropicChatError, type AxAIAnthropicChatRequest, type AxAIAnthropicChatRequestCacheParam, type AxAIAnthropicChatResponse, type AxAIAnthropicChatResponseDelta, type AxAIAnthropicConfig, type AxAIAnthropicContentBlockDeltaEvent, type AxAIAnthropicContentBlockStartEvent, type AxAIAnthropicContentBlockStopEvent, type AxAIAnthropicErrorEvent, type AxAIAnthropicMessageDeltaEvent, type AxAIAnthropicMessageStartEvent, type AxAIAnthropicMessageStopEvent, AxAIAnthropicModel, type AxAIAnthropicPingEvent, AxAIAnthropicVertexModel, type AxAIArgs, AxAIAzureOpenAI, type AxAIAzureOpenAIArgs, type AxAIAzureOpenAIConfig, AxAICohere, type AxAICohereArgs, type AxAICohereChatRequest, type AxAICohereChatRequestToolResults, type AxAICohereChatResponse, type AxAICohereChatResponseDelta, type AxAICohereChatResponseToolCalls, type AxAICohereConfig, AxAICohereEmbedModel, type AxAICohereEmbedRequest, type AxAICohereEmbedResponse, AxAICohereModel, AxAIDeepSeek, type AxAIDeepSeekArgs, AxAIDeepSeekModel, type AxAIEmbedModels, type AxAIFeatures, AxAIGoogleGemini, type AxAIGoogleGeminiArgs, type AxAIGoogleGeminiBatchEmbedRequest, type AxAIGoogleGeminiBatchEmbedResponse, type AxAIGoogleGeminiChatRequest, type AxAIGoogleGeminiChatResponse, type AxAIGoogleGeminiChatResponseDelta, type AxAIGoogleGeminiConfig, type AxAIGoogleGeminiContent, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiEmbedTypes, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiThinkingConfig, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, type AxAIGoogleGeminiToolGoogleSearchRetrieval, type AxAIGoogleVertexBatchEmbedRequest, type AxAIGoogleVertexBatchEmbedResponse, AxAIGrok, type AxAIGrokArgs, type AxAIGrokChatRequest, AxAIGrokEmbedModels, AxAIGrokModel, type AxAIGrokOptionsTools, type AxAIGrokSearchSource, AxAIGroq, type AxAIGroqArgs, AxAIGroqModel, AxAIHuggingFace, type AxAIHuggingFaceArgs, type AxAIHuggingFaceConfig, AxAIHuggingFaceModel, type AxAIHuggingFaceRequest, type AxAIHuggingFaceResponse, type AxAIInputModelList, type AxAIMemory, AxAIMistral, type AxAIMistralArgs, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, type AxAIModelListBase, type AxAIModels, AxAIOllama, type AxAIOllamaAIConfig, type AxAIOllamaArgs, AxAIOpenAI, type AxAIOpenAIArgs, AxAIOpenAIBase, type AxAIOpenAIBaseArgs, type AxAIOpenAIChatRequest, type AxAIOpenAIChatResponse, type AxAIOpenAIChatResponseDelta, type AxAIOpenAIConfig, AxAIOpenAIEmbedModel, type AxAIOpenAIEmbedRequest, type AxAIOpenAIEmbedResponse, type AxAIOpenAILogprob, AxAIOpenAIModel, type AxAIOpenAIResponseDelta, AxAIOpenAIResponses, type AxAIOpenAIResponsesArgs, AxAIOpenAIResponsesBase, type AxAIOpenAIResponsesCodeInterpreterToolCall, type AxAIOpenAIResponsesComputerToolCall, type AxAIOpenAIResponsesConfig, type AxAIOpenAIResponsesContentPartAddedEvent, type AxAIOpenAIResponsesContentPartDoneEvent, type AxAIOpenAIResponsesDefineFunctionTool, type AxAIOpenAIResponsesErrorEvent, type AxAIOpenAIResponsesFileSearchCallCompletedEvent, type AxAIOpenAIResponsesFileSearchCallInProgressEvent, type AxAIOpenAIResponsesFileSearchCallSearchingEvent, type AxAIOpenAIResponsesFileSearchToolCall, type AxAIOpenAIResponsesFunctionCallArgumentsDeltaEvent, type AxAIOpenAIResponsesFunctionCallArgumentsDoneEvent, type AxAIOpenAIResponsesFunctionCallItem, type AxAIOpenAIResponsesImageGenerationCallCompletedEvent, type AxAIOpenAIResponsesImageGenerationCallGeneratingEvent, type AxAIOpenAIResponsesImageGenerationCallInProgressEvent, type AxAIOpenAIResponsesImageGenerationCallPartialImageEvent, type AxAIOpenAIResponsesImageGenerationToolCall, AxAIOpenAIResponsesImpl, type AxAIOpenAIResponsesInputAudioContentPart, type AxAIOpenAIResponsesInputContentPart, type AxAIOpenAIResponsesInputFunctionCallItem, type AxAIOpenAIResponsesInputFunctionCallOutputItem, type AxAIOpenAIResponsesInputImageUrlContentPart, type AxAIOpenAIResponsesInputItem, type AxAIOpenAIResponsesInputMessageItem, type AxAIOpenAIResponsesInputTextContentPart, type AxAIOpenAIResponsesLocalShellToolCall, type AxAIOpenAIResponsesMCPCallArgumentsDeltaEvent, type AxAIOpenAIResponsesMCPCallArgumentsDoneEvent, type AxAIOpenAIResponsesMCPCallCompletedEvent, type AxAIOpenAIResponsesMCPCallFailedEvent, type AxAIOpenAIResponsesMCPCallInProgressEvent, type AxAIOpenAIResponsesMCPListToolsCompletedEvent, type AxAIOpenAIResponsesMCPListToolsFailedEvent, type AxAIOpenAIResponsesMCPListToolsInProgressEvent, type AxAIOpenAIResponsesMCPToolCall, type AxAIOpenAIResponsesOutputItem, type AxAIOpenAIResponsesOutputItemAddedEvent, type AxAIOpenAIResponsesOutputItemDoneEvent, type AxAIOpenAIResponsesOutputMessageItem, type AxAIOpenAIResponsesOutputRefusalContentPart, type AxAIOpenAIResponsesOutputTextAnnotationAddedEvent, type AxAIOpenAIResponsesOutputTextContentPart, type AxAIOpenAIResponsesOutputTextDeltaEvent, type AxAIOpenAIResponsesOutputTextDoneEvent, type AxAIOpenAIResponsesReasoningDeltaEvent, type AxAIOpenAIResponsesReasoningDoneEvent, type AxAIOpenAIResponsesReasoningItem, type AxAIOpenAIResponsesReasoningSummaryDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryDoneEvent, type AxAIOpenAIResponsesReasoningSummaryPart, type AxAIOpenAIResponsesReasoningSummaryPartAddedEvent, type AxAIOpenAIResponsesReasoningSummaryPartDoneEvent, type AxAIOpenAIResponsesReasoningSummaryTextDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryTextDoneEvent, type AxAIOpenAIResponsesRefusalDeltaEvent, type AxAIOpenAIResponsesRefusalDoneEvent, type AxAIOpenAIResponsesRequest, type AxAIOpenAIResponsesResponse, type AxAIOpenAIResponsesResponseCompletedEvent, type AxAIOpenAIResponsesResponseCreatedEvent, type AxAIOpenAIResponsesResponseDelta, type AxAIOpenAIResponsesResponseFailedEvent, type AxAIOpenAIResponsesResponseInProgressEvent, type AxAIOpenAIResponsesResponseIncompleteEvent, type AxAIOpenAIResponsesResponseQueuedEvent, type AxAIOpenAIResponsesStreamEvent, type AxAIOpenAIResponsesStreamEventBase, type AxAIOpenAIResponsesToolCall, type AxAIOpenAIResponsesToolCallBase, type AxAIOpenAIResponsesToolChoice, type AxAIOpenAIResponsesToolDefinition, type AxAIOpenAIResponsesWebSearchCallCompletedEvent, type AxAIOpenAIResponsesWebSearchCallInProgressEvent, type AxAIOpenAIResponsesWebSearchCallSearchingEvent, type AxAIOpenAIResponsesWebSearchToolCall, type AxAIOpenAIUsage, type AxAIPromptConfig, AxAIReka, type AxAIRekaArgs, type AxAIRekaChatRequest, type AxAIRekaChatResponse, type AxAIRekaChatResponseDelta, type AxAIRekaConfig, AxAIRekaModel, type AxAIRekaUsage, type AxAIService, type AxAIServiceActionOptions, AxAIServiceAuthenticationError, AxAIServiceError, type AxAIServiceImpl, type AxAIServiceMetrics, AxAIServiceNetworkError, type AxAIServiceOptions, AxAIServiceResponseError, AxAIServiceStatusError, AxAIServiceStreamTerminatedError, AxAIServiceTimeoutError, AxAITogether, type AxAITogetherArgs, type AxAPI, type AxAPIConfig, AxAgent, type AxAgentFeatures, type AxAgentOptions, type AxAgentic, AxApacheTika, type AxApacheTikaArgs, type AxApacheTikaConvertOptions, type AxAssertion, AxAssertionError, AxBalancer, type AxBalancerOptions, AxBaseAI, type AxBaseAIArgs, AxBootstrapFewShot, AxChainOfThought, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, AxDB, type AxDBArgs, AxDBBase, type AxDBBaseArgs, type AxDBBaseOpOptions, AxDBCloudflare, type AxDBCloudflareArgs, type AxDBCloudflareOpOptions, type AxDBLoaderOptions, AxDBManager, type AxDBManagerArgs, type AxDBMatch, AxDBMemory, type AxDBMemoryArgs, type AxDBMemoryOpOptions, AxDBPinecone, type AxDBPineconeArgs, type AxDBPineconeOpOptions, type AxDBQueryRequest, type AxDBQueryResponse, type AxDBQueryService, type AxDBService, type AxDBState, type AxDBUpsertRequest, type AxDBUpsertResponse, AxDBWeaviate, type AxDBWeaviateArgs, type AxDBWeaviateOpOptions, type AxDataRow, AxDefaultQueryRewriter, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, AxEvalUtil, type AxEvaluateArgs, type AxExample, type AxField, type AxFieldProcessor, type AxFieldProcessorProcess, type AxFieldTemplateFn, type AxFieldValue, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenOptions, type AxGenOut, type AxGenStreamingOut, AxGenerateError, type AxGenerateErrorDetails, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSInterpreter, AxJSInterpreterPermission, AxLLMRequestTypeValues, AxMCPClient, AxMCPHTTPSSETransport, AxMCPStdioTransport, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPTransport, AxMemory, type AxMessage, type AxMetricFn, type AxMetricFnArgs, AxMiPRO, type AxMiPROOptions, AxMockAIService, type AxMockAIServiceConfig, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxModelUsage, AxMultiServiceRouter, type AxOptimizationStats, type AxOptimizerArgs, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramStreamingForwardOptions, type AxProgramTrace, type AxProgramUsage, AxProgramWithSignature, type AxProgramWithSignatureOptions, AxPromptTemplate, type AxPromptTemplateOptions, AxRAG, type AxRateLimiterFunction, AxRateLimiterTokenUsage, type AxRateLimiterTokenUsageOptions, type AxRerankerIn, type AxRerankerOut, type AxResponseHandlerArgs, type AxRewriteIn, type AxRewriteOut, AxSignature, AxSimpleClassifier, AxSimpleClassifierClass, type AxSimpleClassifierForwardOptions, AxSpanKindValues, type AxStreamingAssertion, type AxStreamingEvent, type AxStreamingFieldProcessorProcess, AxStringUtil, AxTestPrompt, type AxTokenUsage, type AxTunable, type AxUsable, axAIAnthropicDefaultConfig, axAIAnthropicVertexDefaultConfig, axAIAzureOpenAIBestConfig, axAIAzureOpenAICreativeConfig, axAIAzureOpenAIDefaultConfig, axAIAzureOpenAIFastConfig, axAICohereCreativeConfig, axAICohereDefaultConfig, axAIDeepSeekCodeConfig, axAIDeepSeekDefaultConfig, axAIGoogleGeminiDefaultConfig, axAIGoogleGeminiDefaultCreativeConfig, axAIGrokBestConfig, axAIGrokDefaultConfig, axAIHuggingFaceCreativeConfig, axAIHuggingFaceDefaultConfig, axAIMistralBestConfig, axAIMistralDefaultConfig, axAIOllamaDefaultConfig, axAIOllamaDefaultCreativeConfig, axAIOpenAIBestConfig, axAIOpenAICreativeConfig, axAIOpenAIDefaultConfig, axAIOpenAIFastConfig, axAIOpenAIResponsesBestConfig, axAIOpenAIResponsesCreativeConfig, axAIOpenAIResponsesDefaultConfig, axAIRekaBestConfig, axAIRekaCreativeConfig, axAIRekaDefaultConfig, axAIRekaFastConfig, axAITogetherDefaultConfig, axBaseAIDefaultConfig, axBaseAIDefaultCreativeConfig, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoReka, axModelInfoTogether, axSpanAttributes, axSpanEvents };
3809
+ export { AxAI, AxAIAnthropic, type AxAIAnthropicArgs, type AxAIAnthropicChatError, type AxAIAnthropicChatRequest, type AxAIAnthropicChatRequestCacheParam, type AxAIAnthropicChatResponse, type AxAIAnthropicChatResponseDelta, type AxAIAnthropicConfig, type AxAIAnthropicContentBlockDeltaEvent, type AxAIAnthropicContentBlockStartEvent, type AxAIAnthropicContentBlockStopEvent, type AxAIAnthropicErrorEvent, type AxAIAnthropicMessageDeltaEvent, type AxAIAnthropicMessageStartEvent, type AxAIAnthropicMessageStopEvent, AxAIAnthropicModel, type AxAIAnthropicPingEvent, AxAIAnthropicVertexModel, type AxAIArgs, AxAIAzureOpenAI, type AxAIAzureOpenAIArgs, type AxAIAzureOpenAIConfig, AxAICohere, type AxAICohereArgs, type AxAICohereChatRequest, type AxAICohereChatRequestToolResults, type AxAICohereChatResponse, type AxAICohereChatResponseDelta, type AxAICohereChatResponseToolCalls, type AxAICohereConfig, AxAICohereEmbedModel, type AxAICohereEmbedRequest, type AxAICohereEmbedResponse, AxAICohereModel, AxAIDeepSeek, type AxAIDeepSeekArgs, AxAIDeepSeekModel, type AxAIEmbedModels, type AxAIFeatures, AxAIGoogleGemini, type AxAIGoogleGeminiArgs, type AxAIGoogleGeminiBatchEmbedRequest, type AxAIGoogleGeminiBatchEmbedResponse, type AxAIGoogleGeminiChatRequest, type AxAIGoogleGeminiChatResponse, type AxAIGoogleGeminiChatResponseDelta, type AxAIGoogleGeminiConfig, type AxAIGoogleGeminiContent, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiEmbedTypes, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiThinkingConfig, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, type AxAIGoogleGeminiToolGoogleSearchRetrieval, type AxAIGoogleVertexBatchEmbedRequest, type AxAIGoogleVertexBatchEmbedResponse, AxAIGrok, type AxAIGrokArgs, type AxAIGrokChatRequest, AxAIGrokEmbedModels, AxAIGrokModel, type AxAIGrokOptionsTools, type AxAIGrokSearchSource, AxAIGroq, type AxAIGroqArgs, AxAIGroqModel, AxAIHuggingFace, type AxAIHuggingFaceArgs, type AxAIHuggingFaceConfig, AxAIHuggingFaceModel, type AxAIHuggingFaceRequest, type AxAIHuggingFaceResponse, type AxAIInputModelList, type AxAIMemory, AxAIMistral, type AxAIMistralArgs, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, type AxAIModelListBase, type AxAIModels, AxAIOllama, type AxAIOllamaAIConfig, type AxAIOllamaArgs, AxAIOpenAI, type AxAIOpenAIArgs, AxAIOpenAIBase, type AxAIOpenAIBaseArgs, type AxAIOpenAIChatRequest, type AxAIOpenAIChatResponse, type AxAIOpenAIChatResponseDelta, type AxAIOpenAIConfig, AxAIOpenAIEmbedModel, type AxAIOpenAIEmbedRequest, type AxAIOpenAIEmbedResponse, type AxAIOpenAILogprob, AxAIOpenAIModel, type AxAIOpenAIResponseDelta, AxAIOpenAIResponses, type AxAIOpenAIResponsesArgs, AxAIOpenAIResponsesBase, type AxAIOpenAIResponsesCodeInterpreterToolCall, type AxAIOpenAIResponsesComputerToolCall, type AxAIOpenAIResponsesConfig, type AxAIOpenAIResponsesContentPartAddedEvent, type AxAIOpenAIResponsesContentPartDoneEvent, type AxAIOpenAIResponsesDefineFunctionTool, type AxAIOpenAIResponsesErrorEvent, type AxAIOpenAIResponsesFileSearchCallCompletedEvent, type AxAIOpenAIResponsesFileSearchCallInProgressEvent, type AxAIOpenAIResponsesFileSearchCallSearchingEvent, type AxAIOpenAIResponsesFileSearchToolCall, type AxAIOpenAIResponsesFunctionCallArgumentsDeltaEvent, type AxAIOpenAIResponsesFunctionCallArgumentsDoneEvent, type AxAIOpenAIResponsesFunctionCallItem, type AxAIOpenAIResponsesImageGenerationCallCompletedEvent, type AxAIOpenAIResponsesImageGenerationCallGeneratingEvent, type AxAIOpenAIResponsesImageGenerationCallInProgressEvent, type AxAIOpenAIResponsesImageGenerationCallPartialImageEvent, type AxAIOpenAIResponsesImageGenerationToolCall, AxAIOpenAIResponsesImpl, type AxAIOpenAIResponsesInputAudioContentPart, type AxAIOpenAIResponsesInputContentPart, type AxAIOpenAIResponsesInputFunctionCallItem, type AxAIOpenAIResponsesInputFunctionCallOutputItem, type AxAIOpenAIResponsesInputImageUrlContentPart, type AxAIOpenAIResponsesInputItem, type AxAIOpenAIResponsesInputMessageItem, type AxAIOpenAIResponsesInputTextContentPart, type AxAIOpenAIResponsesLocalShellToolCall, type AxAIOpenAIResponsesMCPCallArgumentsDeltaEvent, type AxAIOpenAIResponsesMCPCallArgumentsDoneEvent, type AxAIOpenAIResponsesMCPCallCompletedEvent, type AxAIOpenAIResponsesMCPCallFailedEvent, type AxAIOpenAIResponsesMCPCallInProgressEvent, type AxAIOpenAIResponsesMCPListToolsCompletedEvent, type AxAIOpenAIResponsesMCPListToolsFailedEvent, type AxAIOpenAIResponsesMCPListToolsInProgressEvent, type AxAIOpenAIResponsesMCPToolCall, type AxAIOpenAIResponsesOutputItem, type AxAIOpenAIResponsesOutputItemAddedEvent, type AxAIOpenAIResponsesOutputItemDoneEvent, type AxAIOpenAIResponsesOutputMessageItem, type AxAIOpenAIResponsesOutputRefusalContentPart, type AxAIOpenAIResponsesOutputTextAnnotationAddedEvent, type AxAIOpenAIResponsesOutputTextContentPart, type AxAIOpenAIResponsesOutputTextDeltaEvent, type AxAIOpenAIResponsesOutputTextDoneEvent, type AxAIOpenAIResponsesReasoningDeltaEvent, type AxAIOpenAIResponsesReasoningDoneEvent, type AxAIOpenAIResponsesReasoningItem, type AxAIOpenAIResponsesReasoningSummaryDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryDoneEvent, type AxAIOpenAIResponsesReasoningSummaryPart, type AxAIOpenAIResponsesReasoningSummaryPartAddedEvent, type AxAIOpenAIResponsesReasoningSummaryPartDoneEvent, type AxAIOpenAIResponsesReasoningSummaryTextDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryTextDoneEvent, type AxAIOpenAIResponsesRefusalDeltaEvent, type AxAIOpenAIResponsesRefusalDoneEvent, type AxAIOpenAIResponsesRequest, type AxAIOpenAIResponsesResponse, type AxAIOpenAIResponsesResponseCompletedEvent, type AxAIOpenAIResponsesResponseCreatedEvent, type AxAIOpenAIResponsesResponseDelta, type AxAIOpenAIResponsesResponseFailedEvent, type AxAIOpenAIResponsesResponseInProgressEvent, type AxAIOpenAIResponsesResponseIncompleteEvent, type AxAIOpenAIResponsesResponseQueuedEvent, type AxAIOpenAIResponsesStreamEvent, type AxAIOpenAIResponsesStreamEventBase, type AxAIOpenAIResponsesToolCall, type AxAIOpenAIResponsesToolCallBase, type AxAIOpenAIResponsesToolChoice, type AxAIOpenAIResponsesToolDefinition, type AxAIOpenAIResponsesWebSearchCallCompletedEvent, type AxAIOpenAIResponsesWebSearchCallInProgressEvent, type AxAIOpenAIResponsesWebSearchCallSearchingEvent, type AxAIOpenAIResponsesWebSearchToolCall, type AxAIOpenAIUsage, type AxAIPromptConfig, AxAIReka, type AxAIRekaArgs, type AxAIRekaChatRequest, type AxAIRekaChatResponse, type AxAIRekaChatResponseDelta, type AxAIRekaConfig, AxAIRekaModel, type AxAIRekaUsage, type AxAIService, AxAIServiceAbortedError, type AxAIServiceActionOptions, AxAIServiceAuthenticationError, AxAIServiceError, type AxAIServiceImpl, type AxAIServiceMetrics, AxAIServiceNetworkError, type AxAIServiceOptions, AxAIServiceResponseError, AxAIServiceStatusError, AxAIServiceStreamTerminatedError, AxAIServiceTimeoutError, AxAITogether, type AxAITogetherArgs, type AxAPI, type AxAPIConfig, AxAbortableAI, AxAgent, type AxAgentFeatures, type AxAgentOptions, type AxAgentic, AxApacheTika, type AxApacheTikaArgs, type AxApacheTikaConvertOptions, type AxAssertion, AxAssertionError, AxBalancer, type AxBalancerOptions, AxBaseAI, type AxBaseAIArgs, AxBootstrapFewShot, AxChainOfThought, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, AxDB, type AxDBArgs, AxDBBase, type AxDBBaseArgs, type AxDBBaseOpOptions, AxDBCloudflare, type AxDBCloudflareArgs, type AxDBCloudflareOpOptions, type AxDBLoaderOptions, AxDBManager, type AxDBManagerArgs, type AxDBMatch, AxDBMemory, type AxDBMemoryArgs, type AxDBMemoryOpOptions, AxDBPinecone, type AxDBPineconeArgs, type AxDBPineconeOpOptions, type AxDBQueryRequest, type AxDBQueryResponse, type AxDBQueryService, type AxDBService, type AxDBState, type AxDBUpsertRequest, type AxDBUpsertResponse, AxDBWeaviate, type AxDBWeaviateArgs, type AxDBWeaviateOpOptions, type AxDataRow, AxDefaultQueryRewriter, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, AxEvalUtil, type AxEvaluateArgs, type AxExample, type AxField, type AxFieldProcessor, type AxFieldProcessorProcess, type AxFieldTemplateFn, type AxFieldValue, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenOptions, type AxGenOut, type AxGenStreamingOut, AxGenerateError, type AxGenerateErrorDetails, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSInterpreter, AxJSInterpreterPermission, AxLLMRequestTypeValues, AxMCPClient, AxMCPHTTPSSETransport, AxMCPStdioTransport, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPTransport, AxMemory, type AxMessage, type AxMetricFn, type AxMetricFnArgs, AxMiPRO, type AxMiPROOptions, AxMockAIService, type AxMockAIServiceConfig, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxModelUsage, AxMultiServiceRouter, type AxOptimizationStats, type AxOptimizerArgs, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramStreamingForwardOptions, type AxProgramTrace, type AxProgramUsage, AxProgramWithSignature, type AxProgramWithSignatureOptions, AxPromptTemplate, type AxPromptTemplateOptions, AxRAG, type AxRateLimiterFunction, AxRateLimiterTokenUsage, type AxRateLimiterTokenUsageOptions, type AxRerankerIn, type AxRerankerOut, type AxResponseHandlerArgs, type AxRewriteIn, type AxRewriteOut, type AxSetExamplesOptions, AxSignature, AxSimpleClassifier, AxSimpleClassifierClass, type AxSimpleClassifierForwardOptions, AxSpanKindValues, type AxStreamingAssertion, type AxStreamingEvent, type AxStreamingFieldProcessorProcess, AxStringUtil, AxTestPrompt, type AxTokenUsage, type AxTunable, type AxUsable, axAIAnthropicDefaultConfig, axAIAnthropicVertexDefaultConfig, axAIAzureOpenAIBestConfig, axAIAzureOpenAICreativeConfig, axAIAzureOpenAIDefaultConfig, axAIAzureOpenAIFastConfig, axAICohereCreativeConfig, axAICohereDefaultConfig, axAIDeepSeekCodeConfig, axAIDeepSeekDefaultConfig, axAIGoogleGeminiDefaultConfig, axAIGoogleGeminiDefaultCreativeConfig, axAIGrokBestConfig, axAIGrokDefaultConfig, axAIHuggingFaceCreativeConfig, axAIHuggingFaceDefaultConfig, axAIMistralBestConfig, axAIMistralDefaultConfig, axAIOllamaDefaultConfig, axAIOllamaDefaultCreativeConfig, axAIOpenAIBestConfig, axAIOpenAICreativeConfig, axAIOpenAIDefaultConfig, axAIOpenAIFastConfig, axAIOpenAIResponsesBestConfig, axAIOpenAIResponsesCreativeConfig, axAIOpenAIResponsesDefaultConfig, axAIRekaBestConfig, axAIRekaCreativeConfig, axAIRekaDefaultConfig, axAIRekaFastConfig, axAITogetherDefaultConfig, axBaseAIDefaultConfig, axBaseAIDefaultCreativeConfig, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoReka, axModelInfoTogether, axSpanAttributes, axSpanEvents };