@ax-llm/ax 10.0.49 → 11.0.0
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 +189 -117
- package/index.cjs.map +1 -1
- package/index.d.cts +80 -103
- package/index.d.ts +80 -103
- package/index.js +189 -117
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -61,7 +61,11 @@ declare class AxAIServiceAuthenticationError extends AxAIServiceError {
|
|
|
61
61
|
constructor(url: string, requestBody?: unknown, context?: Record<string, unknown>);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
type
|
|
64
|
+
type AxAIModelList<T = string> = {
|
|
65
|
+
key: string;
|
|
66
|
+
model: T;
|
|
67
|
+
description: string;
|
|
68
|
+
}[];
|
|
65
69
|
type AxModelInfo = {
|
|
66
70
|
name: string;
|
|
67
71
|
currency?: string;
|
|
@@ -251,11 +255,8 @@ interface AxAIService {
|
|
|
251
255
|
getName(): string;
|
|
252
256
|
getModelInfo(): Readonly<AxModelInfoWithProvider>;
|
|
253
257
|
getEmbedModelInfo(): Readonly<AxModelInfoWithProvider> | undefined;
|
|
254
|
-
getFeatures(model?: string):
|
|
255
|
-
|
|
256
|
-
streaming: boolean;
|
|
257
|
-
};
|
|
258
|
-
getModelMap(): AxAIModelMap | undefined;
|
|
258
|
+
getFeatures(model?: string): AxAIFeatures;
|
|
259
|
+
getModelList(): AxAIModelList | undefined;
|
|
259
260
|
getMetrics(): AxAIServiceMetrics;
|
|
260
261
|
chat(req: Readonly<AxChatRequest>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions>): Promise<AxChatResponse | ReadableStream$1<AxChatResponse>>;
|
|
261
262
|
embed(req: Readonly<AxEmbedRequest>, options?: Readonly<AxAIServiceActionOptions & AxAIServiceActionOptions>): Promise<AxEmbedResponse>;
|
|
@@ -271,22 +272,23 @@ interface AxAIServiceImpl<TChatRequest, TEmbedRequest, TChatResponse, TChatRespo
|
|
|
271
272
|
getModelConfig(): AxModelConfig;
|
|
272
273
|
}
|
|
273
274
|
|
|
274
|
-
interface
|
|
275
|
+
interface AxAIFeatures {
|
|
275
276
|
functions: boolean;
|
|
276
277
|
streaming: boolean;
|
|
278
|
+
functionCot?: boolean;
|
|
277
279
|
}
|
|
278
280
|
interface AxBaseAIArgs {
|
|
279
281
|
name: string;
|
|
280
282
|
apiURL: string;
|
|
281
283
|
headers: () => Promise<Record<string, string>>;
|
|
282
284
|
modelInfo: Readonly<AxModelInfo[]>;
|
|
283
|
-
|
|
285
|
+
defaults: Readonly<{
|
|
284
286
|
model: string;
|
|
285
287
|
embedModel?: string;
|
|
286
288
|
}>;
|
|
287
289
|
options?: Readonly<AxAIServiceOptions>;
|
|
288
|
-
supportFor:
|
|
289
|
-
|
|
290
|
+
supportFor: AxAIFeatures | ((model: string) => AxAIFeatures);
|
|
291
|
+
models?: AxAIModelList;
|
|
290
292
|
}
|
|
291
293
|
declare class AxBaseAI<TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse> implements AxAIService {
|
|
292
294
|
private readonly aiImpl;
|
|
@@ -294,17 +296,17 @@ declare class AxBaseAI<TChatRequest, TEmbedRequest, TChatResponse, TChatResponse
|
|
|
294
296
|
private rt?;
|
|
295
297
|
private fetch?;
|
|
296
298
|
private tracer?;
|
|
297
|
-
private
|
|
299
|
+
private models?;
|
|
298
300
|
private modelInfo;
|
|
299
301
|
private modelUsage?;
|
|
300
302
|
private embedModelUsage?;
|
|
301
|
-
private
|
|
303
|
+
private defaults;
|
|
302
304
|
protected apiURL: string;
|
|
303
305
|
protected name: string;
|
|
304
306
|
protected headers: () => Promise<Record<string, string>>;
|
|
305
|
-
protected supportFor:
|
|
307
|
+
protected supportFor: AxAIFeatures | ((model: string) => AxAIFeatures);
|
|
306
308
|
private metrics;
|
|
307
|
-
constructor(aiImpl: Readonly<AxAIServiceImpl<TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse>>, { name, apiURL, headers, modelInfo,
|
|
309
|
+
constructor(aiImpl: Readonly<AxAIServiceImpl<TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse>>, { name, apiURL, headers, modelInfo, defaults, options, supportFor, models, }: Readonly<AxBaseAIArgs>);
|
|
308
310
|
setName(name: string): void;
|
|
309
311
|
setAPIURL(apiURL: string): void;
|
|
310
312
|
setHeaders(headers: () => Promise<Record<string, string>>): void;
|
|
@@ -312,9 +314,9 @@ declare class AxBaseAI<TChatRequest, TEmbedRequest, TChatResponse, TChatResponse
|
|
|
312
314
|
getOptions(): Readonly<AxAIServiceOptions>;
|
|
313
315
|
getModelInfo(): Readonly<AxModelInfoWithProvider>;
|
|
314
316
|
getEmbedModelInfo(): AxModelInfoWithProvider | undefined;
|
|
315
|
-
|
|
317
|
+
getModelList(): AxAIModelList | undefined;
|
|
316
318
|
getName(): string;
|
|
317
|
-
getFeatures(model?: string):
|
|
319
|
+
getFeatures(model?: string): AxAIFeatures;
|
|
318
320
|
private calculatePercentile;
|
|
319
321
|
private updateLatencyMetrics;
|
|
320
322
|
private updateErrorMetrics;
|
|
@@ -524,10 +526,10 @@ interface AxAIAnthropicArgs {
|
|
|
524
526
|
region?: string;
|
|
525
527
|
config?: Readonly<Partial<AxAIAnthropicConfig>>;
|
|
526
528
|
options?: Readonly<AxAIServiceOptions>;
|
|
527
|
-
|
|
529
|
+
models?: AxAIModelList<AxAIAnthropicModel | string>;
|
|
528
530
|
}
|
|
529
531
|
declare class AxAIAnthropic extends AxBaseAI<AxAIAnthropicChatRequest, unknown, AxAIAnthropicChatResponse, AxAIAnthropicChatResponseDelta, unknown> {
|
|
530
|
-
constructor({ apiKey, projectId, region, config, options,
|
|
532
|
+
constructor({ apiKey, projectId, region, config, options, models, }: Readonly<Omit<AxAIAnthropicArgs, 'name'>>);
|
|
531
533
|
}
|
|
532
534
|
|
|
533
535
|
declare enum AxAIOpenAIModel {
|
|
@@ -550,9 +552,9 @@ declare enum AxAIOpenAIEmbedModel {
|
|
|
550
552
|
TextEmbedding3Small = "text-embedding-3-small",
|
|
551
553
|
TextEmbedding3Large = "text-embedding-3-large"
|
|
552
554
|
}
|
|
553
|
-
type AxAIOpenAIConfig = Omit<AxModelConfig, 'topK'> & {
|
|
554
|
-
model:
|
|
555
|
-
embedModel?:
|
|
555
|
+
type AxAIOpenAIConfig<TModel, TEmbedModel> = Omit<AxModelConfig, 'topK'> & {
|
|
556
|
+
model: TModel | string;
|
|
557
|
+
embedModel?: TEmbedModel | string;
|
|
556
558
|
user?: string;
|
|
557
559
|
responseFormat?: 'json_object';
|
|
558
560
|
bestOf?: number;
|
|
@@ -712,33 +714,29 @@ type AxAIOpenAIEmbedResponse = {
|
|
|
712
714
|
usage: AxAIOpenAIUsage;
|
|
713
715
|
};
|
|
714
716
|
|
|
715
|
-
interface AxAIOpenAIArgs {
|
|
716
|
-
name:
|
|
717
|
+
interface AxAIOpenAIArgs<TName = 'openai', TConfig = AxAIOpenAIConfig<AxAIOpenAIModel | string, AxAIOpenAIEmbedModel | string>, TModels = AxAIOpenAIModel | AxAIOpenAIEmbedModel> {
|
|
718
|
+
name: TName;
|
|
717
719
|
apiKey: string;
|
|
718
720
|
apiURL?: string;
|
|
719
|
-
config?: Readonly<Partial<
|
|
721
|
+
config?: Readonly<Partial<TConfig>>;
|
|
720
722
|
options?: Readonly<AxAIServiceOptions & {
|
|
721
723
|
streamingUsage?: boolean;
|
|
722
724
|
}>;
|
|
723
725
|
modelInfo?: Readonly<AxModelInfo[]>;
|
|
724
|
-
|
|
726
|
+
models?: AxAIModelList<TModels | string>;
|
|
725
727
|
}
|
|
726
|
-
declare class AxAIOpenAI extends AxBaseAI<AxAIOpenAIChatRequest, AxAIOpenAIEmbedRequest, AxAIOpenAIChatResponse, AxAIOpenAIChatResponseDelta, AxAIOpenAIEmbedResponse> {
|
|
727
|
-
constructor({ apiKey, config, options, apiURL, modelInfo,
|
|
728
|
+
declare class AxAIOpenAI<TArgs extends Omit<AxAIOpenAIArgs, 'name'> = Omit<AxAIOpenAIArgs, 'name'>, TModel = AxAIOpenAIModel, TEmbedModel = AxAIOpenAIEmbedModel> extends AxBaseAI<AxAIOpenAIChatRequest, AxAIOpenAIEmbedRequest, AxAIOpenAIChatResponse, AxAIOpenAIChatResponseDelta, AxAIOpenAIEmbedResponse> {
|
|
729
|
+
constructor({ apiKey, config, options, apiURL, modelInfo, models, }: Readonly<TArgs>);
|
|
728
730
|
}
|
|
729
731
|
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
apiKey: string;
|
|
732
|
+
type AxAIAzureOpenAIConfig = AxAIOpenAIConfig<AxAIOpenAIModel, AxAIOpenAIEmbedModel>;
|
|
733
|
+
type AxAIAzureOpenAIArgs = AxAIOpenAIArgs<'azure-openai', AxAIAzureOpenAIConfig, AxAIOpenAIModel | AxAIOpenAIEmbedModel> & {
|
|
733
734
|
resourceName: string;
|
|
734
735
|
deploymentName: string;
|
|
735
736
|
version?: string;
|
|
736
|
-
|
|
737
|
-
options?: Readonly<AxAIServiceOptions>;
|
|
738
|
-
modelMap?: Record<string, AxAIOpenAIModel | AxAIOpenAIEmbedModel>;
|
|
739
|
-
}
|
|
737
|
+
};
|
|
740
738
|
declare class AxAIAzureOpenAI extends AxAIOpenAI {
|
|
741
|
-
constructor({ apiKey, resourceName, deploymentName, version, config, options,
|
|
739
|
+
constructor({ apiKey, resourceName, deploymentName, version, config, options, models, }: Readonly<Omit<AxAIAzureOpenAIArgs, 'name'>>);
|
|
742
740
|
}
|
|
743
741
|
|
|
744
742
|
/**
|
|
@@ -845,10 +843,10 @@ interface AxAICohereArgs {
|
|
|
845
843
|
apiKey: string;
|
|
846
844
|
config?: Readonly<Partial<AxAICohereConfig>>;
|
|
847
845
|
options?: Readonly<AxAIServiceOptions>;
|
|
848
|
-
|
|
846
|
+
models?: AxAIModelList<AxAICohereModel | AxAICohereEmbedModel | string>;
|
|
849
847
|
}
|
|
850
848
|
declare class AxAICohere extends AxBaseAI<AxAICohereChatRequest, AxAICohereEmbedRequest, AxAICohereChatResponse, AxAICohereChatResponseDelta, AxAICohereEmbedResponse> {
|
|
851
|
-
constructor({ apiKey, config, options,
|
|
849
|
+
constructor({ apiKey, config, options, models, }: Readonly<Omit<AxAICohereArgs, 'name'>>);
|
|
852
850
|
}
|
|
853
851
|
|
|
854
852
|
/**
|
|
@@ -859,19 +857,17 @@ declare enum AxAIDeepSeekModel {
|
|
|
859
857
|
DeepSeekCoder = "deepseek-coder"
|
|
860
858
|
}
|
|
861
859
|
|
|
862
|
-
type DeepSeekConfig = AxAIOpenAIConfig
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
apiKey:
|
|
866
|
-
config?: Readonly<Partial<DeepSeekConfig>>;
|
|
867
|
-
options?: Readonly<AxAIServiceOptions>;
|
|
868
|
-
modelMap?: Record<string, AxAIDeepSeekModel | string>;
|
|
869
|
-
}
|
|
870
|
-
declare class AxAIDeepSeek extends AxAIOpenAI {
|
|
871
|
-
constructor({ apiKey, config, options, modelMap, }: Readonly<Omit<AxAIDeepSeekArgs, 'name'>>);
|
|
860
|
+
type DeepSeekConfig = AxAIOpenAIConfig<AxAIDeepSeekModel, undefined>;
|
|
861
|
+
type AxAIDeepSeekArgs = AxAIOpenAIArgs<'deepseek', DeepSeekConfig, AxAIDeepSeekModel>;
|
|
862
|
+
declare class AxAIDeepSeek extends AxAIOpenAI<Omit<AxAIDeepSeekArgs, 'name'>, AxAIDeepSeekModel> {
|
|
863
|
+
constructor({ apiKey, config, options, models, }: Readonly<Omit<AxAIDeepSeekArgs, 'name'>>);
|
|
872
864
|
}
|
|
873
865
|
|
|
874
866
|
declare enum AxAIGoogleGeminiModel {
|
|
867
|
+
Gemini20Pro = "gemini-2.0-pro-exp-02-05",
|
|
868
|
+
Gemini20Flash = "gemini-2.0-flash",
|
|
869
|
+
Gemini20FlashLite = "gemini-2.0-flash-lite-preview-02-05",
|
|
870
|
+
Gemini20FlashThinking = "gemini-2.0-flash-thinking-exp-01-21",
|
|
875
871
|
Gemini1Pro = "gemini-1.0-pro",
|
|
876
872
|
Gemini15Flash = "gemini-1.5-flash",
|
|
877
873
|
Gemini15Flash8B = "gemini-1.5-flash-8b",
|
|
@@ -1060,13 +1056,13 @@ interface AxAIGoogleGeminiArgs {
|
|
|
1060
1056
|
region?: string;
|
|
1061
1057
|
config?: Readonly<Partial<AxAIGoogleGeminiConfig>>;
|
|
1062
1058
|
options?: Readonly<AxAIServiceOptions & AxAIGoogleGeminiOptionsTools>;
|
|
1063
|
-
|
|
1059
|
+
models?: AxAIModelList<AxAIGoogleGeminiModel | AxAIGoogleGeminiEmbedModel | string>;
|
|
1064
1060
|
}
|
|
1065
1061
|
/**
|
|
1066
1062
|
* AxAIGoogleGemini: AI Service
|
|
1067
1063
|
*/
|
|
1068
1064
|
declare class AxAIGoogleGemini extends AxBaseAI<AxAIGoogleGeminiChatRequest, AxAIGoogleGeminiBatchEmbedRequest | AxAIGoogleVertexBatchEmbedRequest, AxAIGoogleGeminiChatResponse, AxAIGoogleGeminiChatResponseDelta, AxAIGoogleGeminiBatchEmbedResponse | AxAIGoogleVertexBatchEmbedResponse> {
|
|
1069
|
-
constructor({ apiKey, projectId, region, config, options,
|
|
1065
|
+
constructor({ apiKey, projectId, region, config, options, models, }: Readonly<Omit<AxAIGoogleGeminiArgs, 'name'>>);
|
|
1070
1066
|
}
|
|
1071
1067
|
|
|
1072
1068
|
declare enum AxAIGroqModel {
|
|
@@ -1076,18 +1072,14 @@ declare enum AxAIGroqModel {
|
|
|
1076
1072
|
Gemma2_9B = "gemma2-9b-it"
|
|
1077
1073
|
}
|
|
1078
1074
|
|
|
1079
|
-
type AxAIGroqAIConfig = AxAIOpenAIConfig
|
|
1080
|
-
|
|
1081
|
-
name: 'groq';
|
|
1082
|
-
apiKey: string;
|
|
1083
|
-
config?: Readonly<Partial<AxAIGroqAIConfig>>;
|
|
1075
|
+
type AxAIGroqAIConfig = AxAIOpenAIConfig<AxAIGroqModel, undefined>;
|
|
1076
|
+
type AxAIGroqArgs = AxAIOpenAIArgs<'groq', AxAIGroqAIConfig, AxAIGroqModel> & {
|
|
1084
1077
|
options?: Readonly<AxAIServiceOptions> & {
|
|
1085
1078
|
tokensPerMinute?: number;
|
|
1086
1079
|
};
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
constructor({ apiKey, config, options, modelMap, }: Readonly<Omit<AxAIGroqArgs, 'groq'>>);
|
|
1080
|
+
};
|
|
1081
|
+
declare class AxAIGroq extends AxAIOpenAI<Omit<AxAIGroqArgs, 'name'>, AxAIGroqModel> {
|
|
1082
|
+
constructor({ apiKey, config, options, models, }: Readonly<Omit<AxAIGroqArgs, 'name'>>);
|
|
1091
1083
|
setOptions: (options: Readonly<AxAIServiceOptions>) => void;
|
|
1092
1084
|
private newRateLimiter;
|
|
1093
1085
|
}
|
|
@@ -1131,10 +1123,10 @@ interface AxAIHuggingFaceArgs {
|
|
|
1131
1123
|
apiKey: string;
|
|
1132
1124
|
config?: Readonly<Partial<AxAIHuggingFaceConfig>>;
|
|
1133
1125
|
options?: Readonly<AxAIServiceOptions>;
|
|
1134
|
-
|
|
1126
|
+
models?: AxAIModelList<AxAIHuggingFaceModel>;
|
|
1135
1127
|
}
|
|
1136
1128
|
declare class AxAIHuggingFace extends AxBaseAI<AxAIHuggingFaceRequest, unknown, AxAIHuggingFaceResponse, unknown, unknown> {
|
|
1137
|
-
constructor({ apiKey, config, options,
|
|
1129
|
+
constructor({ apiKey, config, options, models, }: Readonly<Omit<AxAIHuggingFaceArgs, 'name'>>);
|
|
1138
1130
|
}
|
|
1139
1131
|
|
|
1140
1132
|
declare enum AxAIMistralModel {
|
|
@@ -1151,34 +1143,27 @@ declare enum AxAIMistralEmbedModels {
|
|
|
1151
1143
|
MistralEmbed = "mistral-embed"
|
|
1152
1144
|
}
|
|
1153
1145
|
|
|
1154
|
-
type
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
}
|
|
1162
|
-
declare class AxAIMistral extends AxAIOpenAI {
|
|
1163
|
-
constructor({ apiKey, config, options, modelMap, }: Readonly<Omit<AxAIMistralArgs, 'name'>>);
|
|
1146
|
+
type AxAIMistralConfig = AxAIOpenAIConfig<AxAIMistralModel, AxAIMistralEmbedModels>;
|
|
1147
|
+
type AxAIMistralArgs = AxAIOpenAIArgs<'mistral', AxAIMistralConfig, AxAIMistralModel | AxAIMistralEmbedModels> & {
|
|
1148
|
+
options?: Readonly<AxAIServiceOptions> & {
|
|
1149
|
+
tokensPerMinute?: number;
|
|
1150
|
+
};
|
|
1151
|
+
};
|
|
1152
|
+
declare class AxAIMistral extends AxAIOpenAI<Omit<AxAIMistralArgs, 'name'>, AxAIMistralModel | AxAIMistralEmbedModels> {
|
|
1153
|
+
constructor({ apiKey, config, options, models, }: Readonly<Omit<AxAIMistralArgs, 'name'>>);
|
|
1164
1154
|
}
|
|
1165
1155
|
|
|
1166
|
-
type AxAIOllamaAIConfig = AxAIOpenAIConfig
|
|
1167
|
-
type AxAIOllamaArgs = {
|
|
1168
|
-
name: 'ollama';
|
|
1156
|
+
type AxAIOllamaAIConfig = AxAIOpenAIConfig<string, undefined>;
|
|
1157
|
+
type AxAIOllamaArgs = AxAIOpenAIArgs<'ollama', AxAIOllamaAIConfig, string> & {
|
|
1169
1158
|
model?: string;
|
|
1170
1159
|
embedModel?: string;
|
|
1171
1160
|
url?: string;
|
|
1172
|
-
apiKey?: string;
|
|
1173
|
-
config?: Readonly<Partial<AxAIOllamaAIConfig>>;
|
|
1174
|
-
options?: Readonly<AxAIServiceOptions>;
|
|
1175
|
-
modelMap?: Record<string, string>;
|
|
1176
1161
|
};
|
|
1177
1162
|
/**
|
|
1178
1163
|
* OllamaAI: AI Service
|
|
1179
1164
|
*/
|
|
1180
|
-
declare class AxAIOllama extends AxAIOpenAI {
|
|
1181
|
-
constructor({ apiKey, url, config, options,
|
|
1165
|
+
declare class AxAIOllama extends AxAIOpenAI<Omit<AxAIOllamaArgs, 'name'>, string> {
|
|
1166
|
+
constructor({ apiKey, url, config, options, models, }: Readonly<Omit<AxAIOllamaArgs, 'name'>>);
|
|
1182
1167
|
}
|
|
1183
1168
|
|
|
1184
1169
|
declare enum AxAIRekaModel {
|
|
@@ -1257,22 +1242,16 @@ interface AxAIRekaArgs {
|
|
|
1257
1242
|
streamingUsage?: boolean;
|
|
1258
1243
|
}>;
|
|
1259
1244
|
modelInfo?: Readonly<AxModelInfo[]>;
|
|
1260
|
-
|
|
1245
|
+
models?: AxAIModelList<AxAIRekaModel | string>;
|
|
1261
1246
|
}
|
|
1262
1247
|
declare class AxAIReka extends AxBaseAI<AxAIRekaChatRequest, unknown, AxAIRekaChatResponse, AxAIRekaChatResponseDelta, unknown> {
|
|
1263
|
-
constructor({ apiKey, config, options, apiURL, modelInfo,
|
|
1248
|
+
constructor({ apiKey, config, options, apiURL, modelInfo, models, }: Readonly<Omit<AxAIRekaArgs, 'name'>>);
|
|
1264
1249
|
}
|
|
1265
1250
|
|
|
1266
|
-
type TogetherAIConfig = AxAIOpenAIConfig
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
apiKey:
|
|
1270
|
-
config?: Readonly<Partial<TogetherAIConfig>>;
|
|
1271
|
-
options?: Readonly<AxAIServiceOptions>;
|
|
1272
|
-
modelMap?: Record<string, string>;
|
|
1273
|
-
}
|
|
1274
|
-
declare class AxAITogether extends AxAIOpenAI {
|
|
1275
|
-
constructor({ apiKey, config, options, modelMap, }: Readonly<Omit<AxAITogetherArgs, 'name'>>);
|
|
1251
|
+
type TogetherAIConfig = AxAIOpenAIConfig<string, undefined>;
|
|
1252
|
+
type AxAITogetherArgs = AxAIOpenAIArgs<'together', TogetherAIConfig, string>;
|
|
1253
|
+
declare class AxAITogether extends AxAIOpenAI<Omit<AxAITogetherArgs, 'name'>, string> {
|
|
1254
|
+
constructor({ apiKey, config, options, models, }: Readonly<Omit<AxAITogetherArgs, 'name'>>);
|
|
1276
1255
|
}
|
|
1277
1256
|
|
|
1278
1257
|
type AxAIArgs = AxAIOpenAIArgs | AxAIAzureOpenAIArgs | AxAITogetherArgs | AxAIAnthropicArgs | AxAIGroqArgs | AxAIGoogleGeminiArgs | AxAICohereArgs | AxAIHuggingFaceArgs | AxAIMistralArgs | AxAIDeepSeekArgs | AxAIOllamaArgs | AxAIRekaArgs;
|
|
@@ -1288,7 +1267,7 @@ declare class AxAI implements AxAIService {
|
|
|
1288
1267
|
functions: boolean;
|
|
1289
1268
|
streaming: boolean;
|
|
1290
1269
|
};
|
|
1291
|
-
|
|
1270
|
+
getModelList(): AxAIModelList | undefined;
|
|
1292
1271
|
getMetrics(): AxAIServiceMetrics;
|
|
1293
1272
|
chat(req: Readonly<AxChatRequest>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions>): Promise<AxChatResponse | ReadableStream$1<AxChatResponse>>;
|
|
1294
1273
|
embed(req: Readonly<AxEmbedRequest>, options?: Readonly<AxAIServiceActionOptions & AxAIServiceActionOptions>): Promise<AxEmbedResponse>;
|
|
@@ -1630,10 +1609,11 @@ interface AxAgentic extends AxTunable, AxUsable {
|
|
|
1630
1609
|
getFunction(): AxFunction;
|
|
1631
1610
|
}
|
|
1632
1611
|
type AxAgentOptions = Omit<AxGenOptions, 'functions'>;
|
|
1633
|
-
declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut> implements AxAgentic {
|
|
1612
|
+
declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut = AxGenOut> implements AxAgentic {
|
|
1634
1613
|
private ai?;
|
|
1635
1614
|
private signature;
|
|
1636
1615
|
private program;
|
|
1616
|
+
private functions?;
|
|
1637
1617
|
private agents?;
|
|
1638
1618
|
private name;
|
|
1639
1619
|
private description;
|
|
@@ -1659,8 +1639,8 @@ declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut> implements AxAge
|
|
|
1659
1639
|
resetUsage(): void;
|
|
1660
1640
|
getFunction(): AxFunction;
|
|
1661
1641
|
private init;
|
|
1662
|
-
forward(
|
|
1663
|
-
streamingForward(
|
|
1642
|
+
forward(parentAi: Readonly<AxAIService>, values: IN, options?: Readonly<AxProgramForwardOptions>): Promise<OUT>;
|
|
1643
|
+
streamingForward(parentAi: Readonly<AxAIService>, values: IN, options?: Readonly<AxProgramStreamingForwardOptions>): AxGenStreamingOut<OUT>;
|
|
1664
1644
|
}
|
|
1665
1645
|
|
|
1666
1646
|
interface AxApacheTikaArgs {
|
|
@@ -1705,16 +1685,13 @@ declare class AxBalancer implements AxAIService {
|
|
|
1705
1685
|
* Service comparator that sorts services by cost.
|
|
1706
1686
|
*/
|
|
1707
1687
|
static costComparator: (a: AxAIService, b: AxAIService) => number;
|
|
1708
|
-
|
|
1688
|
+
getModelList(): AxAIModelList | undefined;
|
|
1709
1689
|
private getNextService;
|
|
1710
1690
|
private reset;
|
|
1711
1691
|
getName(): string;
|
|
1712
1692
|
getModelInfo(): Readonly<AxModelInfoWithProvider>;
|
|
1713
1693
|
getEmbedModelInfo(): Readonly<AxModelInfoWithProvider> | undefined;
|
|
1714
|
-
getFeatures(model?: string):
|
|
1715
|
-
functions: boolean;
|
|
1716
|
-
streaming: boolean;
|
|
1717
|
-
};
|
|
1694
|
+
getFeatures(model?: string): AxAIFeatures;
|
|
1718
1695
|
getMetrics(): AxAIServiceMetrics;
|
|
1719
1696
|
chat(req: Readonly<AxChatRequest>, options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions> | undefined): Promise<AxChatResponse | ReadableStream$1<AxChatResponse>>;
|
|
1720
1697
|
embed(req: Readonly<AxEmbedRequest>, options?: Readonly<AxAIServiceActionOptions> | undefined): Promise<AxEmbedResponse>;
|
|
@@ -2203,7 +2180,7 @@ declare class AxMockAIService implements AxAIService {
|
|
|
2203
2180
|
functions?: boolean;
|
|
2204
2181
|
streaming?: boolean;
|
|
2205
2182
|
};
|
|
2206
|
-
|
|
2183
|
+
models?: AxAIModelList;
|
|
2207
2184
|
chatResponse?: AxChatResponse | ((req: Readonly<AxChatRequest>) => AxChatResponse | Promise<AxChatResponse>);
|
|
2208
2185
|
embedResponse?: AxEmbedResponse | ((req: Readonly<AxEmbedRequest>) => AxEmbedResponse | Promise<AxEmbedResponse>);
|
|
2209
2186
|
shouldError?: boolean;
|
|
@@ -2217,7 +2194,7 @@ declare class AxMockAIService implements AxAIService {
|
|
|
2217
2194
|
functions: boolean;
|
|
2218
2195
|
streaming: boolean;
|
|
2219
2196
|
};
|
|
2220
|
-
|
|
2197
|
+
getModelList(): AxAIModelList | undefined;
|
|
2221
2198
|
getMetrics(): AxAIServiceMetrics;
|
|
2222
2199
|
chat(req: Readonly<AxChatRequest>, _options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions>): Promise<AxChatResponse | ReadableStream<AxChatResponse>>;
|
|
2223
2200
|
embed(req: Readonly<AxEmbedRequest>, _options?: Readonly<AxAIServiceActionOptions>): Promise<AxEmbedResponse>;
|
|
@@ -2246,4 +2223,4 @@ declare class AxRAG extends AxChainOfThought<{
|
|
|
2246
2223
|
}>;
|
|
2247
2224
|
}
|
|
2248
2225
|
|
|
2249
|
-
export { AxAI, AxAIAnthropic, type AxAIAnthropicArgs, type AxAIAnthropicChatError, type AxAIAnthropicChatRequest, type AxAIAnthropicChatRequestCacheParam, type AxAIAnthropicChatResponse, type AxAIAnthropicChatResponseDelta, type AxAIAnthropicConfig, type AxAIAnthropicContentBlockDeltaEvent, type AxAIAnthropicContentBlockStartEvent, type AxAIAnthropicContentBlockStopEvent, type AxAIAnthropicErrorEvent, type AxAIAnthropicMessageDeltaEvent, type AxAIAnthropicMessageStartEvent, type AxAIAnthropicMessageStopEvent, AxAIAnthropicModel, type AxAIAnthropicPingEvent, AxAIAnthropicVertexModel, type AxAIArgs, AxAIAzureOpenAI, type AxAIAzureOpenAIArgs, 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, AxAIGoogleGemini, type AxAIGoogleGeminiArgs, type AxAIGoogleGeminiBatchEmbedRequest, type AxAIGoogleGeminiBatchEmbedResponse, type AxAIGoogleGeminiChatRequest, type AxAIGoogleGeminiChatResponse, type AxAIGoogleGeminiChatResponseDelta, type AxAIGoogleGeminiConfig, type AxAIGoogleGeminiContent, AxAIGoogleGeminiEmbedModel, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, type AxAIGoogleGeminiToolGoogleSearchRetrieval, type AxAIGoogleVertexBatchEmbedRequest, type AxAIGoogleVertexBatchEmbedResponse, AxAIGroq, type AxAIGroqArgs, AxAIGroqModel, AxAIHuggingFace, type AxAIHuggingFaceArgs, type AxAIHuggingFaceConfig, AxAIHuggingFaceModel, type AxAIHuggingFaceRequest, type AxAIHuggingFaceResponse, type AxAIMemory, AxAIMistral, type AxAIMistralArgs, AxAIMistralEmbedModels, AxAIMistralModel, type
|
|
2226
|
+
export { AxAI, AxAIAnthropic, type AxAIAnthropicArgs, type AxAIAnthropicChatError, type AxAIAnthropicChatRequest, type AxAIAnthropicChatRequestCacheParam, type AxAIAnthropicChatResponse, type AxAIAnthropicChatResponseDelta, type AxAIAnthropicConfig, type AxAIAnthropicContentBlockDeltaEvent, type AxAIAnthropicContentBlockStartEvent, type AxAIAnthropicContentBlockStopEvent, type AxAIAnthropicErrorEvent, type AxAIAnthropicMessageDeltaEvent, type AxAIAnthropicMessageStartEvent, type AxAIAnthropicMessageStopEvent, AxAIAnthropicModel, type AxAIAnthropicPingEvent, AxAIAnthropicVertexModel, type AxAIArgs, AxAIAzureOpenAI, type AxAIAzureOpenAIArgs, type AxAIAzureOpenAIConfig, AxAICohere, type AxAICohereArgs, type AxAICohereChatRequest, type AxAICohereChatRequestToolResults, type AxAICohereChatResponse, type AxAICohereChatResponseDelta, type AxAICohereChatResponseToolCalls, type AxAICohereConfig, AxAICohereEmbedModel, type AxAICohereEmbedRequest, type AxAICohereEmbedResponse, AxAICohereModel, AxAIDeepSeek, type AxAIDeepSeekArgs, AxAIDeepSeekModel, type AxAIEmbedModels, type AxAIFeatures, AxAIGoogleGemini, type AxAIGoogleGeminiArgs, type AxAIGoogleGeminiBatchEmbedRequest, type AxAIGoogleGeminiBatchEmbedResponse, type AxAIGoogleGeminiChatRequest, type AxAIGoogleGeminiChatResponse, type AxAIGoogleGeminiChatResponseDelta, type AxAIGoogleGeminiConfig, type AxAIGoogleGeminiContent, AxAIGoogleGeminiEmbedModel, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, type AxAIGoogleGeminiToolGoogleSearchRetrieval, type AxAIGoogleVertexBatchEmbedRequest, type AxAIGoogleVertexBatchEmbedResponse, AxAIGroq, type AxAIGroqArgs, AxAIGroqModel, AxAIHuggingFace, type AxAIHuggingFaceArgs, type AxAIHuggingFaceConfig, AxAIHuggingFaceModel, type AxAIHuggingFaceRequest, type AxAIHuggingFaceResponse, type AxAIMemory, AxAIMistral, type AxAIMistralArgs, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, type AxAIModels, AxAIOllama, type AxAIOllamaAIConfig, type AxAIOllamaArgs, AxAIOpenAI, type AxAIOpenAIArgs, type AxAIOpenAIChatRequest, type AxAIOpenAIChatResponse, type AxAIOpenAIChatResponseDelta, type AxAIOpenAIConfig, AxAIOpenAIEmbedModel, type AxAIOpenAIEmbedRequest, type AxAIOpenAIEmbedResponse, type AxAIOpenAILogprob, AxAIOpenAIModel, type AxAIOpenAIResponseDelta, type AxAIOpenAIUsage, type AxAIPromptConfig, AxAIReka, type AxAIRekaArgs, type AxAIRekaChatRequest, type AxAIRekaChatResponse, type AxAIRekaChatResponseDelta, type AxAIRekaConfig, AxAIRekaModel, type AxAIRekaUsage, type AxAIService, type AxAIServiceActionOptions, AxAIServiceAuthenticationError, AxAIServiceError, type AxAIServiceImpl, type AxAIServiceMetrics, AxAIServiceNetworkError, type AxAIServiceOptions, AxAIServiceResponseError, AxAIServiceStatusError, AxAIServiceStreamTerminatedError, AxAIServiceTimeoutError, AxAITogether, type AxAITogetherArgs, type AxAPI, type AxAPIConfig, AxAgent, type AxAgentOptions, type AxAgentic, AxApacheTika, type AxApacheTikaArgs, type AxApacheTikaConvertOptions, type AxAssertion, AxAssertionError, AxBalancer, type AxBalancerOptions, AxBaseAI, type AxBaseAIArgs, AxBootstrapFewShot, AxChainOfThought, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, AxDB, type AxDBArgs, AxDBBase, type AxDBBaseArgs, type AxDBBaseOpOptions, AxDBCloudflare, type AxDBCloudflareArgs, type AxDBCloudflareOpOptions, type AxDBLoaderOptions, AxDBManager, type AxDBManagerArgs, type AxDBMatch, AxDBMemory, type AxDBMemoryArgs, type AxDBMemoryOpOptions, AxDBPinecone, type AxDBPineconeArgs, type AxDBPineconeOpOptions, type AxDBQueryRequest, type AxDBQueryResponse, type AxDBQueryService, type AxDBService, type AxDBState, type AxDBUpsertRequest, type AxDBUpsertResponse, AxDBWeaviate, type AxDBWeaviateArgs, type AxDBWeaviateOpOptions, type AxDataRow, AxDefaultQueryRewriter, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, type AxEvaluateArgs, type AxExample, type AxField, type AxFieldTemplateFn, type AxFieldValue, type AxFunction, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenOptions, type AxGenOut, type AxGenStreamingOut, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSInterpreter, AxJSInterpreterPermission, AxLLMRequestTypeValues, AxMemory, type AxMetricFn, type AxMetricFnArgs, AxMockAIService, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxOptimizerArgs, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramStreamingForwardOptions, type AxProgramTrace, type AxProgramUsage, AxProgramWithSignature, type AxProgramWithSignatureOptions, AxPromptTemplate, AxRAG, type AxRateLimiterFunction, AxRateLimiterTokenUsage, type AxRateLimiterTokenUsageOptions, type AxRerankerIn, type AxRerankerOut, type AxResponseHandlerArgs, type AxRewriteIn, type AxRewriteOut, AxRoute, AxRouter, type AxRouterForwardOptions, AxSignature, AxSpanKindValues, type AxStreamingAssertion, type AxStreamingEvent, AxTestPrompt, type AxTokenUsage, type AxTunable, type AxUsable };
|