@ax-llm/ax 12.0.19 → 12.0.21

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
@@ -1,5 +1,5 @@
1
1
  import { ReadableStream as ReadableStream$1 } from 'node:stream/web';
2
- import { Span, Context, Tracer } from '@opentelemetry/api';
2
+ import { Span, Context, Tracer, Meter, Histogram, Counter, Gauge } from '@opentelemetry/api';
3
3
  import { ReadableStream } from 'stream/web';
4
4
 
5
5
  interface RetryConfig {
@@ -103,6 +103,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
103
103
  private rt?;
104
104
  private fetch?;
105
105
  private tracer?;
106
+ private meter?;
106
107
  private timeout?;
107
108
  private excludeContentFromTrace?;
108
109
  private models?;
@@ -122,6 +123,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
122
123
  protected supportFor: AxAIFeatures | ((model: TModel) => AxAIFeatures);
123
124
  private metrics;
124
125
  constructor(aiImpl: Readonly<AxAIServiceImpl<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse>>, { name, apiURL, headers, modelInfo, defaults, options, supportFor, models, }: Readonly<AxBaseAIArgs<TModel, TEmbedModel>>);
126
+ private getMetricsInstruments;
125
127
  setName(name: string): void;
126
128
  getId(): string;
127
129
  setAPIURL(apiURL: string): void;
@@ -138,6 +140,19 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
138
140
  private calculatePercentile;
139
141
  private updateLatencyMetrics;
140
142
  private updateErrorMetrics;
143
+ private recordTokenUsage;
144
+ private calculateRequestSize;
145
+ private calculateResponseSize;
146
+ private detectMultimodalContent;
147
+ private calculatePromptLength;
148
+ private calculateContextWindowUsage;
149
+ private estimateCost;
150
+ private estimateCostByName;
151
+ private recordFunctionCallMetrics;
152
+ private recordTimeoutMetric;
153
+ private recordAbortMetric;
154
+ private recordChatMetrics;
155
+ private recordEmbedMetrics;
141
156
  getMetrics(): AxAIServiceMetrics;
142
157
  chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<TModel, TEmbedModel>>): Promise<AxChatResponse | ReadableStream<AxChatResponse>>;
143
158
  private _chat1;
@@ -179,6 +194,7 @@ type AxModelInfo = {
179
194
  hasShowThoughts?: boolean;
180
195
  maxTokens?: number;
181
196
  isExpensive?: boolean;
197
+ contextWindow?: number;
182
198
  };
183
199
  type AxTokenUsage = {
184
200
  promptTokens: number;
@@ -378,6 +394,7 @@ type AxAIServiceOptions = {
378
394
  rateLimiter?: AxRateLimiterFunction;
379
395
  fetch?: typeof fetch;
380
396
  tracer?: Tracer;
397
+ meter?: Meter;
381
398
  timeout?: number;
382
399
  excludeContentFromTrace?: boolean;
383
400
  abortSignal?: AbortSignal;
@@ -2824,6 +2841,50 @@ interface AxOptimizationStats {
2824
2841
  standardDeviation?: number;
2825
2842
  };
2826
2843
  }
2844
+ interface AxOptimizerMetricsConfig {
2845
+ enabled: boolean;
2846
+ enabledCategories: ('optimization' | 'convergence' | 'resource_usage' | 'teacher_student' | 'checkpointing' | 'pareto')[];
2847
+ maxLabelLength: number;
2848
+ samplingRate: number;
2849
+ }
2850
+ declare const axDefaultOptimizerMetricsConfig: AxOptimizerMetricsConfig;
2851
+ interface AxOptimizerMetricsInstruments {
2852
+ optimizationLatencyHistogram?: Histogram;
2853
+ optimizationRequestsCounter?: Counter;
2854
+ optimizationErrorsCounter?: Counter;
2855
+ convergenceRoundsHistogram?: Histogram;
2856
+ convergenceScoreGauge?: Gauge;
2857
+ convergenceImprovementGauge?: Gauge;
2858
+ stagnationRoundsGauge?: Gauge;
2859
+ earlyStoppingCounter?: Counter;
2860
+ tokenUsageCounter?: Counter;
2861
+ costUsageCounter?: Counter;
2862
+ memoryUsageGauge?: Gauge;
2863
+ optimizationDurationHistogram?: Histogram;
2864
+ teacherStudentUsageCounter?: Counter;
2865
+ teacherStudentLatencyHistogram?: Histogram;
2866
+ teacherStudentScoreImprovementGauge?: Gauge;
2867
+ checkpointSaveCounter?: Counter;
2868
+ checkpointLoadCounter?: Counter;
2869
+ checkpointSaveLatencyHistogram?: Histogram;
2870
+ checkpointLoadLatencyHistogram?: Histogram;
2871
+ paretoOptimizationsCounter?: Counter;
2872
+ paretoFrontSizeHistogram?: Histogram;
2873
+ paretoHypervolumeGauge?: Gauge;
2874
+ paretoSolutionsGeneratedHistogram?: Histogram;
2875
+ programInputFieldsGauge?: Gauge;
2876
+ programOutputFieldsGauge?: Gauge;
2877
+ examplesCountGauge?: Gauge;
2878
+ validationSetSizeGauge?: Gauge;
2879
+ evaluationLatencyHistogram?: Histogram;
2880
+ demoGenerationLatencyHistogram?: Histogram;
2881
+ metricComputationLatencyHistogram?: Histogram;
2882
+ optimizerTypeGauge?: Gauge;
2883
+ targetScoreGauge?: Gauge;
2884
+ maxRoundsGauge?: Gauge;
2885
+ }
2886
+ declare const axUpdateOptimizerMetricsConfig: (config: Readonly<Partial<AxOptimizerMetricsConfig>>) => void;
2887
+ declare const axGetOptimizerMetricsConfig: () => AxOptimizerMetricsConfig;
2827
2888
  interface AxOptimizerResult<OUT extends AxGenOut> {
2828
2889
  demos?: AxProgramDemos<AxGenIn, OUT>[];
2829
2890
  stats: AxOptimizationStats;
@@ -3011,6 +3072,7 @@ declare abstract class AxBaseOptimizer<IN extends AxGenIn = AxGenIn, OUT extends
3011
3072
  private scoreHistory;
3012
3073
  private configurationHistory;
3013
3074
  protected stats: AxOptimizationStats;
3075
+ protected readonly metricsInstruments?: AxOptimizerMetricsInstruments;
3014
3076
  constructor(args: Readonly<AxOptimizerArgs>);
3015
3077
  /**
3016
3078
  * Initialize the optimization statistics structure
@@ -3162,6 +3224,38 @@ declare abstract class AxBaseOptimizer<IN extends AxGenIn = AxGenIn, OUT extends
3162
3224
  * Check if logging is enabled based on verbose settings
3163
3225
  */
3164
3226
  protected isLoggingEnabled(options?: AxCompileOptions): boolean;
3227
+ /**
3228
+ * Record optimization start metrics
3229
+ */
3230
+ protected recordOptimizationStart(optimizerType: string, programSignature?: string): void;
3231
+ /**
3232
+ * Record optimization completion metrics
3233
+ */
3234
+ protected recordOptimizationComplete(duration: number, success: boolean, optimizerType: string, programSignature?: string): void;
3235
+ /**
3236
+ * Record convergence metrics
3237
+ */
3238
+ protected recordConvergenceMetrics(rounds: number, currentScore: number, improvement: number, stagnationRounds: number, optimizerType: string): void;
3239
+ /**
3240
+ * Record early stopping metrics
3241
+ */
3242
+ protected recordEarlyStoppingMetrics(reason: string, optimizerType: string): void;
3243
+ /**
3244
+ * Record teacher-student interaction metrics
3245
+ */
3246
+ protected recordTeacherStudentMetrics(latency: number, scoreImprovement: number, optimizerType: string): void;
3247
+ /**
3248
+ * Record checkpoint metrics
3249
+ */
3250
+ protected recordCheckpointMetrics(operation: 'save' | 'load', latency: number, success: boolean, optimizerType: string): void;
3251
+ /**
3252
+ * Record Pareto optimization metrics
3253
+ */
3254
+ protected recordParetoMetrics(frontSize: number, solutionsGenerated: number, optimizerType: string, hypervolume?: number): void;
3255
+ /**
3256
+ * Record performance metrics
3257
+ */
3258
+ protected recordPerformanceMetrics(metricType: 'evaluation' | 'demo_generation' | 'metric_computation', duration: number, optimizerType: string): void;
3165
3259
  }
3166
3260
 
3167
3261
  type AxDBUpsertRequest = {
@@ -3510,6 +3604,9 @@ declare class AxGen<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOu
3510
3604
  private excludeContentFromTrace;
3511
3605
  private thoughtFieldName;
3512
3606
  constructor(signature: NonNullable<ConstructorParameters<typeof AxSignature>[0]>, options?: Readonly<AxProgramForwardOptions>);
3607
+ private getSignatureName;
3608
+ private getMetricsInstruments;
3609
+ updateMeter(meter?: Meter): void;
3513
3610
  private createStates;
3514
3611
  addAssert: (fn: AxAssertion["fn"], message?: string) => void;
3515
3612
  addStreamingAssert: (fieldName: string, fn: AxStreamingAssertion["fn"], message?: string) => void;
@@ -4352,6 +4449,56 @@ declare const f: {
4352
4449
  };
4353
4450
  };
4354
4451
 
4452
+ interface AxMetricsConfig {
4453
+ enabled: boolean;
4454
+ enabledCategories: ('generation' | 'streaming' | 'functions' | 'errors' | 'performance')[];
4455
+ maxLabelLength: number;
4456
+ samplingRate: number;
4457
+ }
4458
+ declare const axDefaultMetricsConfig: AxMetricsConfig;
4459
+ type AxErrorCategory = 'validation_error' | 'assertion_error' | 'timeout_error' | 'abort_error' | 'network_error' | 'auth_error' | 'rate_limit_error' | 'function_error' | 'parsing_error' | 'unknown_error';
4460
+ interface AxGenMetricsInstruments {
4461
+ generationLatencyHistogram?: Histogram;
4462
+ generationRequestsCounter?: Counter;
4463
+ generationErrorsCounter?: Counter;
4464
+ multiStepGenerationsCounter?: Counter;
4465
+ stepsPerGenerationHistogram?: Histogram;
4466
+ maxStepsReachedCounter?: Counter;
4467
+ validationErrorsCounter?: Counter;
4468
+ assertionErrorsCounter?: Counter;
4469
+ errorCorrectionAttemptsHistogram?: Histogram;
4470
+ errorCorrectionSuccessCounter?: Counter;
4471
+ errorCorrectionFailureCounter?: Counter;
4472
+ maxRetriesReachedCounter?: Counter;
4473
+ functionsEnabledGenerationsCounter?: Counter;
4474
+ functionCallStepsCounter?: Counter;
4475
+ functionsExecutedPerGenerationHistogram?: Histogram;
4476
+ functionErrorCorrectionCounter?: Counter;
4477
+ fieldProcessorsExecutedCounter?: Counter;
4478
+ streamingFieldProcessorsExecutedCounter?: Counter;
4479
+ streamingGenerationsCounter?: Counter;
4480
+ streamingDeltasEmittedCounter?: Counter;
4481
+ streamingFinalizationLatencyHistogram?: Histogram;
4482
+ samplesGeneratedHistogram?: Histogram;
4483
+ resultPickerUsageCounter?: Counter;
4484
+ resultPickerLatencyHistogram?: Histogram;
4485
+ inputFieldsGauge?: Gauge;
4486
+ outputFieldsGauge?: Gauge;
4487
+ examplesUsedGauge?: Gauge;
4488
+ demosUsedGauge?: Gauge;
4489
+ promptRenderLatencyHistogram?: Histogram;
4490
+ extractionLatencyHistogram?: Histogram;
4491
+ assertionLatencyHistogram?: Histogram;
4492
+ stateCreationLatencyHistogram?: Histogram;
4493
+ memoryUpdateLatencyHistogram?: Histogram;
4494
+ }
4495
+ declare const axCheckMetricsHealth: () => {
4496
+ healthy: boolean;
4497
+ issues: string[];
4498
+ };
4499
+ declare const axUpdateMetricsConfig: (config: Readonly<Partial<AxMetricsConfig>>) => void;
4500
+ declare const axGetMetricsConfig: () => AxMetricsConfig;
4501
+
4355
4502
  declare const axCreateDefaultLogger: (output?: (message: string) => void) => AxLoggerFunction;
4356
4503
  declare const axCreateDefaultTextLogger: (output?: (message: string) => void) => AxLoggerFunction;
4357
4504
  /**
@@ -4687,6 +4834,8 @@ declare const AxStringUtil: {
4687
4834
 
4688
4835
  declare const axGlobals: {
4689
4836
  signatureStrict: boolean;
4837
+ tracer: Tracer | undefined;
4838
+ meter: Meter | undefined;
4690
4839
  };
4691
4840
 
4692
4841
  declare const axModelInfoAnthropic: AxModelInfo[];
@@ -4721,8 +4870,35 @@ declare const axModelInfoReka: AxModelInfo[];
4721
4870
 
4722
4871
  declare const axModelInfoTogether: AxModelInfo[];
4723
4872
 
4873
+ interface AxAIMetricsInstruments {
4874
+ latencyHistogram?: Histogram;
4875
+ errorCounter?: Counter;
4876
+ requestCounter?: Counter;
4877
+ tokenCounter?: Counter;
4878
+ inputTokenCounter?: Counter;
4879
+ outputTokenCounter?: Counter;
4880
+ errorRateGauge?: Gauge;
4881
+ meanLatencyGauge?: Gauge;
4882
+ p95LatencyGauge?: Gauge;
4883
+ p99LatencyGauge?: Gauge;
4884
+ streamingRequestsCounter?: Counter;
4885
+ functionCallsCounter?: Counter;
4886
+ functionCallLatencyHistogram?: Histogram;
4887
+ requestSizeHistogram?: Histogram;
4888
+ responseSizeHistogram?: Histogram;
4889
+ temperatureGauge?: Gauge;
4890
+ maxTokensGauge?: Gauge;
4891
+ estimatedCostCounter?: Counter;
4892
+ promptLengthHistogram?: Histogram;
4893
+ contextWindowUsageGauge?: Gauge;
4894
+ timeoutsCounter?: Counter;
4895
+ abortsCounter?: Counter;
4896
+ thinkingBudgetUsageCounter?: Counter;
4897
+ multimodalRequestsCounter?: Counter;
4898
+ }
4899
+
4724
4900
  interface AxSamplePickerOptions<OUT extends AxGenOut> {
4725
4901
  resultPicker?: AxResultPickerFunction<OUT>;
4726
4902
  }
4727
4903
 
4728
- 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, type AxAIAnthropicThinkingConfig, type AxAIAnthropicThinkingTokenBudgetLevels, 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, type AxAIGoogleGeminiContentPart, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiEmbedTypes, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiThinkingConfig, type AxAIGoogleGeminiThinkingTokenBudgetLevels, 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, type AxAIMistralChatRequest, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, type AxAIModelListBase, type AxAIModels, AxAIOllama, type AxAIOllamaAIConfig, type AxAIOllamaArgs, AxAIOpenAI, type AxAIOpenAIAnnotation, 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, AxAIOpenAIResponsesModel, 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 AxAIOpenAIUrlCitation, type AxAIOpenAIUsage, type AxAIPromptConfig, AxAIRefusalError, 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, AxAgent, type AxAgentFeatures, type AxAgentOptions, type AxAgentic, AxApacheTika, type AxApacheTikaArgs, type AxApacheTikaConvertOptions, type AxAssertion, AxAssertionError, AxBalancer, type AxBalancerOptions, AxBaseAI, type AxBaseAIArgs, AxBaseOptimizer, type AxBootstrapCompileOptions, AxBootstrapFewShot, type AxBootstrapOptimizerOptions, AxChainOfThought, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, type AxCheckpointLoadFn, type AxCheckpointSaveFn, type AxCompileOptions, type AxCostTracker, type AxCostTrackerOptions, 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, AxDefaultCostTracker, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, AxEvalUtil, type AxEvaluateArgs, type AxExample, type AxField, type AxFieldDescriptor, type AxFieldProcessor, type AxFieldProcessorProcess, type AxFieldTemplateFn, type AxFieldType, type AxFieldValue, AxFlow, AxFlowTypedSubContextImpl, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, type AxFunctionResult, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenOut, type AxGenStreamingOut, AxGenerateError, type AxGenerateErrorDetails, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSInterpreter, AxJSInterpreterPermission, AxLLMRequestTypeValues, type AxLoggerFunction, type AxLoggerTag, AxMCPClient, AxMCPHTTPSSETransport, AxMCPStdioTransport, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPTransport, AxMemory, type AxMemoryData, type AxMessage, type AxMetricFn, type AxMetricFnArgs, AxMiPRO, type AxMiPROCompileOptions, type AxMiPROOptimizerOptions, type AxMiPROResult, AxMockAIService, type AxMockAIServiceConfig, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxModelUsage, type AxMultiMetricFn, AxMultiServiceRouter, type AxOptimizationCheckpoint, type AxOptimizationProgress, type AxOptimizationStats, type AxOptimizer, type AxOptimizerArgs, type AxOptimizerResult, type AxParetoResult, 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 AxResultPickerFunction, type AxResultPickerFunctionFieldResults, type AxResultPickerFunctionFunctionResults, type AxRewriteIn, type AxRewriteOut, type AxSamplePickerOptions, type AxSetExamplesOptions, AxSignature, type AxSignatureConfig, type AxSignatureTemplateValue, AxSimpleClassifier, AxSimpleClassifierClass, type AxSimpleClassifierForwardOptions, AxSpanKindValues, type AxStreamingAssertion, type AxStreamingEvent, type AxStreamingFieldProcessorProcess, AxStringUtil, AxTestPrompt, type AxTokenUsage, type AxTunable, type AxUsable, ax, 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, axCreateDefaultLogger, axCreateDefaultTextLogger, axCreateOptimizerLogger, axDefaultOptimizerLogger, axGlobals, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoOpenAIResponses, axModelInfoReka, axModelInfoTogether, axSpanAttributes, axSpanEvents, axValidateChatRequestMessage, axValidateChatResponseResult, f, s };
4904
+ 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, type AxAIAnthropicThinkingConfig, type AxAIAnthropicThinkingTokenBudgetLevels, 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, type AxAIGoogleGeminiContentPart, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiEmbedTypes, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiThinkingConfig, type AxAIGoogleGeminiThinkingTokenBudgetLevels, 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, type AxAIMetricsInstruments, AxAIMistral, type AxAIMistralArgs, type AxAIMistralChatRequest, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, type AxAIModelListBase, type AxAIModels, AxAIOllama, type AxAIOllamaAIConfig, type AxAIOllamaArgs, AxAIOpenAI, type AxAIOpenAIAnnotation, 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, AxAIOpenAIResponsesModel, 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 AxAIOpenAIUrlCitation, type AxAIOpenAIUsage, type AxAIPromptConfig, AxAIRefusalError, 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, AxAgent, type AxAgentFeatures, type AxAgentOptions, type AxAgentic, AxApacheTika, type AxApacheTikaArgs, type AxApacheTikaConvertOptions, type AxAssertion, AxAssertionError, AxBalancer, type AxBalancerOptions, AxBaseAI, type AxBaseAIArgs, AxBaseOptimizer, type AxBootstrapCompileOptions, AxBootstrapFewShot, type AxBootstrapOptimizerOptions, AxChainOfThought, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, type AxCheckpointLoadFn, type AxCheckpointSaveFn, type AxCompileOptions, type AxCostTracker, type AxCostTrackerOptions, 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, AxDefaultCostTracker, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, type AxErrorCategory, AxEvalUtil, type AxEvaluateArgs, type AxExample, type AxField, type AxFieldDescriptor, type AxFieldProcessor, type AxFieldProcessorProcess, type AxFieldTemplateFn, type AxFieldType, type AxFieldValue, AxFlow, AxFlowTypedSubContextImpl, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, type AxFunctionResult, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenMetricsInstruments, type AxGenOut, type AxGenStreamingOut, AxGenerateError, type AxGenerateErrorDetails, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSInterpreter, AxJSInterpreterPermission, AxLLMRequestTypeValues, type AxLoggerFunction, type AxLoggerTag, AxMCPClient, AxMCPHTTPSSETransport, AxMCPStdioTransport, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPTransport, AxMemory, type AxMemoryData, type AxMessage, type AxMetricFn, type AxMetricFnArgs, type AxMetricsConfig, AxMiPRO, type AxMiPROCompileOptions, type AxMiPROOptimizerOptions, type AxMiPROResult, AxMockAIService, type AxMockAIServiceConfig, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxModelUsage, type AxMultiMetricFn, AxMultiServiceRouter, type AxOptimizationCheckpoint, type AxOptimizationProgress, type AxOptimizationStats, type AxOptimizer, type AxOptimizerArgs, type AxOptimizerMetricsConfig, type AxOptimizerMetricsInstruments, type AxOptimizerResult, type AxParetoResult, 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 AxResultPickerFunction, type AxResultPickerFunctionFieldResults, type AxResultPickerFunctionFunctionResults, type AxRewriteIn, type AxRewriteOut, type AxSamplePickerOptions, type AxSetExamplesOptions, AxSignature, type AxSignatureConfig, type AxSignatureTemplateValue, AxSimpleClassifier, AxSimpleClassifierClass, type AxSimpleClassifierForwardOptions, AxSpanKindValues, type AxStreamingAssertion, type AxStreamingEvent, type AxStreamingFieldProcessorProcess, AxStringUtil, AxTestPrompt, type AxTokenUsage, type AxTunable, type AxUsable, ax, 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, axCheckMetricsHealth, axCreateDefaultLogger, axCreateDefaultTextLogger, axCreateOptimizerLogger, axDefaultMetricsConfig, axDefaultOptimizerLogger, axDefaultOptimizerMetricsConfig, axGetMetricsConfig, axGetOptimizerMetricsConfig, axGlobals, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoOpenAIResponses, axModelInfoReka, axModelInfoTogether, axSpanAttributes, axSpanEvents, axUpdateMetricsConfig, axUpdateOptimizerMetricsConfig, axValidateChatRequestMessage, axValidateChatResponseResult, f, s };
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ReadableStream as ReadableStream$1 } from 'node:stream/web';
2
- import { Span, Context, Tracer } from '@opentelemetry/api';
2
+ import { Span, Context, Tracer, Meter, Histogram, Counter, Gauge } from '@opentelemetry/api';
3
3
  import { ReadableStream } from 'stream/web';
4
4
 
5
5
  interface RetryConfig {
@@ -103,6 +103,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
103
103
  private rt?;
104
104
  private fetch?;
105
105
  private tracer?;
106
+ private meter?;
106
107
  private timeout?;
107
108
  private excludeContentFromTrace?;
108
109
  private models?;
@@ -122,6 +123,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
122
123
  protected supportFor: AxAIFeatures | ((model: TModel) => AxAIFeatures);
123
124
  private metrics;
124
125
  constructor(aiImpl: Readonly<AxAIServiceImpl<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse>>, { name, apiURL, headers, modelInfo, defaults, options, supportFor, models, }: Readonly<AxBaseAIArgs<TModel, TEmbedModel>>);
126
+ private getMetricsInstruments;
125
127
  setName(name: string): void;
126
128
  getId(): string;
127
129
  setAPIURL(apiURL: string): void;
@@ -138,6 +140,19 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
138
140
  private calculatePercentile;
139
141
  private updateLatencyMetrics;
140
142
  private updateErrorMetrics;
143
+ private recordTokenUsage;
144
+ private calculateRequestSize;
145
+ private calculateResponseSize;
146
+ private detectMultimodalContent;
147
+ private calculatePromptLength;
148
+ private calculateContextWindowUsage;
149
+ private estimateCost;
150
+ private estimateCostByName;
151
+ private recordFunctionCallMetrics;
152
+ private recordTimeoutMetric;
153
+ private recordAbortMetric;
154
+ private recordChatMetrics;
155
+ private recordEmbedMetrics;
141
156
  getMetrics(): AxAIServiceMetrics;
142
157
  chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions<TModel, TEmbedModel>>): Promise<AxChatResponse | ReadableStream<AxChatResponse>>;
143
158
  private _chat1;
@@ -179,6 +194,7 @@ type AxModelInfo = {
179
194
  hasShowThoughts?: boolean;
180
195
  maxTokens?: number;
181
196
  isExpensive?: boolean;
197
+ contextWindow?: number;
182
198
  };
183
199
  type AxTokenUsage = {
184
200
  promptTokens: number;
@@ -378,6 +394,7 @@ type AxAIServiceOptions = {
378
394
  rateLimiter?: AxRateLimiterFunction;
379
395
  fetch?: typeof fetch;
380
396
  tracer?: Tracer;
397
+ meter?: Meter;
381
398
  timeout?: number;
382
399
  excludeContentFromTrace?: boolean;
383
400
  abortSignal?: AbortSignal;
@@ -2824,6 +2841,50 @@ interface AxOptimizationStats {
2824
2841
  standardDeviation?: number;
2825
2842
  };
2826
2843
  }
2844
+ interface AxOptimizerMetricsConfig {
2845
+ enabled: boolean;
2846
+ enabledCategories: ('optimization' | 'convergence' | 'resource_usage' | 'teacher_student' | 'checkpointing' | 'pareto')[];
2847
+ maxLabelLength: number;
2848
+ samplingRate: number;
2849
+ }
2850
+ declare const axDefaultOptimizerMetricsConfig: AxOptimizerMetricsConfig;
2851
+ interface AxOptimizerMetricsInstruments {
2852
+ optimizationLatencyHistogram?: Histogram;
2853
+ optimizationRequestsCounter?: Counter;
2854
+ optimizationErrorsCounter?: Counter;
2855
+ convergenceRoundsHistogram?: Histogram;
2856
+ convergenceScoreGauge?: Gauge;
2857
+ convergenceImprovementGauge?: Gauge;
2858
+ stagnationRoundsGauge?: Gauge;
2859
+ earlyStoppingCounter?: Counter;
2860
+ tokenUsageCounter?: Counter;
2861
+ costUsageCounter?: Counter;
2862
+ memoryUsageGauge?: Gauge;
2863
+ optimizationDurationHistogram?: Histogram;
2864
+ teacherStudentUsageCounter?: Counter;
2865
+ teacherStudentLatencyHistogram?: Histogram;
2866
+ teacherStudentScoreImprovementGauge?: Gauge;
2867
+ checkpointSaveCounter?: Counter;
2868
+ checkpointLoadCounter?: Counter;
2869
+ checkpointSaveLatencyHistogram?: Histogram;
2870
+ checkpointLoadLatencyHistogram?: Histogram;
2871
+ paretoOptimizationsCounter?: Counter;
2872
+ paretoFrontSizeHistogram?: Histogram;
2873
+ paretoHypervolumeGauge?: Gauge;
2874
+ paretoSolutionsGeneratedHistogram?: Histogram;
2875
+ programInputFieldsGauge?: Gauge;
2876
+ programOutputFieldsGauge?: Gauge;
2877
+ examplesCountGauge?: Gauge;
2878
+ validationSetSizeGauge?: Gauge;
2879
+ evaluationLatencyHistogram?: Histogram;
2880
+ demoGenerationLatencyHistogram?: Histogram;
2881
+ metricComputationLatencyHistogram?: Histogram;
2882
+ optimizerTypeGauge?: Gauge;
2883
+ targetScoreGauge?: Gauge;
2884
+ maxRoundsGauge?: Gauge;
2885
+ }
2886
+ declare const axUpdateOptimizerMetricsConfig: (config: Readonly<Partial<AxOptimizerMetricsConfig>>) => void;
2887
+ declare const axGetOptimizerMetricsConfig: () => AxOptimizerMetricsConfig;
2827
2888
  interface AxOptimizerResult<OUT extends AxGenOut> {
2828
2889
  demos?: AxProgramDemos<AxGenIn, OUT>[];
2829
2890
  stats: AxOptimizationStats;
@@ -3011,6 +3072,7 @@ declare abstract class AxBaseOptimizer<IN extends AxGenIn = AxGenIn, OUT extends
3011
3072
  private scoreHistory;
3012
3073
  private configurationHistory;
3013
3074
  protected stats: AxOptimizationStats;
3075
+ protected readonly metricsInstruments?: AxOptimizerMetricsInstruments;
3014
3076
  constructor(args: Readonly<AxOptimizerArgs>);
3015
3077
  /**
3016
3078
  * Initialize the optimization statistics structure
@@ -3162,6 +3224,38 @@ declare abstract class AxBaseOptimizer<IN extends AxGenIn = AxGenIn, OUT extends
3162
3224
  * Check if logging is enabled based on verbose settings
3163
3225
  */
3164
3226
  protected isLoggingEnabled(options?: AxCompileOptions): boolean;
3227
+ /**
3228
+ * Record optimization start metrics
3229
+ */
3230
+ protected recordOptimizationStart(optimizerType: string, programSignature?: string): void;
3231
+ /**
3232
+ * Record optimization completion metrics
3233
+ */
3234
+ protected recordOptimizationComplete(duration: number, success: boolean, optimizerType: string, programSignature?: string): void;
3235
+ /**
3236
+ * Record convergence metrics
3237
+ */
3238
+ protected recordConvergenceMetrics(rounds: number, currentScore: number, improvement: number, stagnationRounds: number, optimizerType: string): void;
3239
+ /**
3240
+ * Record early stopping metrics
3241
+ */
3242
+ protected recordEarlyStoppingMetrics(reason: string, optimizerType: string): void;
3243
+ /**
3244
+ * Record teacher-student interaction metrics
3245
+ */
3246
+ protected recordTeacherStudentMetrics(latency: number, scoreImprovement: number, optimizerType: string): void;
3247
+ /**
3248
+ * Record checkpoint metrics
3249
+ */
3250
+ protected recordCheckpointMetrics(operation: 'save' | 'load', latency: number, success: boolean, optimizerType: string): void;
3251
+ /**
3252
+ * Record Pareto optimization metrics
3253
+ */
3254
+ protected recordParetoMetrics(frontSize: number, solutionsGenerated: number, optimizerType: string, hypervolume?: number): void;
3255
+ /**
3256
+ * Record performance metrics
3257
+ */
3258
+ protected recordPerformanceMetrics(metricType: 'evaluation' | 'demo_generation' | 'metric_computation', duration: number, optimizerType: string): void;
3165
3259
  }
3166
3260
 
3167
3261
  type AxDBUpsertRequest = {
@@ -3510,6 +3604,9 @@ declare class AxGen<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOu
3510
3604
  private excludeContentFromTrace;
3511
3605
  private thoughtFieldName;
3512
3606
  constructor(signature: NonNullable<ConstructorParameters<typeof AxSignature>[0]>, options?: Readonly<AxProgramForwardOptions>);
3607
+ private getSignatureName;
3608
+ private getMetricsInstruments;
3609
+ updateMeter(meter?: Meter): void;
3513
3610
  private createStates;
3514
3611
  addAssert: (fn: AxAssertion["fn"], message?: string) => void;
3515
3612
  addStreamingAssert: (fieldName: string, fn: AxStreamingAssertion["fn"], message?: string) => void;
@@ -4352,6 +4449,56 @@ declare const f: {
4352
4449
  };
4353
4450
  };
4354
4451
 
4452
+ interface AxMetricsConfig {
4453
+ enabled: boolean;
4454
+ enabledCategories: ('generation' | 'streaming' | 'functions' | 'errors' | 'performance')[];
4455
+ maxLabelLength: number;
4456
+ samplingRate: number;
4457
+ }
4458
+ declare const axDefaultMetricsConfig: AxMetricsConfig;
4459
+ type AxErrorCategory = 'validation_error' | 'assertion_error' | 'timeout_error' | 'abort_error' | 'network_error' | 'auth_error' | 'rate_limit_error' | 'function_error' | 'parsing_error' | 'unknown_error';
4460
+ interface AxGenMetricsInstruments {
4461
+ generationLatencyHistogram?: Histogram;
4462
+ generationRequestsCounter?: Counter;
4463
+ generationErrorsCounter?: Counter;
4464
+ multiStepGenerationsCounter?: Counter;
4465
+ stepsPerGenerationHistogram?: Histogram;
4466
+ maxStepsReachedCounter?: Counter;
4467
+ validationErrorsCounter?: Counter;
4468
+ assertionErrorsCounter?: Counter;
4469
+ errorCorrectionAttemptsHistogram?: Histogram;
4470
+ errorCorrectionSuccessCounter?: Counter;
4471
+ errorCorrectionFailureCounter?: Counter;
4472
+ maxRetriesReachedCounter?: Counter;
4473
+ functionsEnabledGenerationsCounter?: Counter;
4474
+ functionCallStepsCounter?: Counter;
4475
+ functionsExecutedPerGenerationHistogram?: Histogram;
4476
+ functionErrorCorrectionCounter?: Counter;
4477
+ fieldProcessorsExecutedCounter?: Counter;
4478
+ streamingFieldProcessorsExecutedCounter?: Counter;
4479
+ streamingGenerationsCounter?: Counter;
4480
+ streamingDeltasEmittedCounter?: Counter;
4481
+ streamingFinalizationLatencyHistogram?: Histogram;
4482
+ samplesGeneratedHistogram?: Histogram;
4483
+ resultPickerUsageCounter?: Counter;
4484
+ resultPickerLatencyHistogram?: Histogram;
4485
+ inputFieldsGauge?: Gauge;
4486
+ outputFieldsGauge?: Gauge;
4487
+ examplesUsedGauge?: Gauge;
4488
+ demosUsedGauge?: Gauge;
4489
+ promptRenderLatencyHistogram?: Histogram;
4490
+ extractionLatencyHistogram?: Histogram;
4491
+ assertionLatencyHistogram?: Histogram;
4492
+ stateCreationLatencyHistogram?: Histogram;
4493
+ memoryUpdateLatencyHistogram?: Histogram;
4494
+ }
4495
+ declare const axCheckMetricsHealth: () => {
4496
+ healthy: boolean;
4497
+ issues: string[];
4498
+ };
4499
+ declare const axUpdateMetricsConfig: (config: Readonly<Partial<AxMetricsConfig>>) => void;
4500
+ declare const axGetMetricsConfig: () => AxMetricsConfig;
4501
+
4355
4502
  declare const axCreateDefaultLogger: (output?: (message: string) => void) => AxLoggerFunction;
4356
4503
  declare const axCreateDefaultTextLogger: (output?: (message: string) => void) => AxLoggerFunction;
4357
4504
  /**
@@ -4687,6 +4834,8 @@ declare const AxStringUtil: {
4687
4834
 
4688
4835
  declare const axGlobals: {
4689
4836
  signatureStrict: boolean;
4837
+ tracer: Tracer | undefined;
4838
+ meter: Meter | undefined;
4690
4839
  };
4691
4840
 
4692
4841
  declare const axModelInfoAnthropic: AxModelInfo[];
@@ -4721,8 +4870,35 @@ declare const axModelInfoReka: AxModelInfo[];
4721
4870
 
4722
4871
  declare const axModelInfoTogether: AxModelInfo[];
4723
4872
 
4873
+ interface AxAIMetricsInstruments {
4874
+ latencyHistogram?: Histogram;
4875
+ errorCounter?: Counter;
4876
+ requestCounter?: Counter;
4877
+ tokenCounter?: Counter;
4878
+ inputTokenCounter?: Counter;
4879
+ outputTokenCounter?: Counter;
4880
+ errorRateGauge?: Gauge;
4881
+ meanLatencyGauge?: Gauge;
4882
+ p95LatencyGauge?: Gauge;
4883
+ p99LatencyGauge?: Gauge;
4884
+ streamingRequestsCounter?: Counter;
4885
+ functionCallsCounter?: Counter;
4886
+ functionCallLatencyHistogram?: Histogram;
4887
+ requestSizeHistogram?: Histogram;
4888
+ responseSizeHistogram?: Histogram;
4889
+ temperatureGauge?: Gauge;
4890
+ maxTokensGauge?: Gauge;
4891
+ estimatedCostCounter?: Counter;
4892
+ promptLengthHistogram?: Histogram;
4893
+ contextWindowUsageGauge?: Gauge;
4894
+ timeoutsCounter?: Counter;
4895
+ abortsCounter?: Counter;
4896
+ thinkingBudgetUsageCounter?: Counter;
4897
+ multimodalRequestsCounter?: Counter;
4898
+ }
4899
+
4724
4900
  interface AxSamplePickerOptions<OUT extends AxGenOut> {
4725
4901
  resultPicker?: AxResultPickerFunction<OUT>;
4726
4902
  }
4727
4903
 
4728
- 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, type AxAIAnthropicThinkingConfig, type AxAIAnthropicThinkingTokenBudgetLevels, 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, type AxAIGoogleGeminiContentPart, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiEmbedTypes, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiThinkingConfig, type AxAIGoogleGeminiThinkingTokenBudgetLevels, 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, type AxAIMistralChatRequest, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, type AxAIModelListBase, type AxAIModels, AxAIOllama, type AxAIOllamaAIConfig, type AxAIOllamaArgs, AxAIOpenAI, type AxAIOpenAIAnnotation, 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, AxAIOpenAIResponsesModel, 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 AxAIOpenAIUrlCitation, type AxAIOpenAIUsage, type AxAIPromptConfig, AxAIRefusalError, 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, AxAgent, type AxAgentFeatures, type AxAgentOptions, type AxAgentic, AxApacheTika, type AxApacheTikaArgs, type AxApacheTikaConvertOptions, type AxAssertion, AxAssertionError, AxBalancer, type AxBalancerOptions, AxBaseAI, type AxBaseAIArgs, AxBaseOptimizer, type AxBootstrapCompileOptions, AxBootstrapFewShot, type AxBootstrapOptimizerOptions, AxChainOfThought, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, type AxCheckpointLoadFn, type AxCheckpointSaveFn, type AxCompileOptions, type AxCostTracker, type AxCostTrackerOptions, 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, AxDefaultCostTracker, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, AxEvalUtil, type AxEvaluateArgs, type AxExample, type AxField, type AxFieldDescriptor, type AxFieldProcessor, type AxFieldProcessorProcess, type AxFieldTemplateFn, type AxFieldType, type AxFieldValue, AxFlow, AxFlowTypedSubContextImpl, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, type AxFunctionResult, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenOut, type AxGenStreamingOut, AxGenerateError, type AxGenerateErrorDetails, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSInterpreter, AxJSInterpreterPermission, AxLLMRequestTypeValues, type AxLoggerFunction, type AxLoggerTag, AxMCPClient, AxMCPHTTPSSETransport, AxMCPStdioTransport, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPTransport, AxMemory, type AxMemoryData, type AxMessage, type AxMetricFn, type AxMetricFnArgs, AxMiPRO, type AxMiPROCompileOptions, type AxMiPROOptimizerOptions, type AxMiPROResult, AxMockAIService, type AxMockAIServiceConfig, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxModelUsage, type AxMultiMetricFn, AxMultiServiceRouter, type AxOptimizationCheckpoint, type AxOptimizationProgress, type AxOptimizationStats, type AxOptimizer, type AxOptimizerArgs, type AxOptimizerResult, type AxParetoResult, 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 AxResultPickerFunction, type AxResultPickerFunctionFieldResults, type AxResultPickerFunctionFunctionResults, type AxRewriteIn, type AxRewriteOut, type AxSamplePickerOptions, type AxSetExamplesOptions, AxSignature, type AxSignatureConfig, type AxSignatureTemplateValue, AxSimpleClassifier, AxSimpleClassifierClass, type AxSimpleClassifierForwardOptions, AxSpanKindValues, type AxStreamingAssertion, type AxStreamingEvent, type AxStreamingFieldProcessorProcess, AxStringUtil, AxTestPrompt, type AxTokenUsage, type AxTunable, type AxUsable, ax, 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, axCreateDefaultLogger, axCreateDefaultTextLogger, axCreateOptimizerLogger, axDefaultOptimizerLogger, axGlobals, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoOpenAIResponses, axModelInfoReka, axModelInfoTogether, axSpanAttributes, axSpanEvents, axValidateChatRequestMessage, axValidateChatResponseResult, f, s };
4904
+ 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, type AxAIAnthropicThinkingConfig, type AxAIAnthropicThinkingTokenBudgetLevels, 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, type AxAIGoogleGeminiContentPart, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiEmbedTypes, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiThinkingConfig, type AxAIGoogleGeminiThinkingTokenBudgetLevels, 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, type AxAIMetricsInstruments, AxAIMistral, type AxAIMistralArgs, type AxAIMistralChatRequest, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, type AxAIModelListBase, type AxAIModels, AxAIOllama, type AxAIOllamaAIConfig, type AxAIOllamaArgs, AxAIOpenAI, type AxAIOpenAIAnnotation, 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, AxAIOpenAIResponsesModel, 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 AxAIOpenAIUrlCitation, type AxAIOpenAIUsage, type AxAIPromptConfig, AxAIRefusalError, 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, AxAgent, type AxAgentFeatures, type AxAgentOptions, type AxAgentic, AxApacheTika, type AxApacheTikaArgs, type AxApacheTikaConvertOptions, type AxAssertion, AxAssertionError, AxBalancer, type AxBalancerOptions, AxBaseAI, type AxBaseAIArgs, AxBaseOptimizer, type AxBootstrapCompileOptions, AxBootstrapFewShot, type AxBootstrapOptimizerOptions, AxChainOfThought, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, type AxCheckpointLoadFn, type AxCheckpointSaveFn, type AxCompileOptions, type AxCostTracker, type AxCostTrackerOptions, 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, AxDefaultCostTracker, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, type AxErrorCategory, AxEvalUtil, type AxEvaluateArgs, type AxExample, type AxField, type AxFieldDescriptor, type AxFieldProcessor, type AxFieldProcessorProcess, type AxFieldTemplateFn, type AxFieldType, type AxFieldValue, AxFlow, AxFlowTypedSubContextImpl, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, type AxFunctionResult, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenMetricsInstruments, type AxGenOut, type AxGenStreamingOut, AxGenerateError, type AxGenerateErrorDetails, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSInterpreter, AxJSInterpreterPermission, AxLLMRequestTypeValues, type AxLoggerFunction, type AxLoggerTag, AxMCPClient, AxMCPHTTPSSETransport, AxMCPStdioTransport, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPTransport, AxMemory, type AxMemoryData, type AxMessage, type AxMetricFn, type AxMetricFnArgs, type AxMetricsConfig, AxMiPRO, type AxMiPROCompileOptions, type AxMiPROOptimizerOptions, type AxMiPROResult, AxMockAIService, type AxMockAIServiceConfig, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxModelUsage, type AxMultiMetricFn, AxMultiServiceRouter, type AxOptimizationCheckpoint, type AxOptimizationProgress, type AxOptimizationStats, type AxOptimizer, type AxOptimizerArgs, type AxOptimizerMetricsConfig, type AxOptimizerMetricsInstruments, type AxOptimizerResult, type AxParetoResult, 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 AxResultPickerFunction, type AxResultPickerFunctionFieldResults, type AxResultPickerFunctionFunctionResults, type AxRewriteIn, type AxRewriteOut, type AxSamplePickerOptions, type AxSetExamplesOptions, AxSignature, type AxSignatureConfig, type AxSignatureTemplateValue, AxSimpleClassifier, AxSimpleClassifierClass, type AxSimpleClassifierForwardOptions, AxSpanKindValues, type AxStreamingAssertion, type AxStreamingEvent, type AxStreamingFieldProcessorProcess, AxStringUtil, AxTestPrompt, type AxTokenUsage, type AxTunable, type AxUsable, ax, 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, axCheckMetricsHealth, axCreateDefaultLogger, axCreateDefaultTextLogger, axCreateOptimizerLogger, axDefaultMetricsConfig, axDefaultOptimizerLogger, axDefaultOptimizerMetricsConfig, axGetMetricsConfig, axGetOptimizerMetricsConfig, axGlobals, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoOpenAIResponses, axModelInfoReka, axModelInfoTogether, axSpanAttributes, axSpanEvents, axUpdateMetricsConfig, axUpdateOptimizerMetricsConfig, axValidateChatRequestMessage, axValidateChatResponseResult, f, s };