@ax-llm/ax 13.0.10 → 13.0.12
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.cjs +41 -41
- package/index.cjs.map +1 -1
- package/index.d.cts +254 -204
- package/index.d.ts +254 -204
- package/index.js +42 -42
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Span,
|
|
1
|
+
import { Span, Tracer, Meter, Context, Histogram, Counter, Gauge } from '@opentelemetry/api';
|
|
2
2
|
|
|
3
3
|
interface RetryConfig {
|
|
4
4
|
maxRetries: number;
|
|
@@ -73,18 +73,18 @@ declare class AxAIRefusalError extends Error {
|
|
|
73
73
|
toString(): string;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
type AxAIInputModelList<TModel, TEmbedModel> = (AxAIModelListBase & {
|
|
76
|
+
type AxAIInputModelList<TModel, TEmbedModel, TModelKey> = (AxAIModelListBase<TModelKey> & {
|
|
77
77
|
isInternal?: boolean;
|
|
78
78
|
} & ({
|
|
79
79
|
model: TModel;
|
|
80
80
|
} | {
|
|
81
81
|
embedModel: TEmbedModel;
|
|
82
82
|
}))[];
|
|
83
|
-
type AxAIModelListBase = {
|
|
84
|
-
key:
|
|
83
|
+
type AxAIModelListBase<TModelKey> = {
|
|
84
|
+
key: TModelKey;
|
|
85
85
|
description: string;
|
|
86
86
|
};
|
|
87
|
-
type AxAIModelList = (AxAIModelListBase & ({
|
|
87
|
+
type AxAIModelList<TModelKey> = (AxAIModelListBase<TModelKey> & ({
|
|
88
88
|
model: string;
|
|
89
89
|
} | {
|
|
90
90
|
embedModel: string;
|
|
@@ -347,12 +347,6 @@ type AxLoggerData = {
|
|
|
347
347
|
}[];
|
|
348
348
|
};
|
|
349
349
|
type AxLoggerFunction = (message: AxLoggerData) => void;
|
|
350
|
-
type AxAIPromptConfig = {
|
|
351
|
-
stream?: boolean;
|
|
352
|
-
thinkingTokenBudget?: 'minimal' | 'low' | 'medium' | 'high' | 'highest' | 'none';
|
|
353
|
-
showThoughts?: boolean;
|
|
354
|
-
useExpensiveModel?: 'yes';
|
|
355
|
-
};
|
|
356
350
|
type AxAIServiceOptions = {
|
|
357
351
|
debug?: boolean;
|
|
358
352
|
rateLimiter?: AxRateLimiterFunction;
|
|
@@ -363,38 +357,32 @@ type AxAIServiceOptions = {
|
|
|
363
357
|
excludeContentFromTrace?: boolean;
|
|
364
358
|
abortSignal?: AbortSignal;
|
|
365
359
|
logger?: AxLoggerFunction;
|
|
366
|
-
};
|
|
367
|
-
type AxAIServiceActionOptions<TModel = unknown, TEmbedModel = unknown> = {
|
|
368
|
-
ai?: Readonly<AxAIService<TModel, TEmbedModel>>;
|
|
369
360
|
sessionId?: string;
|
|
370
|
-
traceId?: string | undefined;
|
|
371
|
-
timeout?: number;
|
|
372
|
-
rateLimiter?: AxRateLimiterFunction;
|
|
373
|
-
debug?: boolean;
|
|
374
361
|
debugHideSystemPrompt?: boolean;
|
|
375
362
|
traceContext?: Context;
|
|
376
|
-
|
|
377
|
-
|
|
363
|
+
stream?: boolean;
|
|
364
|
+
thinkingTokenBudget?: 'minimal' | 'low' | 'medium' | 'high' | 'highest' | 'none';
|
|
365
|
+
showThoughts?: boolean;
|
|
366
|
+
useExpensiveModel?: 'yes';
|
|
378
367
|
stepIndex?: number;
|
|
379
|
-
functionResultFormatter?: (result: unknown) => string;
|
|
380
368
|
};
|
|
381
|
-
interface AxAIService<TModel = unknown, TEmbedModel = unknown> {
|
|
369
|
+
interface AxAIService<TModel = unknown, TEmbedModel = unknown, TModelKey = string> {
|
|
382
370
|
getId(): string;
|
|
383
371
|
getName(): string;
|
|
384
372
|
getFeatures(model?: TModel): AxAIFeatures;
|
|
385
|
-
getModelList(): AxAIModelList | undefined;
|
|
373
|
+
getModelList(): AxAIModelList<TModelKey> | undefined;
|
|
386
374
|
getMetrics(): AxAIServiceMetrics;
|
|
387
375
|
getLogger(): AxLoggerFunction;
|
|
388
376
|
getLastUsedChatModel(): TModel | undefined;
|
|
389
377
|
getLastUsedEmbedModel(): TEmbedModel | undefined;
|
|
390
378
|
getLastUsedModelConfig(): AxModelConfig | undefined;
|
|
391
|
-
chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<
|
|
392
|
-
embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<
|
|
379
|
+
chat(req: Readonly<AxChatRequest<TModel | TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxChatResponse | ReadableStream<AxChatResponse>>;
|
|
380
|
+
embed(req: Readonly<AxEmbedRequest<TEmbedModel | TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxEmbedResponse>;
|
|
393
381
|
setOptions(options: Readonly<AxAIServiceOptions>): void;
|
|
394
382
|
getOptions(): Readonly<AxAIServiceOptions>;
|
|
395
383
|
}
|
|
396
384
|
interface AxAIServiceImpl<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse> {
|
|
397
|
-
createChatReq(req: Readonly<AxInternalChatRequest<TModel>>, config
|
|
385
|
+
createChatReq(req: Readonly<AxInternalChatRequest<TModel>>, config?: Readonly<AxAIServiceOptions>): Promise<[AxAPI, TChatRequest]> | [AxAPI, TChatRequest];
|
|
398
386
|
createChatResp(resp: Readonly<TChatResponse>): AxChatResponse;
|
|
399
387
|
createChatStreamResp?(resp: Readonly<TChatResponseDelta>, state: object): AxChatResponse;
|
|
400
388
|
createEmbedReq?(req: Readonly<AxInternalEmbedRequest<TEmbedModel>>): Promise<[AxAPI, TEmbedRequest]> | [AxAPI, TEmbedRequest];
|
|
@@ -410,7 +398,7 @@ interface AxAIFeatures {
|
|
|
410
398
|
hasThinkingBudget?: boolean;
|
|
411
399
|
hasShowThoughts?: boolean;
|
|
412
400
|
}
|
|
413
|
-
interface AxBaseAIArgs<TModel, TEmbedModel> {
|
|
401
|
+
interface AxBaseAIArgs<TModel, TEmbedModel, TModelKey> {
|
|
414
402
|
name: string;
|
|
415
403
|
apiURL: string;
|
|
416
404
|
headers: () => Promise<Record<string, string>>;
|
|
@@ -421,11 +409,11 @@ interface AxBaseAIArgs<TModel, TEmbedModel> {
|
|
|
421
409
|
}>;
|
|
422
410
|
options?: Readonly<AxAIServiceOptions>;
|
|
423
411
|
supportFor: AxAIFeatures | ((model: TModel) => AxAIFeatures);
|
|
424
|
-
models?: AxAIInputModelList<TModel, TEmbedModel>;
|
|
412
|
+
models?: AxAIInputModelList<TModel, TEmbedModel, TModelKey>;
|
|
425
413
|
}
|
|
426
414
|
declare const axBaseAIDefaultConfig: () => AxModelConfig;
|
|
427
415
|
declare const axBaseAIDefaultCreativeConfig: () => AxModelConfig;
|
|
428
|
-
declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse> implements AxAIService<TModel, TEmbedModel> {
|
|
416
|
+
declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse, TModelKey> implements AxAIService<TModel, TEmbedModel, TModelKey> {
|
|
429
417
|
private readonly aiImpl;
|
|
430
418
|
private debug;
|
|
431
419
|
private rt?;
|
|
@@ -450,7 +438,7 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
|
|
|
450
438
|
protected headers: () => Promise<Record<string, string>>;
|
|
451
439
|
protected supportFor: AxAIFeatures | ((model: TModel) => AxAIFeatures);
|
|
452
440
|
private metrics;
|
|
453
|
-
constructor(aiImpl: Readonly<AxAIServiceImpl<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse>>, { name, apiURL, headers, modelInfo, defaults, options, supportFor, models, }: Readonly<AxBaseAIArgs<TModel, TEmbedModel>>);
|
|
441
|
+
constructor(aiImpl: Readonly<AxAIServiceImpl<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse>>, { name, apiURL, headers, modelInfo, defaults, options, supportFor, models, }: Readonly<AxBaseAIArgs<TModel, TEmbedModel, TModelKey>>);
|
|
454
442
|
private getMetricsInstruments;
|
|
455
443
|
setName(name: string): void;
|
|
456
444
|
getId(): string;
|
|
@@ -459,7 +447,17 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
|
|
|
459
447
|
setOptions(options: Readonly<AxAIServiceOptions>): void;
|
|
460
448
|
getOptions(): Readonly<AxAIServiceOptions>;
|
|
461
449
|
getLogger(): AxLoggerFunction;
|
|
462
|
-
getModelList():
|
|
450
|
+
getModelList(): ({
|
|
451
|
+
readonly key: TModelKey;
|
|
452
|
+
readonly description: string;
|
|
453
|
+
readonly model: string;
|
|
454
|
+
readonly embedModel?: undefined;
|
|
455
|
+
} | {
|
|
456
|
+
readonly key: TModelKey;
|
|
457
|
+
readonly description: string;
|
|
458
|
+
readonly embedModel: string;
|
|
459
|
+
readonly model?: undefined;
|
|
460
|
+
})[];
|
|
463
461
|
getName(): string;
|
|
464
462
|
getFeatures(model?: TModel): AxAIFeatures;
|
|
465
463
|
getLastUsedChatModel(): TModel | undefined;
|
|
@@ -482,11 +480,11 @@ declare class AxBaseAI<TModel, TEmbedModel, TChatRequest, TEmbedRequest, TChatRe
|
|
|
482
480
|
private recordChatMetrics;
|
|
483
481
|
private recordEmbedMetrics;
|
|
484
482
|
getMetrics(): AxAIServiceMetrics;
|
|
485
|
-
chat(req: Readonly<AxChatRequest<TModel>>, options?: Readonly<
|
|
483
|
+
chat(req: Readonly<AxChatRequest<TModel | TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxChatResponse | ReadableStream<AxChatResponse>>;
|
|
486
484
|
private _chat1;
|
|
487
485
|
private cleanupFunctionSchema;
|
|
488
486
|
private _chat2;
|
|
489
|
-
embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<
|
|
487
|
+
embed(req: Readonly<AxEmbedRequest<TEmbedModel>>, options?: Readonly<AxAIServiceOptions>): Promise<AxEmbedResponse>;
|
|
490
488
|
private _embed1;
|
|
491
489
|
private _embed2;
|
|
492
490
|
private buildHeaders;
|
|
@@ -729,17 +727,23 @@ type AxAIAnthropicChatResponseDelta = AxAIAnthropicMessageStartEvent | AxAIAnthr
|
|
|
729
727
|
|
|
730
728
|
declare const axAIAnthropicDefaultConfig: () => AxAIAnthropicConfig;
|
|
731
729
|
declare const axAIAnthropicVertexDefaultConfig: () => AxAIAnthropicConfig;
|
|
732
|
-
|
|
730
|
+
type ExtractModelKeys$1<T> = T extends readonly {
|
|
731
|
+
key: infer K;
|
|
732
|
+
}[] ? K : never;
|
|
733
|
+
interface AxAIAnthropicArgs<TModelKey = string> {
|
|
733
734
|
name: 'anthropic';
|
|
734
735
|
apiKey?: string | (() => Promise<string>);
|
|
735
736
|
projectId?: string;
|
|
736
737
|
region?: string;
|
|
737
738
|
config?: Readonly<Partial<AxAIAnthropicConfig>>;
|
|
738
739
|
options?: Readonly<AxAIServiceOptions>;
|
|
739
|
-
models?: AxAIInputModelList<AxAIAnthropicModel | AxAIAnthropicVertexModel, undefined>;
|
|
740
|
+
models?: AxAIInputModelList<AxAIAnthropicModel | AxAIAnthropicVertexModel, undefined, TModelKey>;
|
|
740
741
|
}
|
|
741
|
-
declare class AxAIAnthropic extends AxBaseAI<AxAIAnthropicModel | AxAIAnthropicVertexModel, unknown, AxAIAnthropicChatRequest,
|
|
742
|
-
|
|
742
|
+
declare class AxAIAnthropic<TModelKey = string> extends AxBaseAI<AxAIAnthropicModel | AxAIAnthropicVertexModel, unknown, AxAIAnthropicChatRequest, never, AxAIAnthropicChatResponse, AxAIAnthropicChatResponseDelta, never, TModelKey> {
|
|
743
|
+
static create<const T extends AxAIAnthropicArgs<any>>(options: T): T extends {
|
|
744
|
+
models: infer M;
|
|
745
|
+
} ? AxAIAnthropic<ExtractModelKeys$1<M>> : AxAIAnthropic<string>;
|
|
746
|
+
constructor({ apiKey, projectId, region, config, options, models, }: Readonly<Omit<AxAIAnthropicArgs<TModelKey>, 'name'>>);
|
|
743
747
|
}
|
|
744
748
|
|
|
745
749
|
declare const axModelInfoAnthropic: AxModelInfo[];
|
|
@@ -990,13 +994,13 @@ declare const axAIOpenAIDefaultConfig: () => AxAIOpenAIConfig<AxAIOpenAIModel, A
|
|
|
990
994
|
declare const axAIOpenAIBestConfig: () => AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;
|
|
991
995
|
declare const axAIOpenAICreativeConfig: () => AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;
|
|
992
996
|
declare const axAIOpenAIFastConfig: () => AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;
|
|
993
|
-
interface AxAIOpenAIArgs<TName = 'openai', TModel = AxAIOpenAIModel, TEmbedModel = AxAIOpenAIEmbedModel, TChatReq extends AxAIOpenAIChatRequest<TModel> = AxAIOpenAIChatRequest<TModel>> extends Omit<AxAIOpenAIBaseArgs<TModel, TEmbedModel, TChatReq>, 'config' | 'supportFor' | 'modelInfo'> {
|
|
997
|
+
interface AxAIOpenAIArgs<TName = 'openai', TModel = AxAIOpenAIModel, TEmbedModel = AxAIOpenAIEmbedModel, TModelKey = string, TChatReq extends AxAIOpenAIChatRequest<TModel> = AxAIOpenAIChatRequest<TModel>> extends Omit<AxAIOpenAIBaseArgs<TModel, TEmbedModel, TModelKey, TChatReq>, 'config' | 'supportFor' | 'modelInfo'> {
|
|
994
998
|
name: TName;
|
|
995
999
|
modelInfo?: AxModelInfo[];
|
|
996
|
-
config?: Partial<AxAIOpenAIBaseArgs<TModel, TEmbedModel, TChatReq>['config']>;
|
|
1000
|
+
config?: Partial<AxAIOpenAIBaseArgs<TModel, TEmbedModel, TModelKey, TChatReq>['config']>;
|
|
997
1001
|
}
|
|
998
1002
|
type ChatReqUpdater<TModel, TChatReq extends AxAIOpenAIChatRequest<TModel>> = (req: Readonly<TChatReq>) => TChatReq;
|
|
999
|
-
interface AxAIOpenAIBaseArgs<TModel, TEmbedModel, TChatReq extends AxAIOpenAIChatRequest<TModel>> {
|
|
1003
|
+
interface AxAIOpenAIBaseArgs<TModel, TEmbedModel, TModelKey, TChatReq extends AxAIOpenAIChatRequest<TModel>> {
|
|
1000
1004
|
apiKey: string;
|
|
1001
1005
|
apiURL?: string;
|
|
1002
1006
|
config: Readonly<AxAIOpenAIConfig<TModel, TEmbedModel>>;
|
|
@@ -1004,15 +1008,15 @@ interface AxAIOpenAIBaseArgs<TModel, TEmbedModel, TChatReq extends AxAIOpenAICha
|
|
|
1004
1008
|
streamingUsage?: boolean;
|
|
1005
1009
|
}>;
|
|
1006
1010
|
modelInfo: Readonly<AxModelInfo[]>;
|
|
1007
|
-
models?: AxAIInputModelList<TModel, TEmbedModel>;
|
|
1011
|
+
models?: AxAIInputModelList<TModel, TEmbedModel, TModelKey>;
|
|
1008
1012
|
chatReqUpdater?: ChatReqUpdater<TModel, TChatReq>;
|
|
1009
1013
|
supportFor: AxAIFeatures | ((model: TModel) => AxAIFeatures);
|
|
1010
1014
|
}
|
|
1011
|
-
declare class AxAIOpenAIBase<TModel, TEmbedModel, TChatReq extends AxAIOpenAIChatRequest<TModel> = AxAIOpenAIChatRequest<TModel>> extends AxBaseAI<TModel, TEmbedModel, AxAIOpenAIChatRequest<TModel>, AxAIOpenAIEmbedRequest<TEmbedModel>, AxAIOpenAIChatResponse, AxAIOpenAIChatResponseDelta, AxAIOpenAIEmbedResponse> {
|
|
1012
|
-
constructor({ apiKey, config, options, apiURL, modelInfo, models, chatReqUpdater, supportFor, }: Readonly<Omit<AxAIOpenAIBaseArgs<TModel, TEmbedModel, TChatReq>, 'name'>>);
|
|
1015
|
+
declare class AxAIOpenAIBase<TModel, TEmbedModel, TModelKey, TChatReq extends AxAIOpenAIChatRequest<TModel> = AxAIOpenAIChatRequest<TModel>> extends AxBaseAI<TModel, TEmbedModel, AxAIOpenAIChatRequest<TModel>, AxAIOpenAIEmbedRequest<TEmbedModel>, AxAIOpenAIChatResponse, AxAIOpenAIChatResponseDelta, AxAIOpenAIEmbedResponse, TModelKey> {
|
|
1016
|
+
constructor({ apiKey, config, options, apiURL, modelInfo, models, chatReqUpdater, supportFor, }: Readonly<Omit<AxAIOpenAIBaseArgs<TModel, TEmbedModel, TModelKey, TChatReq>, 'name'>>);
|
|
1013
1017
|
}
|
|
1014
|
-
declare class AxAIOpenAI extends AxAIOpenAIBase<AxAIOpenAIModel, AxAIOpenAIEmbedModel> {
|
|
1015
|
-
constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIOpenAIArgs, 'name'>>);
|
|
1018
|
+
declare class AxAIOpenAI<TModelKey = string> extends AxAIOpenAIBase<AxAIOpenAIModel, AxAIOpenAIEmbedModel, TModelKey> {
|
|
1019
|
+
constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIOpenAIArgs<'openai', AxAIOpenAIModel, AxAIOpenAIEmbedModel, TModelKey>, 'name'>>);
|
|
1016
1020
|
}
|
|
1017
1021
|
|
|
1018
1022
|
declare const axAIAzureOpenAIDefaultConfig: () => AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;
|
|
@@ -1020,20 +1024,25 @@ declare const axAIAzureOpenAICreativeConfig: () => AxAIOpenAIConfig<AxAIOpenAIMo
|
|
|
1020
1024
|
declare const axAIAzureOpenAIFastConfig: () => AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;
|
|
1021
1025
|
declare const axAIAzureOpenAIBestConfig: () => AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;
|
|
1022
1026
|
type AxAIAzureOpenAIConfig = AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;
|
|
1023
|
-
type AxAIAzureOpenAIArgs = AxAIOpenAIArgs<'azure-openai', AxAIOpenAIModel, AxAIOpenAIEmbedModel> & {
|
|
1027
|
+
type AxAIAzureOpenAIArgs<TModelKey> = AxAIOpenAIArgs<'azure-openai', AxAIOpenAIModel, AxAIOpenAIEmbedModel, TModelKey> & {
|
|
1024
1028
|
resourceName: string;
|
|
1025
1029
|
deploymentName: string;
|
|
1026
1030
|
version?: string;
|
|
1027
1031
|
};
|
|
1028
|
-
declare class AxAIAzureOpenAI extends AxAIOpenAIBase<AxAIOpenAIModel, AxAIOpenAIEmbedModel> {
|
|
1029
|
-
constructor({ apiKey, resourceName, deploymentName, version, config, options, models, modelInfo, }: Readonly<Omit<AxAIAzureOpenAIArgs
|
|
1032
|
+
declare class AxAIAzureOpenAI<TModelKey> extends AxAIOpenAIBase<AxAIOpenAIModel, AxAIOpenAIEmbedModel, TModelKey> {
|
|
1033
|
+
constructor({ apiKey, resourceName, deploymentName, version, config, options, models, modelInfo, }: Readonly<Omit<AxAIAzureOpenAIArgs<TModelKey>, 'name'>>);
|
|
1030
1034
|
}
|
|
1031
1035
|
|
|
1036
|
+
type ExtractServiceModelKeys$1<T> = T extends AxAIService<any, any, infer K> ? K : never;
|
|
1037
|
+
type ExtractAllModelKeys$1<T extends readonly any[]> = T extends readonly [
|
|
1038
|
+
infer First,
|
|
1039
|
+
...infer Rest
|
|
1040
|
+
] ? ExtractServiceModelKeys$1<First> | ExtractAllModelKeys$1<Rest> : never;
|
|
1032
1041
|
/**
|
|
1033
1042
|
* Options for the balancer.
|
|
1034
1043
|
*/
|
|
1035
|
-
type AxBalancerOptions = {
|
|
1036
|
-
comparator?: (a: AxAIService, b: AxAIService) => number;
|
|
1044
|
+
type AxBalancerOptions<TModelKey = string> = {
|
|
1045
|
+
comparator?: (a: AxAIService<unknown, unknown, TModelKey>, b: AxAIService<unknown, unknown, TModelKey>) => number;
|
|
1037
1046
|
debug?: boolean;
|
|
1038
1047
|
initialBackoffMs?: number;
|
|
1039
1048
|
maxBackoffMs?: number;
|
|
@@ -1042,7 +1051,7 @@ type AxBalancerOptions = {
|
|
|
1042
1051
|
/**
|
|
1043
1052
|
* Balancer that rotates through services.
|
|
1044
1053
|
*/
|
|
1045
|
-
declare class AxBalancer implements AxAIService<unknown, unknown> {
|
|
1054
|
+
declare class AxBalancer<TServices extends readonly AxAIService<any, any, any>[] = readonly AxAIService[], TModelKey = ExtractAllModelKeys$1<TServices>> implements AxAIService<unknown, unknown, TModelKey> {
|
|
1046
1055
|
private services;
|
|
1047
1056
|
private currentServiceIndex;
|
|
1048
1057
|
private currentService;
|
|
@@ -1051,7 +1060,11 @@ declare class AxBalancer implements AxAIService<unknown, unknown> {
|
|
|
1051
1060
|
private maxBackoffMs;
|
|
1052
1061
|
private maxRetries;
|
|
1053
1062
|
private serviceFailures;
|
|
1054
|
-
constructor(services:
|
|
1063
|
+
constructor(services: TServices, options?: AxBalancerOptions<TModelKey>);
|
|
1064
|
+
/**
|
|
1065
|
+
* Static factory method for type-safe balancer creation with automatic model key inference.
|
|
1066
|
+
*/
|
|
1067
|
+
static create<const TServices extends readonly AxAIService<any, any, any>[]>(services: TServices, options?: AxBalancerOptions<ExtractAllModelKeys$1<TServices>>): AxBalancer<TServices, ExtractAllModelKeys$1<TServices>>;
|
|
1055
1068
|
getLastUsedChatModel(): unknown;
|
|
1056
1069
|
getLastUsedEmbedModel(): unknown;
|
|
1057
1070
|
getLastUsedModelConfig(): AxModelConfig | undefined;
|
|
@@ -1062,8 +1075,8 @@ declare class AxBalancer implements AxAIService<unknown, unknown> {
|
|
|
1062
1075
|
/**
|
|
1063
1076
|
* Service comparator that sorts services by cost.
|
|
1064
1077
|
*/
|
|
1065
|
-
static metricComparator: (a: AxAIService, b: AxAIService) => number;
|
|
1066
|
-
getModelList(): AxAIModelList | undefined;
|
|
1078
|
+
static metricComparator: <TModelKey_1 = string>(a: AxAIService<unknown, unknown, TModelKey_1>, b: AxAIService<unknown, unknown, TModelKey_1>) => number;
|
|
1079
|
+
getModelList(): AxAIModelList<TModelKey> | undefined;
|
|
1067
1080
|
private getNextService;
|
|
1068
1081
|
private reset;
|
|
1069
1082
|
getName(): string;
|
|
@@ -1073,8 +1086,8 @@ declare class AxBalancer implements AxAIService<unknown, unknown> {
|
|
|
1073
1086
|
private canRetryService;
|
|
1074
1087
|
private handleFailure;
|
|
1075
1088
|
private handleSuccess;
|
|
1076
|
-
chat(req: Readonly<AxChatRequest
|
|
1077
|
-
embed(req: Readonly<AxEmbedRequest
|
|
1089
|
+
chat(req: Readonly<AxChatRequest<TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxChatResponse | ReadableStream<AxChatResponse>>;
|
|
1090
|
+
embed(req: Readonly<AxEmbedRequest<TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxEmbedResponse>;
|
|
1078
1091
|
setOptions(options: Readonly<AxAIServiceOptions>): void;
|
|
1079
1092
|
getOptions(): Readonly<AxAIServiceOptions>;
|
|
1080
1093
|
getLogger(): AxLoggerFunction;
|
|
@@ -1181,15 +1194,15 @@ type AxAICohereEmbedResponse = {
|
|
|
1181
1194
|
|
|
1182
1195
|
declare const axAICohereDefaultConfig: () => AxAICohereConfig;
|
|
1183
1196
|
declare const axAICohereCreativeConfig: () => AxAICohereConfig;
|
|
1184
|
-
interface AxAICohereArgs {
|
|
1197
|
+
interface AxAICohereArgs<TModelKey> {
|
|
1185
1198
|
name: 'cohere';
|
|
1186
1199
|
apiKey: string;
|
|
1187
1200
|
config?: Readonly<Partial<AxAICohereConfig>>;
|
|
1188
1201
|
options?: Readonly<AxAIServiceOptions>;
|
|
1189
|
-
models?: AxAIInputModelList<AxAICohereModel, AxAICohereEmbedModel>;
|
|
1202
|
+
models?: AxAIInputModelList<AxAICohereModel, AxAICohereEmbedModel, TModelKey>;
|
|
1190
1203
|
}
|
|
1191
|
-
declare class AxAICohere extends AxBaseAI<AxAICohereModel, AxAICohereEmbedModel, AxAICohereChatRequest, AxAICohereEmbedRequest, AxAICohereChatResponse, AxAICohereChatResponseDelta, AxAICohereEmbedResponse> {
|
|
1192
|
-
constructor({ apiKey, config, options, models, }: Readonly<Omit<AxAICohereArgs
|
|
1204
|
+
declare class AxAICohere<TModelKey> extends AxBaseAI<AxAICohereModel, AxAICohereEmbedModel, AxAICohereChatRequest, AxAICohereEmbedRequest, AxAICohereChatResponse, AxAICohereChatResponseDelta, AxAICohereEmbedResponse, TModelKey> {
|
|
1205
|
+
constructor({ apiKey, config, options, models, }: Readonly<Omit<AxAICohereArgs<TModelKey>, 'name'>>);
|
|
1193
1206
|
}
|
|
1194
1207
|
|
|
1195
1208
|
declare const axModelInfoCohere: AxModelInfo[];
|
|
@@ -1206,9 +1219,9 @@ declare enum AxAIDeepSeekModel {
|
|
|
1206
1219
|
type DeepSeekConfig = AxAIOpenAIConfig<AxAIDeepSeekModel, undefined>;
|
|
1207
1220
|
declare const axAIDeepSeekDefaultConfig: () => DeepSeekConfig;
|
|
1208
1221
|
declare const axAIDeepSeekCodeConfig: () => DeepSeekConfig;
|
|
1209
|
-
type AxAIDeepSeekArgs = AxAIOpenAIArgs<'deepseek', AxAIDeepSeekModel, undefined>;
|
|
1210
|
-
declare class AxAIDeepSeek extends AxAIOpenAIBase<AxAIDeepSeekModel, undefined> {
|
|
1211
|
-
constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIDeepSeekArgs
|
|
1222
|
+
type AxAIDeepSeekArgs<TModelKey> = AxAIOpenAIArgs<'deepseek', AxAIDeepSeekModel, undefined, TModelKey>;
|
|
1223
|
+
declare class AxAIDeepSeek<TModelKey> extends AxAIOpenAIBase<AxAIDeepSeekModel, undefined, TModelKey> {
|
|
1224
|
+
constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIDeepSeekArgs<TModelKey>, 'name'>>);
|
|
1212
1225
|
}
|
|
1213
1226
|
|
|
1214
1227
|
declare const axModelInfoDeepSeek: AxModelInfo[];
|
|
@@ -1451,7 +1464,7 @@ interface AxAIGoogleGeminiOptionsTools {
|
|
|
1451
1464
|
googleSearch?: boolean;
|
|
1452
1465
|
urlContext?: boolean;
|
|
1453
1466
|
}
|
|
1454
|
-
interface AxAIGoogleGeminiArgs {
|
|
1467
|
+
interface AxAIGoogleGeminiArgs<TModelKey> {
|
|
1455
1468
|
name: 'google-gemini';
|
|
1456
1469
|
apiKey?: string | (() => Promise<string>);
|
|
1457
1470
|
projectId?: string;
|
|
@@ -1459,14 +1472,17 @@ interface AxAIGoogleGeminiArgs {
|
|
|
1459
1472
|
endpointId?: string;
|
|
1460
1473
|
config?: Readonly<Partial<AxAIGoogleGeminiConfig>>;
|
|
1461
1474
|
options?: Readonly<AxAIServiceOptions & AxAIGoogleGeminiOptionsTools>;
|
|
1462
|
-
models?: AxAIInputModelList<AxAIGoogleGeminiModel, AxAIGoogleGeminiEmbedModel>;
|
|
1475
|
+
models?: AxAIInputModelList<AxAIGoogleGeminiModel, AxAIGoogleGeminiEmbedModel, TModelKey>;
|
|
1463
1476
|
modelInfo?: AxModelInfo[];
|
|
1464
1477
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
declare class AxAIGoogleGemini extends AxBaseAI<AxAIGoogleGeminiModel, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiChatRequest, AxAIGoogleGeminiBatchEmbedRequest | AxAIGoogleVertexBatchEmbedRequest, AxAIGoogleGeminiChatResponse, AxAIGoogleGeminiChatResponseDelta, AxAIGoogleGeminiBatchEmbedResponse | AxAIGoogleVertexBatchEmbedResponse> {
|
|
1469
|
-
|
|
1478
|
+
type ExtractModelKeys<T> = T extends readonly {
|
|
1479
|
+
key: infer K;
|
|
1480
|
+
}[] ? K : never;
|
|
1481
|
+
declare class AxAIGoogleGemini<TModelKey = string> extends AxBaseAI<AxAIGoogleGeminiModel, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiChatRequest, AxAIGoogleGeminiBatchEmbedRequest | AxAIGoogleVertexBatchEmbedRequest, AxAIGoogleGeminiChatResponse, AxAIGoogleGeminiChatResponseDelta, AxAIGoogleGeminiBatchEmbedResponse | AxAIGoogleVertexBatchEmbedResponse, TModelKey> {
|
|
1482
|
+
static create<const T extends AxAIGoogleGeminiArgs<any>>(options: T): T extends {
|
|
1483
|
+
models: infer M;
|
|
1484
|
+
} ? AxAIGoogleGemini<ExtractModelKeys<M>> : AxAIGoogleGemini<string>;
|
|
1485
|
+
constructor({ apiKey, projectId, region, endpointId, config, options, models, modelInfo, }: Readonly<Omit<AxAIGoogleGeminiArgs<TModelKey>, 'name'>>);
|
|
1470
1486
|
}
|
|
1471
1487
|
|
|
1472
1488
|
/**
|
|
@@ -1481,14 +1497,14 @@ declare enum AxAIGroqModel {
|
|
|
1481
1497
|
Gemma2_9B = "gemma2-9b-it"
|
|
1482
1498
|
}
|
|
1483
1499
|
|
|
1484
|
-
type AxAIGroqArgs = AxAIOpenAIArgs<'groq', AxAIGroqModel, undefined> & {
|
|
1500
|
+
type AxAIGroqArgs<TModelKey> = AxAIOpenAIArgs<'groq', AxAIGroqModel, undefined, TModelKey> & {
|
|
1485
1501
|
options?: Readonly<AxAIServiceOptions> & {
|
|
1486
1502
|
tokensPerMinute?: number;
|
|
1487
1503
|
};
|
|
1488
1504
|
modelInfo?: AxModelInfo[];
|
|
1489
1505
|
};
|
|
1490
|
-
declare class AxAIGroq extends AxAIOpenAIBase<AxAIGroqModel, undefined> {
|
|
1491
|
-
constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIGroqArgs
|
|
1506
|
+
declare class AxAIGroq<TModelKey> extends AxAIOpenAIBase<AxAIGroqModel, undefined, TModelKey> {
|
|
1507
|
+
constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIGroqArgs<TModelKey>, 'name'>>);
|
|
1492
1508
|
setOptions: (options: Readonly<AxAIServiceOptions>) => void;
|
|
1493
1509
|
private newRateLimiter;
|
|
1494
1510
|
}
|
|
@@ -1534,15 +1550,15 @@ type AxAIHuggingFaceResponse = {
|
|
|
1534
1550
|
|
|
1535
1551
|
declare const axAIHuggingFaceDefaultConfig: () => AxAIHuggingFaceConfig;
|
|
1536
1552
|
declare const axAIHuggingFaceCreativeConfig: () => AxAIHuggingFaceConfig;
|
|
1537
|
-
interface AxAIHuggingFaceArgs {
|
|
1553
|
+
interface AxAIHuggingFaceArgs<TModelKey> {
|
|
1538
1554
|
name: 'huggingface';
|
|
1539
1555
|
apiKey: string;
|
|
1540
1556
|
config?: Readonly<Partial<AxAIHuggingFaceConfig>>;
|
|
1541
1557
|
options?: Readonly<AxAIServiceOptions>;
|
|
1542
|
-
models?: AxAIInputModelList<AxAIHuggingFaceModel, undefined>;
|
|
1558
|
+
models?: AxAIInputModelList<AxAIHuggingFaceModel, undefined, TModelKey>;
|
|
1543
1559
|
}
|
|
1544
|
-
declare class AxAIHuggingFace extends AxBaseAI<AxAIHuggingFaceModel, unknown, AxAIHuggingFaceRequest, unknown, AxAIHuggingFaceResponse, unknown, unknown> {
|
|
1545
|
-
constructor({ apiKey, config, options, models, }: Readonly<Omit<AxAIHuggingFaceArgs
|
|
1560
|
+
declare class AxAIHuggingFace<TModelKey> extends AxBaseAI<AxAIHuggingFaceModel, unknown, AxAIHuggingFaceRequest, unknown, AxAIHuggingFaceResponse, unknown, unknown, TModelKey> {
|
|
1561
|
+
constructor({ apiKey, config, options, models, }: Readonly<Omit<AxAIHuggingFaceArgs<TModelKey>, 'name'>>);
|
|
1546
1562
|
}
|
|
1547
1563
|
|
|
1548
1564
|
/**
|
|
@@ -1626,20 +1642,20 @@ type AxAIMistralChatRequest = Omit<AxAIOpenAIChatRequest<AxAIMistralModel>, 'max
|
|
|
1626
1642
|
tool_call_id: string;
|
|
1627
1643
|
})[];
|
|
1628
1644
|
};
|
|
1629
|
-
type AxAIMistralArgs = AxAIOpenAIArgs<'mistral', AxAIMistralModel, AxAIMistralEmbedModels> & {
|
|
1645
|
+
type AxAIMistralArgs<TModelKey> = AxAIOpenAIArgs<'mistral', AxAIMistralModel, AxAIMistralEmbedModels, TModelKey> & {
|
|
1630
1646
|
options?: Readonly<AxAIServiceOptions> & {
|
|
1631
1647
|
tokensPerMinute?: number;
|
|
1632
1648
|
};
|
|
1633
1649
|
modelInfo?: AxModelInfo[];
|
|
1634
1650
|
};
|
|
1635
|
-
declare class AxAIMistral extends AxAIOpenAIBase<AxAIMistralModel, AxAIMistralEmbedModels> {
|
|
1636
|
-
constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIMistralArgs
|
|
1651
|
+
declare class AxAIMistral<TModelKey> extends AxAIOpenAIBase<AxAIMistralModel, AxAIMistralEmbedModels, TModelKey> {
|
|
1652
|
+
constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIMistralArgs<TModelKey>, 'name'>>);
|
|
1637
1653
|
private updateMessages;
|
|
1638
1654
|
}
|
|
1639
1655
|
|
|
1640
1656
|
declare const axModelInfoMistral: AxModelInfo[];
|
|
1641
1657
|
|
|
1642
|
-
type AxMockAIServiceConfig = {
|
|
1658
|
+
type AxMockAIServiceConfig<TModelKey> = {
|
|
1643
1659
|
name?: string;
|
|
1644
1660
|
id?: string;
|
|
1645
1661
|
modelInfo?: Partial<AxModelInfoWithProvider>;
|
|
@@ -1648,18 +1664,18 @@ type AxMockAIServiceConfig = {
|
|
|
1648
1664
|
functions?: boolean;
|
|
1649
1665
|
streaming?: boolean;
|
|
1650
1666
|
};
|
|
1651
|
-
models?: AxAIModelList
|
|
1667
|
+
models?: AxAIModelList<TModelKey>;
|
|
1652
1668
|
options?: AxAIServiceOptions;
|
|
1653
|
-
chatResponse?: AxChatResponse | ReadableStream<AxChatResponse> | (() => Promise<AxChatResponse | ReadableStream<AxChatResponse>>) | ((req: Readonly<AxChatRequest<unknown>>, options?: Readonly<
|
|
1669
|
+
chatResponse?: AxChatResponse | ReadableStream<AxChatResponse> | (() => Promise<AxChatResponse | ReadableStream<AxChatResponse>>) | ((req: Readonly<AxChatRequest<unknown>>, options?: Readonly<AxAIServiceOptions>) => Promise<AxChatResponse | ReadableStream<AxChatResponse>>);
|
|
1654
1670
|
embedResponse?: AxEmbedResponse | ((req: Readonly<AxEmbedRequest>) => AxEmbedResponse | Promise<AxEmbedResponse>);
|
|
1655
1671
|
shouldError?: boolean;
|
|
1656
1672
|
errorMessage?: string;
|
|
1657
1673
|
latencyMs?: number;
|
|
1658
1674
|
};
|
|
1659
|
-
declare class AxMockAIService implements AxAIService {
|
|
1675
|
+
declare class AxMockAIService<TModelKey> implements AxAIService<unknown, unknown, TModelKey> {
|
|
1660
1676
|
private readonly config;
|
|
1661
1677
|
private metrics;
|
|
1662
|
-
constructor(config?: AxMockAIServiceConfig);
|
|
1678
|
+
constructor(config?: AxMockAIServiceConfig<TModelKey>);
|
|
1663
1679
|
getLastUsedChatModel(): unknown;
|
|
1664
1680
|
getLastUsedEmbedModel(): unknown;
|
|
1665
1681
|
getLastUsedModelConfig(): AxModelConfig | undefined;
|
|
@@ -1669,23 +1685,28 @@ declare class AxMockAIService implements AxAIService {
|
|
|
1669
1685
|
functions: boolean;
|
|
1670
1686
|
streaming: boolean;
|
|
1671
1687
|
};
|
|
1672
|
-
getModelList(): AxAIModelList | undefined;
|
|
1688
|
+
getModelList(): AxAIModelList<TModelKey> | undefined;
|
|
1673
1689
|
getMetrics(): AxAIServiceMetrics;
|
|
1674
|
-
chat(req: Readonly<AxChatRequest<unknown>>, _options?: Readonly<
|
|
1675
|
-
embed(req: Readonly<AxEmbedRequest>, _options?: Readonly<
|
|
1690
|
+
chat(req: Readonly<AxChatRequest<unknown>>, _options?: Readonly<AxAIServiceOptions>): Promise<AxChatResponse | ReadableStream<AxChatResponse>>;
|
|
1691
|
+
embed(req: Readonly<AxEmbedRequest>, _options?: Readonly<AxAIServiceOptions>): Promise<AxEmbedResponse>;
|
|
1676
1692
|
setOptions(options: Readonly<AxAIServiceOptions>): void;
|
|
1677
1693
|
getOptions(): Readonly<AxAIServiceOptions>;
|
|
1678
1694
|
getLogger(): AxLoggerFunction;
|
|
1679
1695
|
private updateMetrics;
|
|
1680
1696
|
}
|
|
1681
1697
|
|
|
1682
|
-
type AxAIServiceListItem<TModel = unknown, TEmbedModel = unknown> = {
|
|
1683
|
-
key:
|
|
1684
|
-
service: AxAIService<TModel, TEmbedModel>;
|
|
1698
|
+
type AxAIServiceListItem<TModel = unknown, TEmbedModel = unknown, TModelKey = string> = {
|
|
1699
|
+
key: TModelKey;
|
|
1700
|
+
service: AxAIService<TModel, TEmbedModel, TModelKey>;
|
|
1685
1701
|
description: string;
|
|
1686
1702
|
isInternal?: boolean;
|
|
1687
1703
|
};
|
|
1688
|
-
|
|
1704
|
+
type ExtractServiceModelKeys<T> = T extends AxAIService<any, any, infer K> ? K : T extends AxAIServiceListItem<any, any, infer K> ? K : never;
|
|
1705
|
+
type ExtractAllModelKeys<T extends readonly any[]> = T extends readonly [
|
|
1706
|
+
infer First,
|
|
1707
|
+
...infer Rest
|
|
1708
|
+
] ? ExtractServiceModelKeys<First> | ExtractAllModelKeys<Rest> : never;
|
|
1709
|
+
declare class AxMultiServiceRouter<TServices extends readonly (AxAIService | AxAIServiceListItem<any, any, any>)[] = readonly AxAIService[], TModelKey = ExtractAllModelKeys<TServices>> implements AxAIService<unknown, unknown, TModelKey> {
|
|
1689
1710
|
private options?;
|
|
1690
1711
|
private lastUsedService?;
|
|
1691
1712
|
private services;
|
|
@@ -1694,18 +1715,22 @@ declare class AxMultiServiceRouter implements AxAIService<string, string> {
|
|
|
1694
1715
|
* It validates that each service provides a unique set of model keys,
|
|
1695
1716
|
* then builds a lookup (map) for routing the chat/embed requests.
|
|
1696
1717
|
*/
|
|
1697
|
-
constructor(services:
|
|
1698
|
-
|
|
1699
|
-
|
|
1718
|
+
constructor(services: TServices);
|
|
1719
|
+
/**
|
|
1720
|
+
* Static factory method for type-safe multi-service router creation with automatic model key inference.
|
|
1721
|
+
*/
|
|
1722
|
+
static create<const TServices extends readonly (AxAIService | AxAIServiceListItem<any, any, any>)[]>(services: TServices): AxMultiServiceRouter<TServices, ExtractAllModelKeys<TServices>>;
|
|
1723
|
+
getLastUsedChatModel(): unknown | undefined;
|
|
1724
|
+
getLastUsedEmbedModel(): unknown | undefined;
|
|
1700
1725
|
getLastUsedModelConfig(): AxModelConfig | undefined;
|
|
1701
1726
|
/**
|
|
1702
1727
|
* Delegates the chat call to the service matching the provided model key.
|
|
1703
1728
|
*/
|
|
1704
|
-
chat(req: Readonly<AxChatRequest<
|
|
1729
|
+
chat(req: Readonly<AxChatRequest<TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxChatResponse | ReadableStream<AxChatResponse>>;
|
|
1705
1730
|
/**
|
|
1706
1731
|
* Delegates the embed call to the service matching the provided embed model key.
|
|
1707
1732
|
*/
|
|
1708
|
-
embed(req: Readonly<AxEmbedRequest<
|
|
1733
|
+
embed(req: Readonly<AxEmbedRequest<TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxEmbedResponse>;
|
|
1709
1734
|
/**
|
|
1710
1735
|
* Returns a composite ID built from the IDs of the underlying services.
|
|
1711
1736
|
*/
|
|
@@ -1717,12 +1742,12 @@ declare class AxMultiServiceRouter implements AxAIService<string, string> {
|
|
|
1717
1742
|
/**
|
|
1718
1743
|
* Aggregates all available models across the underlying services.
|
|
1719
1744
|
*/
|
|
1720
|
-
getModelList(): AxAIModelList
|
|
1745
|
+
getModelList(): AxAIModelList<TModelKey>;
|
|
1721
1746
|
/**
|
|
1722
1747
|
* If a model key is provided, delegate to the corresponding service's features.
|
|
1723
1748
|
* Otherwise, returns a default feature set.
|
|
1724
1749
|
*/
|
|
1725
|
-
getFeatures(model?:
|
|
1750
|
+
getFeatures(model?: TModelKey): {
|
|
1726
1751
|
functions: boolean;
|
|
1727
1752
|
streaming: boolean;
|
|
1728
1753
|
functionCot?: boolean;
|
|
@@ -1752,19 +1777,19 @@ declare class AxMultiServiceRouter implements AxAIService<string, string> {
|
|
|
1752
1777
|
* @param key - The model key
|
|
1753
1778
|
* @param entry - The service entry to set
|
|
1754
1779
|
*/
|
|
1755
|
-
setServiceEntry(key:
|
|
1780
|
+
setServiceEntry(key: TModelKey, entry: {
|
|
1756
1781
|
isInternal?: boolean;
|
|
1757
1782
|
description: string;
|
|
1758
1783
|
model?: string;
|
|
1759
1784
|
embedModel?: string;
|
|
1760
|
-
service: AxAIService<
|
|
1785
|
+
service: AxAIService<unknown, unknown, TModelKey>;
|
|
1761
1786
|
}): void;
|
|
1762
1787
|
}
|
|
1763
1788
|
|
|
1764
1789
|
type AxAIOllamaAIConfig = AxAIOpenAIConfig<string, string>;
|
|
1765
1790
|
declare const axAIOllamaDefaultConfig: () => AxAIOllamaAIConfig;
|
|
1766
1791
|
declare const axAIOllamaDefaultCreativeConfig: () => AxAIOllamaAIConfig;
|
|
1767
|
-
type AxAIOllamaArgs = AxAIOpenAIArgs<'ollama', string, string> & {
|
|
1792
|
+
type AxAIOllamaArgs<TModelKey> = AxAIOpenAIArgs<'ollama', string, string, TModelKey> & {
|
|
1768
1793
|
model?: string;
|
|
1769
1794
|
embedModel?: string;
|
|
1770
1795
|
url?: string;
|
|
@@ -1772,8 +1797,8 @@ type AxAIOllamaArgs = AxAIOpenAIArgs<'ollama', string, string> & {
|
|
|
1772
1797
|
/**
|
|
1773
1798
|
* OllamaAI: AI Service
|
|
1774
1799
|
*/
|
|
1775
|
-
declare class AxAIOllama extends AxAIOpenAIBase<string, string> {
|
|
1776
|
-
constructor({ apiKey, url, config, options, models, }: Readonly<Omit<AxAIOllamaArgs
|
|
1800
|
+
declare class AxAIOllama<TModelKey> extends AxAIOpenAIBase<string, string, TModelKey> {
|
|
1801
|
+
constructor({ apiKey, url, config, options, models, }: Readonly<Omit<AxAIOllamaArgs<TModelKey>, 'name'>>);
|
|
1777
1802
|
}
|
|
1778
1803
|
|
|
1779
1804
|
/**
|
|
@@ -2293,7 +2318,7 @@ Readonly<AxAIOpenAIEmbedResponse>> {
|
|
|
2293
2318
|
getModelConfig(): Readonly<AxModelConfig>;
|
|
2294
2319
|
private mapInternalContentToResponsesInput;
|
|
2295
2320
|
private createResponsesReqInternalInput;
|
|
2296
|
-
createChatReq(req: Readonly<AxInternalChatRequest<TModel>>, config: Readonly<
|
|
2321
|
+
createChatReq(req: Readonly<AxInternalChatRequest<TModel>>, config: Readonly<AxAIServiceOptions>): [Readonly<AxAPI>, Readonly<AxAIOpenAIResponsesRequest<TModel>>];
|
|
2297
2322
|
createChatResp(resp: Readonly<AxAIOpenAIResponsesResponse>): Readonly<AxChatResponse>;
|
|
2298
2323
|
createChatStreamResp(streamEvent: Readonly<AxAIOpenAIResponsesResponseDelta>): Readonly<AxChatResponse>;
|
|
2299
2324
|
createEmbedReq(req: Readonly<AxInternalEmbedRequest<TEmbedModel>>): [AxAPI, AxAIOpenAIEmbedRequest<TEmbedModel>];
|
|
@@ -2302,7 +2327,7 @@ Readonly<AxAIOpenAIEmbedResponse>> {
|
|
|
2302
2327
|
declare const axAIOpenAIResponsesDefaultConfig: () => AxAIOpenAIResponsesConfig<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel>;
|
|
2303
2328
|
declare const axAIOpenAIResponsesBestConfig: () => AxAIOpenAIResponsesConfig<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel>;
|
|
2304
2329
|
declare const axAIOpenAIResponsesCreativeConfig: () => AxAIOpenAIResponsesConfig<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel>;
|
|
2305
|
-
interface AxAIOpenAIResponsesBaseArgs<TModel, TEmbedModel, TResponsesReq extends AxAIOpenAIResponsesRequest<TModel>> {
|
|
2330
|
+
interface AxAIOpenAIResponsesBaseArgs<TModel, TEmbedModel, TModelKey, TResponsesReq extends AxAIOpenAIResponsesRequest<TModel>> {
|
|
2306
2331
|
apiKey: string;
|
|
2307
2332
|
config: AxAIOpenAIResponsesConfig<TModel, TEmbedModel>;
|
|
2308
2333
|
options?: {
|
|
@@ -2310,27 +2335,27 @@ interface AxAIOpenAIResponsesBaseArgs<TModel, TEmbedModel, TResponsesReq extends
|
|
|
2310
2335
|
} & AxAIServiceOptions;
|
|
2311
2336
|
apiURL?: string;
|
|
2312
2337
|
modelInfo?: ReadonlyArray<AxModelInfo>;
|
|
2313
|
-
models?: AxAIInputModelList<TModel, TEmbedModel>;
|
|
2338
|
+
models?: AxAIInputModelList<TModel, TEmbedModel, TModelKey>;
|
|
2314
2339
|
responsesReqUpdater?: (req: Readonly<TResponsesReq>) => Readonly<TResponsesReq>;
|
|
2315
2340
|
supportFor?: AxAIFeatures | ((model: TModel) => AxAIFeatures);
|
|
2316
2341
|
}
|
|
2317
2342
|
/**
|
|
2318
2343
|
* Base class for OpenAI AI services using the /v1/responses API endpoint
|
|
2319
2344
|
*/
|
|
2320
|
-
declare class AxAIOpenAIResponsesBase<TModel, TEmbedModel, TResponsesReq extends AxAIOpenAIResponsesRequest<TModel>> extends AxBaseAI<TModel, TEmbedModel, AxAIOpenAIResponsesRequest<TModel>, AxAIOpenAIEmbedRequest<TEmbedModel>, AxAIOpenAIResponsesResponse, AxAIOpenAIResponsesResponseDelta, AxAIOpenAIEmbedResponse> {
|
|
2321
|
-
constructor({ apiKey, config, options, apiURL, modelInfo, models, responsesReqUpdater, supportFor, }: Readonly<AxAIOpenAIResponsesBaseArgs<TModel, TEmbedModel, TResponsesReq>>);
|
|
2345
|
+
declare class AxAIOpenAIResponsesBase<TModel, TEmbedModel, TModelKey, TResponsesReq extends AxAIOpenAIResponsesRequest<TModel>> extends AxBaseAI<TModel, TEmbedModel, AxAIOpenAIResponsesRequest<TModel>, AxAIOpenAIEmbedRequest<TEmbedModel>, AxAIOpenAIResponsesResponse, AxAIOpenAIResponsesResponseDelta, AxAIOpenAIEmbedResponse, TModelKey> {
|
|
2346
|
+
constructor({ apiKey, config, options, apiURL, modelInfo, models, responsesReqUpdater, supportFor, }: Readonly<AxAIOpenAIResponsesBaseArgs<TModel, TEmbedModel, TModelKey, TResponsesReq>>);
|
|
2322
2347
|
}
|
|
2323
2348
|
/**
|
|
2324
2349
|
* Ready-to-use implementation of the OpenAI Responses API client
|
|
2325
2350
|
* This class uses OpenAI's /v1/responses API endpoint which supports text, image, and audio inputs
|
|
2326
2351
|
*/
|
|
2327
|
-
interface AxAIOpenAIResponsesArgs<TName = 'openai-responses', TModel = AxAIOpenAIResponsesModel, TEmbedModel = AxAIOpenAIEmbedModel, TChatReq extends AxAIOpenAIResponsesRequest<TModel> = AxAIOpenAIResponsesRequest<TModel>> extends Omit<AxAIOpenAIResponsesBaseArgs<TModel, TEmbedModel, TChatReq>, 'config' | 'supportFor' | 'modelInfo'> {
|
|
2352
|
+
interface AxAIOpenAIResponsesArgs<TName = 'openai-responses', TModel = AxAIOpenAIResponsesModel, TEmbedModel = AxAIOpenAIEmbedModel, TModelKey = string, TChatReq extends AxAIOpenAIResponsesRequest<TModel> = AxAIOpenAIResponsesRequest<TModel>> extends Omit<AxAIOpenAIResponsesBaseArgs<TModel, TEmbedModel, TModelKey, TChatReq>, 'config' | 'supportFor' | 'modelInfo'> {
|
|
2328
2353
|
name: TName;
|
|
2329
2354
|
modelInfo?: AxModelInfo[];
|
|
2330
|
-
config?: Partial<AxAIOpenAIResponsesBaseArgs<TModel, TEmbedModel, TChatReq>['config']>;
|
|
2355
|
+
config?: Partial<AxAIOpenAIResponsesBaseArgs<TModel, TEmbedModel, TModelKey, TChatReq>['config']>;
|
|
2331
2356
|
}
|
|
2332
|
-
declare class AxAIOpenAIResponses extends AxAIOpenAIResponsesBase<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel, AxAIOpenAIResponsesRequest<AxAIOpenAIResponsesModel>> {
|
|
2333
|
-
constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIOpenAIResponsesArgs, 'name'>>);
|
|
2357
|
+
declare class AxAIOpenAIResponses<TModelKey = string> extends AxAIOpenAIResponsesBase<AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel, TModelKey, AxAIOpenAIResponsesRequest<AxAIOpenAIResponsesModel>> {
|
|
2358
|
+
constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIOpenAIResponsesArgs<'openai-responses', AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel, TModelKey>, 'name'>>);
|
|
2334
2359
|
}
|
|
2335
2360
|
|
|
2336
2361
|
declare enum AxAIRekaModel {
|
|
@@ -2404,7 +2429,7 @@ declare const axAIRekaDefaultConfig: () => AxAIRekaConfig;
|
|
|
2404
2429
|
declare const axAIRekaBestConfig: () => AxAIRekaConfig;
|
|
2405
2430
|
declare const axAIRekaCreativeConfig: () => AxAIRekaConfig;
|
|
2406
2431
|
declare const axAIRekaFastConfig: () => AxAIRekaConfig;
|
|
2407
|
-
interface AxAIRekaArgs {
|
|
2432
|
+
interface AxAIRekaArgs<TModelKey> {
|
|
2408
2433
|
name: 'reka';
|
|
2409
2434
|
apiKey: string;
|
|
2410
2435
|
apiURL?: string;
|
|
@@ -2413,10 +2438,10 @@ interface AxAIRekaArgs {
|
|
|
2413
2438
|
streamingUsage?: boolean;
|
|
2414
2439
|
}>;
|
|
2415
2440
|
modelInfo?: Readonly<AxModelInfo[]>;
|
|
2416
|
-
models?: AxAIInputModelList<AxAIRekaModel, undefined>;
|
|
2441
|
+
models?: AxAIInputModelList<AxAIRekaModel, undefined, TModelKey>;
|
|
2417
2442
|
}
|
|
2418
|
-
declare class AxAIReka extends AxBaseAI<AxAIRekaModel, undefined, AxAIRekaChatRequest, unknown, AxAIRekaChatResponse, AxAIRekaChatResponseDelta, unknown> {
|
|
2419
|
-
constructor({ apiKey, config, options, apiURL, modelInfo, models, }: Readonly<Omit<AxAIRekaArgs
|
|
2443
|
+
declare class AxAIReka<TModelKey> extends AxBaseAI<AxAIRekaModel, undefined, AxAIRekaChatRequest, unknown, AxAIRekaChatResponse, AxAIRekaChatResponseDelta, unknown, TModelKey> {
|
|
2444
|
+
constructor({ apiKey, config, options, apiURL, modelInfo, models, }: Readonly<Omit<AxAIRekaArgs<TModelKey>, 'name'>>);
|
|
2420
2445
|
}
|
|
2421
2446
|
|
|
2422
2447
|
/**
|
|
@@ -2426,9 +2451,9 @@ declare const axModelInfoReka: AxModelInfo[];
|
|
|
2426
2451
|
|
|
2427
2452
|
type TogetherAIConfig = AxAIOpenAIConfig<string, unknown>;
|
|
2428
2453
|
declare const axAITogetherDefaultConfig: () => TogetherAIConfig;
|
|
2429
|
-
type AxAITogetherArgs = AxAIOpenAIArgs<'together', string, unknown>;
|
|
2430
|
-
declare class AxAITogether extends AxAIOpenAIBase<string, unknown> {
|
|
2431
|
-
constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAITogetherArgs
|
|
2454
|
+
type AxAITogetherArgs<TModelKey> = AxAIOpenAIArgs<'together', string, unknown, TModelKey>;
|
|
2455
|
+
declare class AxAITogether<TModelKey> extends AxAIOpenAIBase<string, unknown, TModelKey> {
|
|
2456
|
+
constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAITogetherArgs<TModelKey>, 'name'>>);
|
|
2432
2457
|
}
|
|
2433
2458
|
|
|
2434
2459
|
declare const axModelInfoTogether: AxModelInfo[];
|
|
@@ -2447,30 +2472,6 @@ declare function axValidateChatRequestMessage(item: AxChatRequestMessage): void;
|
|
|
2447
2472
|
*/
|
|
2448
2473
|
declare function axValidateChatResponseResult(results: Readonly<AxChatResponseResult[]> | Readonly<AxChatResponseResult>): void;
|
|
2449
2474
|
|
|
2450
|
-
type AxAIArgs = AxAIOpenAIArgs | AxAIOpenAIResponsesArgs | AxAIAzureOpenAIArgs | AxAITogetherArgs | AxAIAnthropicArgs | AxAIGroqArgs | AxAIGoogleGeminiArgs | AxAICohereArgs | AxAIHuggingFaceArgs | AxAIMistralArgs | AxAIDeepSeekArgs | AxAIOllamaArgs | AxAIRekaArgs;
|
|
2451
|
-
type AxAIModels = AxAIOpenAIModel | AxAIAnthropicModel | AxAIGroqModel | AxAIGoogleGeminiModel | AxAICohereModel | AxAIHuggingFaceModel | AxAIMistralModel | AxAIDeepSeekModel;
|
|
2452
|
-
type AxAIEmbedModels = AxAIOpenAIEmbedModel | AxAIGoogleGeminiEmbedModel | AxAICohereEmbedModel;
|
|
2453
|
-
declare class AxAI implements AxAIService {
|
|
2454
|
-
private ai;
|
|
2455
|
-
constructor(options: Readonly<AxAIArgs>);
|
|
2456
|
-
getName(): string;
|
|
2457
|
-
getId(): string;
|
|
2458
|
-
getFeatures(model?: string): {
|
|
2459
|
-
functions: boolean;
|
|
2460
|
-
streaming: boolean;
|
|
2461
|
-
};
|
|
2462
|
-
getModelList(): AxAIModelList | undefined;
|
|
2463
|
-
getLastUsedChatModel(): unknown;
|
|
2464
|
-
getLastUsedEmbedModel(): unknown;
|
|
2465
|
-
getLastUsedModelConfig(): AxModelConfig | undefined;
|
|
2466
|
-
getMetrics(): AxAIServiceMetrics;
|
|
2467
|
-
chat(req: Readonly<AxChatRequest>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions>): Promise<AxChatResponse | ReadableStream<AxChatResponse>>;
|
|
2468
|
-
embed(req: Readonly<AxEmbedRequest>, options?: Readonly<AxAIServiceActionOptions & AxAIServiceActionOptions>): Promise<AxEmbedResponse>;
|
|
2469
|
-
setOptions(options: Readonly<AxAIServiceOptions>): void;
|
|
2470
|
-
getOptions(): Readonly<AxAIServiceOptions>;
|
|
2471
|
-
getLogger(): AxLoggerFunction;
|
|
2472
|
-
}
|
|
2473
|
-
|
|
2474
2475
|
declare enum AxAIGrokModel {
|
|
2475
2476
|
Grok3 = "grok-3",
|
|
2476
2477
|
Grok3Mini = "grok-3-mini",
|
|
@@ -2512,14 +2513,46 @@ type AxAIGrokChatRequest = AxAIOpenAIChatRequest<AxAIGrokModel> & {
|
|
|
2512
2513
|
sources?: AxAIGrokSearchSource[];
|
|
2513
2514
|
};
|
|
2514
2515
|
};
|
|
2515
|
-
type AxAIGrokArgs = AxAIOpenAIArgs<'grok', AxAIGrokModel, AxAIGrokEmbedModels, AxAIGrokChatRequest> & {
|
|
2516
|
+
type AxAIGrokArgs<TModelKey> = AxAIOpenAIArgs<'grok', AxAIGrokModel, AxAIGrokEmbedModels, TModelKey, AxAIGrokChatRequest> & {
|
|
2516
2517
|
options?: Readonly<AxAIServiceOptions & AxAIGrokOptionsTools> & {
|
|
2517
2518
|
tokensPerMinute?: number;
|
|
2518
2519
|
};
|
|
2519
2520
|
modelInfo?: AxModelInfo[];
|
|
2520
2521
|
};
|
|
2521
|
-
declare class AxAIGrok extends AxAIOpenAIBase<AxAIGrokModel, AxAIGrokEmbedModels, AxAIGrokChatRequest> {
|
|
2522
|
-
constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIGrokArgs
|
|
2522
|
+
declare class AxAIGrok<TModelKey> extends AxAIOpenAIBase<AxAIGrokModel, AxAIGrokEmbedModels, TModelKey, AxAIGrokChatRequest> {
|
|
2523
|
+
constructor({ apiKey, config, options, models, modelInfo, }: Readonly<Omit<AxAIGrokArgs<TModelKey>, 'name'>>);
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
type AxAIArgs<TModelKey> = AxAIOpenAIArgs<'openai', AxAIOpenAIModel, AxAIOpenAIEmbedModel, TModelKey> | AxAIOpenAIResponsesArgs<'openai-responses', AxAIOpenAIResponsesModel, AxAIOpenAIEmbedModel, TModelKey> | AxAIAzureOpenAIArgs<TModelKey> | AxAITogetherArgs<TModelKey> | AxAIAnthropicArgs<TModelKey> | AxAIGroqArgs<TModelKey> | AxAIGoogleGeminiArgs<TModelKey> | AxAICohereArgs<TModelKey> | AxAIHuggingFaceArgs<TModelKey> | AxAIMistralArgs<TModelKey> | AxAIDeepSeekArgs<TModelKey> | AxAIOllamaArgs<TModelKey> | AxAIRekaArgs<TModelKey> | AxAIGrokArgs<TModelKey>;
|
|
2527
|
+
type AxAIModels = AxAIOpenAIModel | AxAIAnthropicModel | AxAIGroqModel | AxAIGoogleGeminiModel | AxAICohereModel | AxAIHuggingFaceModel | AxAIMistralModel | AxAIDeepSeekModel | AxAIGrokModel;
|
|
2528
|
+
type AxAIEmbedModels = AxAIOpenAIEmbedModel | AxAIGoogleGeminiEmbedModel | AxAICohereEmbedModel;
|
|
2529
|
+
type ExtractModelKeysAndValues<T> = T extends readonly {
|
|
2530
|
+
key: infer K;
|
|
2531
|
+
model: infer M;
|
|
2532
|
+
}[] ? K | M : never;
|
|
2533
|
+
type InferTModelKey<T> = T extends {
|
|
2534
|
+
models: infer M;
|
|
2535
|
+
} ? ExtractModelKeysAndValues<M> : string;
|
|
2536
|
+
declare class AxAI<TModelKey = string> implements AxAIService<unknown, unknown, TModelKey> {
|
|
2537
|
+
private ai;
|
|
2538
|
+
static create<const T extends AxAIArgs<any>>(options: T): AxAI<InferTModelKey<T>>;
|
|
2539
|
+
constructor(options: Readonly<AxAIArgs<TModelKey>>);
|
|
2540
|
+
getName(): string;
|
|
2541
|
+
getId(): string;
|
|
2542
|
+
getFeatures(model?: string): {
|
|
2543
|
+
functions: boolean;
|
|
2544
|
+
streaming: boolean;
|
|
2545
|
+
};
|
|
2546
|
+
getModelList(): AxAIModelList<TModelKey> | undefined;
|
|
2547
|
+
getLastUsedChatModel(): unknown;
|
|
2548
|
+
getLastUsedEmbedModel(): unknown;
|
|
2549
|
+
getLastUsedModelConfig(): AxModelConfig | undefined;
|
|
2550
|
+
getMetrics(): AxAIServiceMetrics;
|
|
2551
|
+
chat(req: Readonly<AxChatRequest<TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxChatResponse | ReadableStream<AxChatResponse>>;
|
|
2552
|
+
embed(req: Readonly<AxEmbedRequest<TModelKey>>, options?: Readonly<AxAIServiceOptions>): Promise<AxEmbedResponse>;
|
|
2553
|
+
setOptions(options: Readonly<AxAIServiceOptions>): void;
|
|
2554
|
+
getOptions(): Readonly<AxAIServiceOptions>;
|
|
2555
|
+
getLogger(): AxLoggerFunction;
|
|
2523
2556
|
}
|
|
2524
2557
|
|
|
2525
2558
|
declare const axModelInfoGrok: AxModelInfo[];
|
|
@@ -2834,7 +2867,7 @@ declare class AxFunctionProcessor {
|
|
|
2834
2867
|
private funcList;
|
|
2835
2868
|
constructor(funcList: Readonly<AxFunction[]>);
|
|
2836
2869
|
private executeFunction;
|
|
2837
|
-
execute: (func: Readonly<AxChatResponseFunctionCall>, options?: Readonly<
|
|
2870
|
+
execute: <MODEL>(func: Readonly<AxChatResponseFunctionCall>, options?: Readonly<AxProgramForwardOptions<MODEL>>) => Promise<string>;
|
|
2838
2871
|
}
|
|
2839
2872
|
type AxInputFunctionType = (AxFunction | {
|
|
2840
2873
|
toFunction: () => AxFunction | AxFunction[];
|
|
@@ -2945,18 +2978,13 @@ type AxResultPickerFunctionFunctionResults = {
|
|
|
2945
2978
|
}[];
|
|
2946
2979
|
};
|
|
2947
2980
|
type AxResultPickerFunction<OUT extends AxGenOut> = (data: AxResultPickerFunctionFieldResults<OUT> | AxResultPickerFunctionFunctionResults) => number | Promise<number>;
|
|
2948
|
-
type AxProgramForwardOptions = {
|
|
2981
|
+
type AxProgramForwardOptions<MODEL> = AxAIServiceOptions & {
|
|
2949
2982
|
maxRetries?: number;
|
|
2950
2983
|
maxSteps?: number;
|
|
2951
2984
|
mem?: AxAIMemory;
|
|
2952
2985
|
ai?: AxAIService;
|
|
2953
2986
|
modelConfig?: AxModelConfig;
|
|
2954
|
-
model?:
|
|
2955
|
-
sessionId?: string;
|
|
2956
|
-
traceId?: string | undefined;
|
|
2957
|
-
tracer?: Tracer;
|
|
2958
|
-
rateLimiter?: AxRateLimiterFunction;
|
|
2959
|
-
stream?: boolean;
|
|
2987
|
+
model?: MODEL;
|
|
2960
2988
|
sampleCount?: number;
|
|
2961
2989
|
resultPicker?: AxResultPickerFunction<AxGenOut>;
|
|
2962
2990
|
functions?: AxInputFunctionType;
|
|
@@ -2964,12 +2992,8 @@ type AxProgramForwardOptions = {
|
|
|
2964
2992
|
stopFunction?: string;
|
|
2965
2993
|
functionResultFormatter?: (result: unknown) => string;
|
|
2966
2994
|
fastFail?: boolean;
|
|
2967
|
-
debug?: boolean;
|
|
2968
|
-
thinkingTokenBudget?: 'minimal' | 'low' | 'medium' | 'high' | 'highest' | 'none';
|
|
2969
2995
|
showThoughts?: boolean;
|
|
2970
2996
|
traceLabel?: string;
|
|
2971
|
-
abortSignal?: AbortSignal;
|
|
2972
|
-
logger?: AxLoggerFunction;
|
|
2973
2997
|
description?: string;
|
|
2974
2998
|
thoughtFieldName?: string;
|
|
2975
2999
|
promptTemplate?: typeof AxPromptTemplate;
|
|
@@ -2978,7 +3002,14 @@ type AxProgramForwardOptions = {
|
|
|
2978
3002
|
excludeContentFromTrace?: boolean;
|
|
2979
3003
|
strictMode?: boolean;
|
|
2980
3004
|
};
|
|
2981
|
-
type
|
|
3005
|
+
type AxAIServiceActionOptions<TModel = unknown, TEmbedModel = unknown, TModelKey = string> = AxAIServiceOptions & {
|
|
3006
|
+
ai?: Readonly<AxAIService<TModel, TEmbedModel, TModelKey>>;
|
|
3007
|
+
functionResultFormatter?: (result: unknown) => string;
|
|
3008
|
+
};
|
|
3009
|
+
type AxProgramStreamingForwardOptions<MODEL> = Omit<AxProgramForwardOptions<MODEL>, 'stream'>;
|
|
3010
|
+
type AxAIServiceModelType<T extends Readonly<AxAIService<any, any, any>>> = T extends Readonly<AxAIService<infer TModel, any, infer TModelKey>> ? TModel extends unknown ? TModelKey : TModel | TModelKey : never;
|
|
3011
|
+
type AxProgramForwardOptionsWithModels<T extends Readonly<AxAIService<any, any, any>>> = AxProgramForwardOptions<AxAIServiceModelType<T>>;
|
|
3012
|
+
type AxProgramStreamingForwardOptionsWithModels<T extends Readonly<AxAIService<any, any, any>>> = AxProgramStreamingForwardOptions<AxAIServiceModelType<T>>;
|
|
2982
3013
|
type AxGenDeltaOut<OUT extends AxGenOut> = {
|
|
2983
3014
|
version: number;
|
|
2984
3015
|
index: number;
|
|
@@ -2986,9 +3017,9 @@ type AxGenDeltaOut<OUT extends AxGenOut> = {
|
|
|
2986
3017
|
};
|
|
2987
3018
|
type AxGenStreamingOut<OUT extends AxGenOut> = AsyncGenerator<AxGenDeltaOut<OUT>, void, unknown>;
|
|
2988
3019
|
type AxSetExamplesOptions = {};
|
|
2989
|
-
interface AxForwardable<IN extends AxGenIn, OUT extends AxGenOut> {
|
|
2990
|
-
forward(ai: Readonly<AxAIService>, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramForwardOptions
|
|
2991
|
-
streamingForward(ai: Readonly<AxAIService>, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramStreamingForwardOptions
|
|
3020
|
+
interface AxForwardable<IN extends AxGenIn, OUT extends AxGenOut, TModelKey> {
|
|
3021
|
+
forward(ai: Readonly<AxAIService>, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramForwardOptions<TModelKey>>): Promise<OUT>;
|
|
3022
|
+
streamingForward(ai: Readonly<AxAIService>, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramStreamingForwardOptions<TModelKey>>): AxGenStreamingOut<OUT>;
|
|
2992
3023
|
}
|
|
2993
3024
|
interface AxTunable<IN extends AxGenIn, OUT extends AxGenOut> {
|
|
2994
3025
|
setExamples: (examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>) => void;
|
|
@@ -3001,7 +3032,7 @@ interface AxUsable {
|
|
|
3001
3032
|
getUsage: () => AxProgramUsage[];
|
|
3002
3033
|
resetUsage: () => void;
|
|
3003
3034
|
}
|
|
3004
|
-
interface AxProgrammable<IN extends AxGenIn, OUT extends AxGenOut> extends AxForwardable<IN, OUT>, AxTunable<IN, OUT>, AxUsable {
|
|
3035
|
+
interface AxProgrammable<IN extends AxGenIn, OUT extends AxGenOut, TModelKey = string> extends AxForwardable<IN, OUT, TModelKey>, AxTunable<IN, OUT>, AxUsable {
|
|
3005
3036
|
getSignature: () => AxSignature;
|
|
3006
3037
|
}
|
|
3007
3038
|
type AxProgramUsage = AxChatResponse['modelUsage'] & {
|
|
@@ -3115,7 +3146,7 @@ declare class AxGen<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOu
|
|
|
3115
3146
|
private streamingFieldProcessors;
|
|
3116
3147
|
private excludeContentFromTrace;
|
|
3117
3148
|
private thoughtFieldName;
|
|
3118
|
-
constructor(signature: NonNullable<ConstructorParameters<typeof AxSignature>[0]>, options?: Readonly<AxProgramForwardOptions
|
|
3149
|
+
constructor(signature: NonNullable<ConstructorParameters<typeof AxSignature>[0]>, options?: Readonly<AxProgramForwardOptions<any>>);
|
|
3119
3150
|
private getSignatureName;
|
|
3120
3151
|
private getMetricsInstruments;
|
|
3121
3152
|
updateMeter(meter?: Meter): void;
|
|
@@ -3128,9 +3159,9 @@ declare class AxGen<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOu
|
|
|
3128
3159
|
private forwardSendRequest;
|
|
3129
3160
|
private forwardCore;
|
|
3130
3161
|
private _forward2;
|
|
3131
|
-
_forward1(ai: Readonly<AxAIService>, values: IN | AxMessage<IN>[], options: Readonly<AxProgramForwardOptions
|
|
3132
|
-
forward
|
|
3133
|
-
streamingForward
|
|
3162
|
+
_forward1(ai: Readonly<AxAIService>, values: IN | AxMessage<IN>[], options: Readonly<AxProgramForwardOptions<any>>): AxGenStreamingOut<OUT>;
|
|
3163
|
+
forward<T extends Readonly<AxAIService>>(ai: T, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramForwardOptionsWithModels<T>>): Promise<OUT>;
|
|
3164
|
+
streamingForward<T extends Readonly<AxAIService>>(ai: T, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramStreamingForwardOptionsWithModels<T>>): AxGenStreamingOut<OUT>;
|
|
3134
3165
|
setExamples(examples: Readonly<AxProgramExamples<IN, OUT>>, options?: Readonly<AxSetExamplesOptions>): void;
|
|
3135
3166
|
private isDebug;
|
|
3136
3167
|
private getLogger;
|
|
@@ -3201,8 +3232,8 @@ declare class AxDBManager {
|
|
|
3201
3232
|
}
|
|
3202
3233
|
|
|
3203
3234
|
declare class AxDefaultResultReranker extends AxGen<AxRerankerIn, AxRerankerOut> {
|
|
3204
|
-
constructor(options?: Readonly<AxProgramForwardOptions
|
|
3205
|
-
forward:
|
|
3235
|
+
constructor(options?: Readonly<AxProgramForwardOptions<string>>);
|
|
3236
|
+
forward: <T extends Readonly<AxAIService>>(ai: T, input: Readonly<AxRerankerIn>, options?: Readonly<AxProgramForwardOptionsWithModels<T>>) => Promise<AxRerankerOut>;
|
|
3206
3237
|
}
|
|
3207
3238
|
|
|
3208
3239
|
interface AxApacheTikaArgs {
|
|
@@ -4293,11 +4324,11 @@ interface AxFlowNodeDefinition {
|
|
|
4293
4324
|
}
|
|
4294
4325
|
type AxFlowStepFunction = (state: AxFlowState, context: Readonly<{
|
|
4295
4326
|
mainAi: AxAIService;
|
|
4296
|
-
mainOptions?: AxProgramForwardOptions
|
|
4327
|
+
mainOptions?: AxProgramForwardOptions<string>;
|
|
4297
4328
|
}>) => Promise<AxFlowState> | AxFlowState;
|
|
4298
|
-
interface AxFlowDynamicContext {
|
|
4299
|
-
ai?:
|
|
4300
|
-
options?: AxProgramForwardOptions
|
|
4329
|
+
interface AxFlowDynamicContext<T extends Readonly<AxAIService>> {
|
|
4330
|
+
ai?: T;
|
|
4331
|
+
options?: AxProgramForwardOptions<NonNullable<ReturnType<T['getModelList']>>[number]['key']>;
|
|
4301
4332
|
}
|
|
4302
4333
|
type GetGenIn<T extends AxProgrammable<AxGenIn, AxGenOut>> = T extends AxProgrammable<infer IN, AxGenOut> ? IN : never;
|
|
4303
4334
|
type GetGenOut<T extends AxProgrammable<AxGenIn, AxGenOut>> = T extends AxProgrammable<AxGenIn, infer OUT> ? OUT : never;
|
|
@@ -4314,20 +4345,20 @@ interface AxFlowable<IN extends AxGenIn, OUT extends AxGenOut> extends AxProgram
|
|
|
4314
4345
|
}
|
|
4315
4346
|
type AxFlowTypedParallelBranch<TNodes extends Record<string, AxProgrammable<any, any>>, TState extends AxFlowState> = (subFlow: AxFlowTypedSubContext<TNodes, TState>) => AxFlowTypedSubContext<TNodes, AxFlowState>;
|
|
4316
4347
|
interface AxFlowTypedSubContext<TNodes extends Record<string, AxProgrammable<any, any>>, TState extends AxFlowState> {
|
|
4317
|
-
execute<TNodeName extends keyof TNodes & string
|
|
4348
|
+
execute<TNodeName extends keyof TNodes & string, TAI extends Readonly<AxAIService>>(nodeName: TNodeName, mapping: (state: TState) => GetGenIn<TNodes[TNodeName]>, dynamicContext?: AxFlowDynamicContext<TAI>): AxFlowTypedSubContext<TNodes, AddNodeResult<TState, TNodeName, GetGenOut<TNodes[TNodeName]>>>;
|
|
4318
4349
|
map<TNewState extends AxFlowState>(transform: (state: TState) => TNewState): AxFlowTypedSubContext<TNodes, TNewState>;
|
|
4319
4350
|
executeSteps(initialState: TState, context: Readonly<{
|
|
4320
4351
|
mainAi: AxAIService;
|
|
4321
|
-
mainOptions?: AxProgramForwardOptions
|
|
4352
|
+
mainOptions?: AxProgramForwardOptions<string>;
|
|
4322
4353
|
}>): Promise<AxFlowState>;
|
|
4323
4354
|
}
|
|
4324
4355
|
type AxFlowParallelBranch = (subFlow: AxFlowSubContext) => AxFlowSubContext;
|
|
4325
4356
|
interface AxFlowSubContext {
|
|
4326
|
-
execute(nodeName: string, mapping: (state: AxFlowState) => Record<string, AxFieldValue>, dynamicContext?: AxFlowDynamicContext): this;
|
|
4357
|
+
execute<TAI extends Readonly<AxAIService>>(nodeName: string, mapping: (state: AxFlowState) => Record<string, AxFieldValue>, dynamicContext?: AxFlowDynamicContext<TAI>): this;
|
|
4327
4358
|
map(transform: (state: AxFlowState) => AxFlowState): this;
|
|
4328
|
-
executeSteps(initialState: AxFlowState, context: Readonly<{
|
|
4329
|
-
mainAi:
|
|
4330
|
-
mainOptions?: AxProgramForwardOptions
|
|
4359
|
+
executeSteps<TAI extends Readonly<AxAIService>>(initialState: AxFlowState, context: Readonly<{
|
|
4360
|
+
mainAi: TAI;
|
|
4361
|
+
mainOptions?: AxProgramForwardOptions<NonNullable<ReturnType<TAI['getModelList']>>[number]['key']>;
|
|
4331
4362
|
}>): Promise<AxFlowState>;
|
|
4332
4363
|
}
|
|
4333
4364
|
interface AxFlowBranchContext {
|
|
@@ -4601,6 +4632,8 @@ TState extends AxFlowState = IN> implements AxFlowable<IN, OUT> {
|
|
|
4601
4632
|
private readonly autoParallelConfig;
|
|
4602
4633
|
private readonly executionPlanner;
|
|
4603
4634
|
private program?;
|
|
4635
|
+
private nodeUsage;
|
|
4636
|
+
private nodeTraces;
|
|
4604
4637
|
/**
|
|
4605
4638
|
* Converts a string to camelCase for valid field names
|
|
4606
4639
|
*/
|
|
@@ -4640,7 +4673,26 @@ TState extends AxFlowState = IN> implements AxFlowable<IN, OUT> {
|
|
|
4640
4673
|
setDemos(demos: readonly AxProgramDemos<IN, OUT>[]): void;
|
|
4641
4674
|
getUsage(): AxProgramUsage[];
|
|
4642
4675
|
resetUsage(): void;
|
|
4643
|
-
|
|
4676
|
+
/**
|
|
4677
|
+
* Resets trace tracking for the flow.
|
|
4678
|
+
* This is called automatically on each forward/streamingForward call.
|
|
4679
|
+
*/
|
|
4680
|
+
resetTraces(): void;
|
|
4681
|
+
/**
|
|
4682
|
+
* Gets a detailed usage report broken down by node name.
|
|
4683
|
+
* This provides visibility into which nodes are consuming the most tokens.
|
|
4684
|
+
*
|
|
4685
|
+
* @returns Object mapping node names to their usage statistics
|
|
4686
|
+
*/
|
|
4687
|
+
getUsageReport(): Record<string, AxProgramUsage[]>;
|
|
4688
|
+
/**
|
|
4689
|
+
* Gets a detailed trace report broken down by node name.
|
|
4690
|
+
* This provides visibility into the execution traces for each node.
|
|
4691
|
+
*
|
|
4692
|
+
* @returns Object mapping node names to their trace data
|
|
4693
|
+
*/
|
|
4694
|
+
getTracesReport(): Record<string, AxProgramTrace<any, any>[]>;
|
|
4695
|
+
streamingForward<T extends Readonly<AxAIService>>(ai: T, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramStreamingForwardOptionsWithModels<T>>): AxGenStreamingOut<OUT>;
|
|
4644
4696
|
/**
|
|
4645
4697
|
* Executes the flow with the given AI service and input values.
|
|
4646
4698
|
*
|
|
@@ -4671,7 +4723,7 @@ TState extends AxFlowState = IN> implements AxFlowable<IN, OUT> {
|
|
|
4671
4723
|
* @param options - Optional forward options to use as defaults (includes autoParallel override)
|
|
4672
4724
|
* @returns Promise that resolves to the final output
|
|
4673
4725
|
*/
|
|
4674
|
-
forward
|
|
4726
|
+
forward<T extends Readonly<AxAIService>>(ai: T, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramForwardOptionsWithModels<T> & {
|
|
4675
4727
|
autoParallel?: boolean;
|
|
4676
4728
|
}>): Promise<OUT>;
|
|
4677
4729
|
/**
|
|
@@ -4680,7 +4732,6 @@ TState extends AxFlowState = IN> implements AxFlowable<IN, OUT> {
|
|
|
4680
4732
|
*
|
|
4681
4733
|
* @param name - The name of the node
|
|
4682
4734
|
* @param signature - Signature string in the same format as AxSignature
|
|
4683
|
-
* @param options - Optional program forward options (same as AxGen)
|
|
4684
4735
|
* @returns New AxFlow instance with updated TNodes type
|
|
4685
4736
|
*
|
|
4686
4737
|
* @example
|
|
@@ -4689,7 +4740,7 @@ TState extends AxFlowState = IN> implements AxFlowable<IN, OUT> {
|
|
|
4689
4740
|
* flow.node('analyzer', 'text:string -> analysis:string, confidence:number', { debug: true })
|
|
4690
4741
|
* ```
|
|
4691
4742
|
*/
|
|
4692
|
-
node<TName extends string, TSig extends string>(name: TName, signature: TSig
|
|
4743
|
+
node<TName extends string, TSig extends string>(name: TName, signature: TSig): AxFlow<IN, OUT, TNodes & {
|
|
4693
4744
|
[K in TName]: InferAxGen<TSig>;
|
|
4694
4745
|
}, // Add new node to registry
|
|
4695
4746
|
TState>;
|
|
@@ -4699,7 +4750,6 @@ TState extends AxFlowState = IN> implements AxFlowable<IN, OUT> {
|
|
|
4699
4750
|
*
|
|
4700
4751
|
* @param name - The name of the node
|
|
4701
4752
|
* @param signature - AxSignature instance to use for this node
|
|
4702
|
-
* @param options - Optional program forward options (same as AxGen)
|
|
4703
4753
|
* @returns New AxFlow instance with updated TNodes type
|
|
4704
4754
|
*
|
|
4705
4755
|
* @example
|
|
@@ -4708,7 +4758,7 @@ TState extends AxFlowState = IN> implements AxFlowable<IN, OUT> {
|
|
|
4708
4758
|
* flow.node('summarizer', sig, { temperature: 0.1 })
|
|
4709
4759
|
* ```
|
|
4710
4760
|
*/
|
|
4711
|
-
node<TName extends string>(name: TName, signature: AxSignature
|
|
4761
|
+
node<TName extends string>(name: TName, signature: AxSignature): AxFlow<IN, OUT, TNodes & {
|
|
4712
4762
|
[K in TName]: AxGen<AxGenIn, AxGenOut>;
|
|
4713
4763
|
}, // Add new node to registry
|
|
4714
4764
|
TState>;
|
|
@@ -4747,10 +4797,10 @@ TState extends AxFlowState = IN> implements AxFlowable<IN, OUT> {
|
|
|
4747
4797
|
/**
|
|
4748
4798
|
* Short alias for node() - supports signature strings, AxSignature instances, AxGen instances, and program classes
|
|
4749
4799
|
*/
|
|
4750
|
-
n<TName extends string, TSig extends string>(name: TName, signature: TSig
|
|
4800
|
+
n<TName extends string, TSig extends string>(name: TName, signature: TSig): AxFlow<IN, OUT, TNodes & {
|
|
4751
4801
|
[K in TName]: InferAxGen<TSig>;
|
|
4752
4802
|
}, TState>;
|
|
4753
|
-
n<TName extends string>(name: TName, signature: AxSignature
|
|
4803
|
+
n<TName extends string>(name: TName, signature: AxSignature): AxFlow<IN, OUT, TNodes & {
|
|
4754
4804
|
[K in TName]: AxGen<AxGenIn, AxGenOut>;
|
|
4755
4805
|
}, TState>;
|
|
4756
4806
|
n<TName extends string, TProgram extends new () => AxProgrammable<any, any>>(name: TName, programClass: TProgram): AxFlow<IN, OUT, TNodes & {
|
|
@@ -4835,11 +4885,11 @@ TState extends AxFlowState = IN> implements AxFlowable<IN, OUT> {
|
|
|
4835
4885
|
* flow.execute('summarizer', state => ({ text: state.originalText }), { ai: cheapAI })
|
|
4836
4886
|
* ```
|
|
4837
4887
|
*/
|
|
4838
|
-
execute<TNodeName extends keyof TNodes & string
|
|
4888
|
+
execute<TNodeName extends keyof TNodes & string, TAI extends Readonly<AxAIService>>(nodeName: TNodeName, mapping: (_state: TState) => GetGenIn<TNodes[TNodeName]>, dynamicContext?: AxFlowDynamicContext<TAI>): AxFlow<IN, OUT, TNodes, AddNodeResult<TState, TNodeName, GetGenOut<TNodes[TNodeName]>>>;
|
|
4839
4889
|
/**
|
|
4840
4890
|
* Short alias for execute()
|
|
4841
4891
|
*/
|
|
4842
|
-
e<TNodeName extends keyof TNodes & string
|
|
4892
|
+
e<TNodeName extends keyof TNodes & string, TAI extends Readonly<AxAIService>>(nodeName: TNodeName, mapping: (_state: TState) => GetGenIn<TNodes[TNodeName]>, dynamicContext?: AxFlowDynamicContext<TAI>): AxFlow<IN, OUT, TNodes, AddNodeResult<TState, TNodeName, GetGenOut<TNodes[TNodeName]>>>;
|
|
4843
4893
|
/**
|
|
4844
4894
|
* Starts a conditional branch based on a predicate function.
|
|
4845
4895
|
*
|
|
@@ -5050,12 +5100,12 @@ TState extends AxFlowState = IN> implements AxFlowable<IN, OUT> {
|
|
|
5050
5100
|
declare class AxFlowSubContextImpl implements AxFlowSubContext {
|
|
5051
5101
|
private readonly nodeGenerators;
|
|
5052
5102
|
private readonly steps;
|
|
5053
|
-
constructor(nodeGenerators: Map<string, AxForwardable<AxGenIn, AxGenOut> & AxTunable<AxGenIn, AxGenOut> & AxUsable>);
|
|
5054
|
-
execute(nodeName: string, mapping: (state: AxFlowState) => Record<string, AxFieldValue>, dynamicContext?: AxFlowDynamicContext): this;
|
|
5103
|
+
constructor(nodeGenerators: Map<string, AxForwardable<AxGenIn, AxGenOut, string> & AxTunable<AxGenIn, AxGenOut> & AxUsable>);
|
|
5104
|
+
execute<TAI extends Readonly<AxAIService>>(nodeName: string, mapping: (state: AxFlowState) => Record<string, AxFieldValue>, dynamicContext?: AxFlowDynamicContext<TAI>): this;
|
|
5055
5105
|
map(transform: (state: AxFlowState) => AxFlowState): this;
|
|
5056
5106
|
executeSteps(initialState: AxFlowState, context: Readonly<{
|
|
5057
5107
|
mainAi: AxAIService;
|
|
5058
|
-
mainOptions?: AxProgramForwardOptions
|
|
5108
|
+
mainOptions?: AxProgramForwardOptions<string>;
|
|
5059
5109
|
}>): Promise<AxFlowState>;
|
|
5060
5110
|
}
|
|
5061
5111
|
/**
|
|
@@ -5065,11 +5115,11 @@ declare class AxFlowTypedSubContextImpl<TNodes extends Record<string, AxGen<any,
|
|
|
5065
5115
|
private readonly nodeGenerators;
|
|
5066
5116
|
private readonly steps;
|
|
5067
5117
|
constructor(nodeGenerators: Map<string, AxGen<AxGenIn, AxGenOut> | AxProgram<AxGenIn, AxGenOut>>);
|
|
5068
|
-
execute<TNodeName extends keyof TNodes & string
|
|
5118
|
+
execute<TNodeName extends keyof TNodes & string, TAI extends Readonly<AxAIService>>(nodeName: TNodeName, mapping: (state: TState) => GetGenIn<TNodes[TNodeName]>, dynamicContext?: AxFlowDynamicContext<TAI>): AxFlowTypedSubContext<TNodes, AddNodeResult<TState, TNodeName, GetGenOut<TNodes[TNodeName]>>>;
|
|
5069
5119
|
map<TNewState extends AxFlowState>(transform: (state: TState) => TNewState): AxFlowTypedSubContext<TNodes, TNewState>;
|
|
5070
5120
|
executeSteps(initialState: TState, context: Readonly<{
|
|
5071
5121
|
mainAi: AxAIService;
|
|
5072
|
-
mainOptions?: AxProgramForwardOptions
|
|
5122
|
+
mainOptions?: AxProgramForwardOptions<string>;
|
|
5073
5123
|
}>): Promise<AxFlowState>;
|
|
5074
5124
|
}
|
|
5075
5125
|
|
|
@@ -5185,7 +5235,7 @@ declare class AxEmbeddingAdapter {
|
|
|
5185
5235
|
description: string;
|
|
5186
5236
|
argumentDescription: string;
|
|
5187
5237
|
}>;
|
|
5188
|
-
func: (args: readonly number[], extra?: Readonly<
|
|
5238
|
+
func: (args: readonly number[], extra?: Readonly<AxAIServiceOptions>) => Promise<unknown>;
|
|
5189
5239
|
}>);
|
|
5190
5240
|
private embedAdapter;
|
|
5191
5241
|
toFunction(): AxFunction;
|
|
@@ -5409,7 +5459,7 @@ interface AxAgentic<IN extends AxGenIn, OUT extends AxGenOut> extends AxProgramm
|
|
|
5409
5459
|
getFunction(): AxFunction;
|
|
5410
5460
|
getFeatures(): AxAgentFeatures;
|
|
5411
5461
|
}
|
|
5412
|
-
type AxAgentOptions = Omit<AxProgramForwardOptions
|
|
5462
|
+
type AxAgentOptions = Omit<AxProgramForwardOptions<string>, 'functions'> & {
|
|
5413
5463
|
disableSmartModelRouting?: boolean;
|
|
5414
5464
|
/** List of field names that should not be automatically passed from parent to child agents */
|
|
5415
5465
|
excludeFieldsFromPassthrough?: string[];
|
|
@@ -5460,8 +5510,8 @@ declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut> implements AxAge
|
|
|
5460
5510
|
* Initializes the agent's execution context, processing child agents and their functions.
|
|
5461
5511
|
*/
|
|
5462
5512
|
private init;
|
|
5463
|
-
forward
|
|
5464
|
-
streamingForward
|
|
5513
|
+
forward<T extends Readonly<AxAIService>>(parentAi: T, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramForwardOptionsWithModels<T>>): Promise<OUT>;
|
|
5514
|
+
streamingForward<T extends Readonly<AxAIService>>(parentAi: T, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramStreamingForwardOptionsWithModels<T>>): AxGenStreamingOut<OUT>;
|
|
5465
5515
|
/**
|
|
5466
5516
|
* Updates the agent's description.
|
|
5467
5517
|
* This updates both the stored description and the function's description.
|
|
@@ -5477,7 +5527,7 @@ declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut> implements AxAge
|
|
|
5477
5527
|
}
|
|
5478
5528
|
|
|
5479
5529
|
declare class AxChainOfThought<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOut> extends AxGen<IN, OUT> {
|
|
5480
|
-
constructor(signature: Readonly<AxSignature | string>, options?: Readonly<AxProgramForwardOptions & {
|
|
5530
|
+
constructor(signature: Readonly<AxSignature | string>, options?: Readonly<AxProgramForwardOptions<string> & {
|
|
5481
5531
|
setVisibleReasoning?: boolean;
|
|
5482
5532
|
}>);
|
|
5483
5533
|
}
|
|
@@ -5491,16 +5541,16 @@ declare class AxRAG extends AxChainOfThought<{
|
|
|
5491
5541
|
private genQuery;
|
|
5492
5542
|
private queryFn;
|
|
5493
5543
|
private maxHops;
|
|
5494
|
-
constructor(queryFn: (query: string) => Promise<string>, options: Readonly<AxProgramForwardOptions & {
|
|
5544
|
+
constructor(queryFn: (query: string) => Promise<string>, options: Readonly<AxProgramForwardOptions<string> & {
|
|
5495
5545
|
maxHops?: number;
|
|
5496
5546
|
}>);
|
|
5497
|
-
forward
|
|
5547
|
+
forward<T extends Readonly<AxAIService>>(ai: T, values: {
|
|
5498
5548
|
context: string[];
|
|
5499
5549
|
question: string;
|
|
5500
5550
|
} | AxMessage<{
|
|
5501
5551
|
context: string[];
|
|
5502
5552
|
question: string;
|
|
5503
|
-
}>[], options?: Readonly<
|
|
5553
|
+
}>[], options?: Readonly<AxProgramForwardOptionsWithModels<T>>): Promise<{
|
|
5504
5554
|
answer: string;
|
|
5505
5555
|
}>;
|
|
5506
5556
|
}
|
|
@@ -5576,4 +5626,4 @@ declare class AxRateLimiterTokenUsage {
|
|
|
5576
5626
|
acquire(tokens: number): Promise<void>;
|
|
5577
5627
|
}
|
|
5578
5628
|
|
|
5579
|
-
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, type AxFlowAutoParallelConfig, type AxFlowBranchContext, AxFlowDependencyAnalyzer, type AxFlowDynamicContext, AxFlowExecutionPlanner, type AxFlowExecutionStep, type AxFlowNodeDefinition, type AxFlowParallelBranch, type AxFlowParallelGroup, type AxFlowState, type AxFlowStepFunction, type AxFlowSubContext, AxFlowSubContextImpl, type AxFlowTypedParallelBranch, type AxFlowTypedSubContext, AxFlowTypedSubContextImpl, type AxFlowable, type AxForwardable, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, type AxFunctionResult, type AxFunctionResultFormatter, 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, AxLLMRequestTypeValues, type AxLoggerData, type AxLoggerFunction, AxMCPClient, type AxMCPFunctionDescription, AxMCPHTTPSSETransport, type AxMCPInitializeParams, type AxMCPInitializeResult, type AxMCPJSONRPCErrorResponse, type AxMCPJSONRPCNotification, type AxMCPJSONRPCRequest, type AxMCPJSONRPCResponse, type AxMCPJSONRPCSuccessResponse, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPToolsListResult, 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 AxOptimizerLoggerData, type AxOptimizerLoggerFunction, type AxOptimizerMetricsConfig, type AxOptimizerMetricsInstruments, type AxOptimizerResult, type AxParetoResult, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramOptions, type AxProgramStreamingForwardOptions, type AxProgramTrace, type AxProgramUsage, type AxProgrammable, 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, axCreateDefaultColorLogger, axCreateDefaultOptimizerColorLogger, axCreateDefaultOptimizerTextLogger, axCreateDefaultTextLogger, 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 };
|
|
5629
|
+
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, 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, type AxAIServiceModelType, 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, type AxFlowAutoParallelConfig, type AxFlowBranchContext, AxFlowDependencyAnalyzer, type AxFlowDynamicContext, AxFlowExecutionPlanner, type AxFlowExecutionStep, type AxFlowNodeDefinition, type AxFlowParallelBranch, type AxFlowParallelGroup, type AxFlowState, type AxFlowStepFunction, type AxFlowSubContext, AxFlowSubContextImpl, type AxFlowTypedParallelBranch, type AxFlowTypedSubContext, AxFlowTypedSubContextImpl, type AxFlowable, type AxForwardable, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, type AxFunctionResult, type AxFunctionResultFormatter, 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, AxLLMRequestTypeValues, type AxLoggerData, type AxLoggerFunction, AxMCPClient, type AxMCPFunctionDescription, AxMCPHTTPSSETransport, type AxMCPInitializeParams, type AxMCPInitializeResult, type AxMCPJSONRPCErrorResponse, type AxMCPJSONRPCNotification, type AxMCPJSONRPCRequest, type AxMCPJSONRPCResponse, type AxMCPJSONRPCSuccessResponse, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPToolsListResult, 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 AxOptimizerLoggerData, type AxOptimizerLoggerFunction, type AxOptimizerMetricsConfig, type AxOptimizerMetricsInstruments, type AxOptimizerResult, type AxParetoResult, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramForwardOptionsWithModels, type AxProgramOptions, type AxProgramStreamingForwardOptions, type AxProgramStreamingForwardOptionsWithModels, type AxProgramTrace, type AxProgramUsage, type AxProgrammable, 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, axCreateDefaultColorLogger, axCreateDefaultOptimizerColorLogger, axCreateDefaultOptimizerTextLogger, axCreateDefaultTextLogger, 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 };
|