@mate-academy/llm-gateway 6.0.0 → 6.2.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/dist/LLMError.d.ts +12 -0
- package/dist/LLMError.js +36 -0
- package/dist/LLMError.js.map +1 -0
- package/dist/LLMService.constants.d.ts +792 -2
- package/dist/LLMService.constants.js +5 -1
- package/dist/LLMService.constants.js.map +1 -1
- package/dist/LLMService.typedefs.d.ts +24 -2
- package/dist/LLMService.typedefs.js +1 -0
- package/dist/LLMService.typedefs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/providers/GoogleGenerativeAI/GoogleGenerativeAI.constants.d.ts +72 -0
- package/dist/providers/GoogleGenerativeAI/GoogleGenerativeAI.constants.js +6 -0
- package/dist/providers/GoogleGenerativeAI/GoogleGenerativeAI.constants.js.map +1 -1
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.d.ts +8 -7
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.js +217 -31
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.js.map +1 -1
- package/dist/providers/LLMAPI/LLMAPI.constants.d.ts +884 -0
- package/dist/providers/LLMAPI/LLMAPI.constants.js +282 -0
- package/dist/providers/LLMAPI/LLMAPI.constants.js.map +1 -0
- package/dist/providers/LLMAPI/LLMAPI.entity.d.ts +6 -0
- package/dist/providers/LLMAPI/LLMAPI.entity.js +49 -0
- package/dist/providers/LLMAPI/LLMAPI.entity.js.map +1 -0
- package/dist/providers/LLMAPI/LLMAPI.typedefs.d.ts +48 -0
- package/dist/providers/LLMAPI/LLMAPI.typedefs.js +46 -0
- package/dist/providers/LLMAPI/LLMAPI.typedefs.js.map +1 -0
- package/dist/providers/LLMAPI/LLMAPIService.factory.d.ts +6 -0
- package/dist/providers/LLMAPI/LLMAPIService.factory.js +19 -0
- package/dist/providers/LLMAPI/LLMAPIService.factory.js.map +1 -0
- package/dist/providers/LLMAPI/index.d.ts +6 -0
- package/dist/providers/LLMAPI/index.js +23 -0
- package/dist/providers/LLMAPI/index.js.map +1 -0
- package/dist/providers/LLMAPI/schemas/LLMAPISchemaAdapter.d.ts +3 -0
- package/dist/providers/LLMAPI/schemas/LLMAPISchemaAdapter.js +8 -0
- package/dist/providers/LLMAPI/schemas/LLMAPISchemaAdapter.js.map +1 -0
- package/dist/providers/LLMAPI/services/LLMAPIAssistance.service.d.ts +34 -0
- package/dist/providers/LLMAPI/services/LLMAPIAssistance.service.js +497 -0
- package/dist/providers/LLMAPI/services/LLMAPIAssistance.service.js.map +1 -0
- package/dist/providers/LLMAPI/services/LLMAPICompletion.service.d.ts +18 -0
- package/dist/providers/LLMAPI/services/LLMAPICompletion.service.js +138 -0
- package/dist/providers/LLMAPI/services/LLMAPICompletion.service.js.map +1 -0
- package/dist/providers/LLMAPI/services/index.d.ts +2 -0
- package/dist/providers/LLMAPI/services/index.js +19 -0
- package/dist/providers/LLMAPI/services/index.js.map +1 -0
- package/dist/providers/LLMAPI/utilities/LLMAPIJsonFixer.d.ts +22 -0
- package/dist/providers/LLMAPI/utilities/LLMAPIJsonFixer.js +228 -0
- package/dist/providers/LLMAPI/utilities/LLMAPIJsonFixer.js.map +1 -0
- package/dist/providers/LLMAPI/utilities/index.d.ts +1 -0
- package/dist/providers/LLMAPI/utilities/index.js +7 -0
- package/dist/providers/LLMAPI/utilities/index.js.map +1 -0
- package/dist/providers/OpenAI/OpenAI.constants.d.ts +165 -0
- package/dist/providers/OpenAI/OpenAI.constants.js +11 -0
- package/dist/providers/OpenAI/OpenAI.constants.js.map +1 -1
- package/dist/providers/OpenAI/OpenAI.typedefs.d.ts +6 -0
- package/dist/providers/OpenAI/OpenAI.typedefs.js +9 -1
- package/dist/providers/OpenAI/OpenAI.typedefs.js.map +1 -1
- package/dist/providers/OpenAI/services/OpenAIAssistance.service.d.ts +9 -7
- package/dist/providers/OpenAI/services/OpenAIAssistance.service.js +209 -40
- package/dist/providers/OpenAI/services/OpenAIAssistance.service.js.map +1 -1
- package/dist/providers/OpenAI/services/OpenAICompletion.service.d.ts +3 -13
- package/dist/providers/OpenAI/services/OpenAICompletion.service.js +2 -181
- package/dist/providers/OpenAI/services/OpenAICompletion.service.js.map +1 -1
- package/dist/providers/OpenAICompatible/OpenAICompatibleCompletion.service.d.ts +21 -0
- package/dist/providers/OpenAICompatible/OpenAICompatibleCompletion.service.js +204 -0
- package/dist/providers/OpenAICompatible/OpenAICompatibleCompletion.service.js.map +1 -0
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.js +1 -0
- package/dist/providers/index.js.map +1 -1
- package/dist/services/LLMAssistanceService.abstract.d.ts +8 -6
- package/dist/services/LLMAssistanceService.abstract.js +20 -0
- package/dist/services/LLMAssistanceService.abstract.js.map +1 -1
- package/dist/services/chatState/CompletionsChatState.d.ts +19 -0
- package/dist/services/chatState/CompletionsChatState.js +80 -0
- package/dist/services/chatState/CompletionsChatState.js.map +1 -0
- package/dist/services/chatState/index.d.ts +1 -0
- package/dist/services/chatState/index.js +6 -0
- package/dist/services/chatState/index.js.map +1 -0
- package/dist/services/fileStorage/FileStorageToolExecutor.d.ts +15 -0
- package/dist/services/fileStorage/FileStorageToolExecutor.js +172 -0
- package/dist/services/fileStorage/FileStorageToolExecutor.js.map +1 -0
- package/dist/services/fileStorage/InMemoryFileStorage.d.ts +20 -0
- package/dist/services/fileStorage/InMemoryFileStorage.js +67 -0
- package/dist/services/fileStorage/InMemoryFileStorage.js.map +1 -0
- package/dist/services/fileStorage/fileStorageTools.d.ts +26 -0
- package/dist/services/fileStorage/fileStorageTools.js +67 -0
- package/dist/services/fileStorage/fileStorageTools.js.map +1 -0
- package/dist/services/fileStorage/index.d.ts +4 -0
- package/dist/services/fileStorage/index.js +11 -0
- package/dist/services/fileStorage/index.js.map +1 -0
- package/dist/utilities/index.d.ts +1 -0
- package/dist/utilities/index.js +1 -0
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/schema/SchemaAdapterRegistry.d.ts +2 -0
- package/dist/utilities/schema/SchemaAdapterRegistry.js +2 -0
- package/dist/utilities/schema/SchemaAdapterRegistry.js.map +1 -1
- package/dist/utilities/tools/LLMTool.d.ts +10 -0
- package/dist/utilities/tools/LLMTool.js +10 -0
- package/dist/utilities/tools/LLMTool.js.map +1 -0
- package/dist/utilities/tools/index.d.ts +1 -0
- package/dist/utilities/tools/index.js +6 -0
- package/dist/utilities/tools/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ALL_IMAGE_MIME_TYPES = exports.MAX_CACHED_INSTANCES = exports.APPROXIMATE_TOKENS_COUNT_IN_IMAGE = exports.LLM_SERVICE_MODELS = exports.LLM_SERVICE_FACTORIES = void 0;
|
|
3
|
+
exports.DEFAULT_MAX_TOOL_ITERATIONS = exports.ALL_IMAGE_MIME_TYPES = exports.MAX_CACHED_INSTANCES = exports.APPROXIMATE_TOKENS_COUNT_IN_IMAGE = exports.LLM_SERVICE_MODELS = exports.LLM_SERVICE_FACTORIES = void 0;
|
|
4
4
|
const LLMService_typedefs_1 = require("./LLMService.typedefs");
|
|
5
5
|
const providers_1 = require("./providers");
|
|
6
6
|
const GoogleGenerativeAI_constants_1 = require("./providers/GoogleGenerativeAI/GoogleGenerativeAI.constants");
|
|
7
7
|
const OpenAI_constants_1 = require("./providers/OpenAI/OpenAI.constants");
|
|
8
|
+
const LLMAPI_constants_1 = require("./providers/LLMAPI/LLMAPI.constants");
|
|
8
9
|
exports.LLM_SERVICE_FACTORIES = {
|
|
9
10
|
[LLMService_typedefs_1.LLMProviders.OpenAI]: new providers_1.OpenAIServiceFactory(),
|
|
10
11
|
[LLMService_typedefs_1.LLMProviders.GoogleGenerativeAI]: new providers_1.GoogleGenerativeAIServiceFactory(),
|
|
12
|
+
[LLMService_typedefs_1.LLMProviders.LLMAPI]: new providers_1.LLMAPIServiceFactory(),
|
|
11
13
|
};
|
|
12
14
|
exports.LLM_SERVICE_MODELS = {
|
|
13
15
|
[LLMService_typedefs_1.LLMProviders.OpenAI]: OpenAI_constants_1.OPEN_AI_MODELS,
|
|
14
16
|
[LLMService_typedefs_1.LLMProviders.GoogleGenerativeAI]: GoogleGenerativeAI_constants_1.GOOGLE_AI_MODELS,
|
|
17
|
+
[LLMService_typedefs_1.LLMProviders.LLMAPI]: LLMAPI_constants_1.LLMAPI_MODELS,
|
|
15
18
|
};
|
|
16
19
|
exports.APPROXIMATE_TOKENS_COUNT_IN_IMAGE = 1000;
|
|
17
20
|
/**
|
|
@@ -28,4 +31,5 @@ exports.ALL_IMAGE_MIME_TYPES = [
|
|
|
28
31
|
LLMService_typedefs_1.LLMUploadFileMimeTypes.IMAGE_SVG_XML,
|
|
29
32
|
LLMService_typedefs_1.LLMUploadFileMimeTypes.IMAGE_BMP,
|
|
30
33
|
];
|
|
34
|
+
exports.DEFAULT_MAX_TOOL_ITERATIONS = 10;
|
|
31
35
|
//# sourceMappingURL=LLMService.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LLMService.constants.js","sourceRoot":"","sources":["../src/LLMService.constants.ts"],"names":[],"mappings":";;;AAAA,+DAK+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"LLMService.constants.js","sourceRoot":"","sources":["../src/LLMService.constants.ts"],"names":[],"mappings":";;;AAAA,+DAK+B;AAC/B,2CAA2G;AAC3G,8GAA+F;AAC/F,0EAAqE;AACrE,0EAAoE;AAGvD,QAAA,qBAAqB,GAAG;IACnC,CAAC,kCAAY,CAAC,MAAM,CAAC,EAAE,IAAI,gCAAoB,EAAE;IACjD,CAAC,kCAAY,CAAC,kBAAkB,CAAC,EAAE,IAAI,4CAAgC,EAAE;IACzE,CAAC,kCAAY,CAAC,MAAM,CAAC,EAAE,IAAI,gCAAoB,EAAE;CAGlD,CAAC;AAEW,QAAA,kBAAkB,GAAG;IAChC,CAAC,kCAAY,CAAC,MAAM,CAAC,EAAE,iCAAc;IACrC,CAAC,kCAAY,CAAC,kBAAkB,CAAC,EAAE,+CAAgB;IACnD,CAAC,kCAAY,CAAC,MAAM,CAAC,EAAE,gCAAa;CAGrC,CAAC;AAEW,QAAA,iCAAiC,GAAG,IAAI,CAAC;AAEtD;;;GAGG;AACU,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAE1B,QAAA,oBAAoB,GAAG;IAClC,4CAAsB,CAAC,SAAS;IAChC,4CAAsB,CAAC,UAAU;IACjC,4CAAsB,CAAC,SAAS;IAChC,4CAAsB,CAAC,SAAS;IAChC,4CAAsB,CAAC,UAAU;IACjC,4CAAsB,CAAC,aAAa;IACpC,4CAAsB,CAAC,SAAS;CACoB,CAAC;AAE1C,QAAA,2BAA2B,GAAG,EAAE,CAAC"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import type { OpenAIClient, OpenAIClientOptions, OpenAIModelConfigOverrides, OpenAIModelNames, OpenAISpeechOptions } from './providers/OpenAI/OpenAI.typedefs';
|
|
2
2
|
import type { GoogleGenerativeAIClient, GoogleGenerativeAIClientOptions, GoogleGenerativeAIModelNames, GoogleGenerativeAISpeechOptions, GoogleGenerativeAIModelConfigOverrides } from './providers/GoogleGenerativeAI/GoogleGenerativeAI.typedefs';
|
|
3
|
+
import type { LLMAPIClient, LLMAPIClientOptions, LLMAPIModelNames, LLMAPIModelConfigOverrides } from './providers/LLMAPI/LLMAPI.typedefs';
|
|
3
4
|
import type { LLMCompletionService, LLMAssistanceService, LLMSpeechToTextService, LLMTextToSpeechService } from './services';
|
|
4
5
|
import type { LLMLoggerInterface } from './utilities/logger';
|
|
5
6
|
import type { LLMReporterInterface } from './utilities/reporter';
|
|
7
|
+
import type { LLMSchemaInterface, InferSchema } from './utilities/schema';
|
|
6
8
|
/**
|
|
7
9
|
* Enum of supported LLM providers.
|
|
8
10
|
*/
|
|
9
11
|
export declare enum LLMProviders {
|
|
10
12
|
OpenAI = "OpenAI",
|
|
11
|
-
GoogleGenerativeAI = "GoogleGenerativeAI"
|
|
13
|
+
GoogleGenerativeAI = "GoogleGenerativeAI",
|
|
14
|
+
LLMAPI = "LLMAPI"
|
|
12
15
|
}
|
|
13
16
|
/**
|
|
14
17
|
* Maps each LLM provider to its corresponding instance type.
|
|
@@ -16,6 +19,7 @@ export declare enum LLMProviders {
|
|
|
16
19
|
export type LLMInstances = {
|
|
17
20
|
[LLMProviders.OpenAI]: OpenAIClient;
|
|
18
21
|
[LLMProviders.GoogleGenerativeAI]: GoogleGenerativeAIClient;
|
|
22
|
+
[LLMProviders.LLMAPI]: LLMAPIClient;
|
|
19
23
|
};
|
|
20
24
|
/**
|
|
21
25
|
* Configuration options for initializing each LLM provider's client.
|
|
@@ -23,6 +27,7 @@ export type LLMInstances = {
|
|
|
23
27
|
export type LLMInstanceOptions = {
|
|
24
28
|
[LLMProviders.OpenAI]: OpenAIClientOptions;
|
|
25
29
|
[LLMProviders.GoogleGenerativeAI]: GoogleGenerativeAIClientOptions;
|
|
30
|
+
[LLMProviders.LLMAPI]: LLMAPIClientOptions;
|
|
26
31
|
};
|
|
27
32
|
/**
|
|
28
33
|
* Supported service purposes/types that the LLM gateway provides.
|
|
@@ -62,13 +67,19 @@ export interface LLMLimits {
|
|
|
62
67
|
maxInputTokens: number;
|
|
63
68
|
maxOutputTokens: number;
|
|
64
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Describes which capabilities an LLM model supports.
|
|
72
|
+
*/
|
|
73
|
+
export interface LLMModelCapabilities {
|
|
74
|
+
vision: boolean;
|
|
75
|
+
}
|
|
65
76
|
/**
|
|
66
77
|
* Configuration parameters that control LLM generation behavior.
|
|
67
78
|
*/
|
|
68
79
|
export type LLMConfig<Provider extends LLMProviders = any, ModelName extends LLMModelName[Provider] = any> = Partial<{
|
|
69
80
|
temperature: number;
|
|
70
81
|
top_p: number | null;
|
|
71
|
-
}> & (Provider extends LLMProviders.OpenAI ? OpenAIModelConfigOverrides<ModelName> : Provider extends LLMProviders.GoogleGenerativeAI ? GoogleGenerativeAIModelConfigOverrides<ModelName> : {});
|
|
82
|
+
}> & (Provider extends LLMProviders.OpenAI ? OpenAIModelConfigOverrides<ModelName> : Provider extends LLMProviders.GoogleGenerativeAI ? GoogleGenerativeAIModelConfigOverrides<ModelName> : Provider extends LLMProviders.LLMAPI ? LLMAPIModelConfigOverrides<ModelName> : {});
|
|
72
83
|
/**
|
|
73
84
|
* Maps a provider to all available models it can access.
|
|
74
85
|
* @template Provider - The LLM provider type
|
|
@@ -88,6 +99,7 @@ export type LLMProviderModelsByPurpose<Purpose extends LLMPurposes, Provider ext
|
|
|
88
99
|
export type LLMModelName = {
|
|
89
100
|
[LLMProviders.OpenAI]: OpenAIModelNames;
|
|
90
101
|
[LLMProviders.GoogleGenerativeAI]: GoogleGenerativeAIModelNames;
|
|
102
|
+
[LLMProviders.LLMAPI]: LLMAPIModelNames;
|
|
91
103
|
};
|
|
92
104
|
/**
|
|
93
105
|
* Represents an LLM model with its configuration and limitations.
|
|
@@ -99,6 +111,7 @@ export interface LLMModel<Provider extends LLMProviders, ModelName extends LLMMo
|
|
|
99
111
|
limits: LLMLimits;
|
|
100
112
|
config: LLMConfig<Provider, ModelName>;
|
|
101
113
|
pricing: LLMModelPricing;
|
|
114
|
+
capabilities?: LLMModelCapabilities;
|
|
102
115
|
}
|
|
103
116
|
/**
|
|
104
117
|
* Pricing information for LLM models
|
|
@@ -354,6 +367,8 @@ export type LLMAssistanceOptions<Provider extends LLMProviders, Reporter extends
|
|
|
354
367
|
message: LLMAssistanceMessage;
|
|
355
368
|
chatId: string;
|
|
356
369
|
storageId?: string;
|
|
370
|
+
tools?: LLMToolDefinition[];
|
|
371
|
+
maxToolIterations?: number;
|
|
357
372
|
};
|
|
358
373
|
/**
|
|
359
374
|
* Result type for assistance requests.
|
|
@@ -361,6 +376,12 @@ export type LLMAssistanceOptions<Provider extends LLMProviders, Reporter extends
|
|
|
361
376
|
export type LLMAssistanceResult = LLMRequestResult<{
|
|
362
377
|
text: string;
|
|
363
378
|
}>;
|
|
379
|
+
export interface LLMToolDefinition<Schema extends LLMSchemaInterface = LLMSchemaInterface> {
|
|
380
|
+
name: string;
|
|
381
|
+
description: string;
|
|
382
|
+
parameters: Schema;
|
|
383
|
+
execute: (args: InferSchema<Schema>) => Promise<string> | string;
|
|
384
|
+
}
|
|
364
385
|
/**
|
|
365
386
|
* Function type for counting tokens in messages for a specific provider's model.
|
|
366
387
|
* @template Provider - The LLM provider type
|
|
@@ -406,6 +427,7 @@ export type LLMTranscribeResult = LLMRequestResult<{
|
|
|
406
427
|
export type LLMSpeechOptions = {
|
|
407
428
|
[LLMProviders.OpenAI]: OpenAISpeechOptions;
|
|
408
429
|
[LLMProviders.GoogleGenerativeAI]: GoogleGenerativeAISpeechOptions;
|
|
430
|
+
[LLMProviders.LLMAPI]: never;
|
|
409
431
|
};
|
|
410
432
|
/**
|
|
411
433
|
* Options for creating speech from text using an LLM service.
|
|
@@ -8,6 +8,7 @@ var LLMProviders;
|
|
|
8
8
|
(function (LLMProviders) {
|
|
9
9
|
LLMProviders["OpenAI"] = "OpenAI";
|
|
10
10
|
LLMProviders["GoogleGenerativeAI"] = "GoogleGenerativeAI";
|
|
11
|
+
LLMProviders["LLMAPI"] = "LLMAPI";
|
|
11
12
|
})(LLMProviders || (exports.LLMProviders = LLMProviders = {}));
|
|
12
13
|
/**
|
|
13
14
|
* Supported service purposes/types that the LLM gateway provides.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LLMService.typedefs.js","sourceRoot":"","sources":["../src/LLMService.typedefs.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"LLMService.typedefs.js","sourceRoot":"","sources":["../src/LLMService.typedefs.ts"],"names":[],"mappings":";;;AAiCA;;GAEG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,yDAAyC,CAAA;IACzC,iCAAiB,CAAA;AACnB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAoBD;;GAEG;AACH,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,wCAAyB,CAAA;IACzB,wCAAyB,CAAA;IACzB,8CAA+B,CAAA;IAC/B,8CAA+B,CAAA;AACjC,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAoKD;;GAEG;AACH,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,mCAAuB,CAAA;AACzB,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAED;;GAEG;AACH,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,sCAAa,CAAA;IACb,gDAAuB,CAAA;IACvB,kDAAyB,CAAA;AAC3B,CAAC,EAJW,qBAAqB,qCAArB,qBAAqB,QAIhC;AA4HD;;GAEG;AACH,IAAY,sBAeX;AAfD,WAAY,sBAAsB;IAChC,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,iDAAuB,CAAA;IACvB,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,yDAA+B,CAAA;IAC/B,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,oDAA0B,CAAA;IAC1B,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,iDAAuB,CAAA;AACzB,CAAC,EAfW,sBAAsB,sCAAtB,sBAAsB,QAejC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./LLMError"), exports);
|
|
17
18
|
__exportStar(require("./LLMService.constants"), exports);
|
|
18
19
|
__exportStar(require("./LLMService.factory"), exports);
|
|
19
20
|
__exportStar(require("./LLMService.typedefs"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,uDAAqC;AACrC,wDAAsC;AACtC,8CAA4B;AAC5B,6CAA2B;AAC3B,8CAA4B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,yDAAuC;AACvC,uDAAqC;AACrC,wDAAsC;AACtC,8CAA4B;AAC5B,6CAA2B;AAC3B,8CAA4B"}
|
|
@@ -23,6 +23,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
23
23
|
readonly getPriceForAudioOutput: () => number;
|
|
24
24
|
readonly currency: "USD";
|
|
25
25
|
};
|
|
26
|
+
readonly capabilities: {
|
|
27
|
+
readonly vision: true;
|
|
28
|
+
};
|
|
26
29
|
};
|
|
27
30
|
readonly "gemini-2.5-flash-lite": {
|
|
28
31
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH_LITE;
|
|
@@ -42,6 +45,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
42
45
|
readonly getPriceForAudioOutput: () => number;
|
|
43
46
|
readonly currency: "USD";
|
|
44
47
|
};
|
|
48
|
+
readonly capabilities: {
|
|
49
|
+
readonly vision: true;
|
|
50
|
+
};
|
|
45
51
|
};
|
|
46
52
|
readonly "gemini-2.5-pro": {
|
|
47
53
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_2_5_PRO;
|
|
@@ -61,6 +67,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
61
67
|
readonly getPriceForAudioOutput: () => number;
|
|
62
68
|
readonly currency: "USD";
|
|
63
69
|
};
|
|
70
|
+
readonly capabilities: {
|
|
71
|
+
readonly vision: true;
|
|
72
|
+
};
|
|
64
73
|
};
|
|
65
74
|
readonly "gemini-2.5-flash-preview-tts": {
|
|
66
75
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH_PREVIEW_TTS;
|
|
@@ -78,6 +87,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
78
87
|
readonly getPriceForAudioOutput: (audio_tokens: number) => number;
|
|
79
88
|
readonly currency: "USD";
|
|
80
89
|
};
|
|
90
|
+
readonly capabilities: {
|
|
91
|
+
readonly vision: false;
|
|
92
|
+
};
|
|
81
93
|
};
|
|
82
94
|
readonly "gemini-2.5-pro-preview-tts": {
|
|
83
95
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_2_5_PRO_PREVIEW_TTS;
|
|
@@ -95,6 +107,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
95
107
|
readonly getPriceForAudioOutput: (audio_tokens: number) => number;
|
|
96
108
|
readonly currency: "USD";
|
|
97
109
|
};
|
|
110
|
+
readonly capabilities: {
|
|
111
|
+
readonly vision: false;
|
|
112
|
+
};
|
|
98
113
|
};
|
|
99
114
|
readonly "gemini-3-pro-preview": {
|
|
100
115
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_3_PRO_PREVIEW;
|
|
@@ -117,6 +132,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
117
132
|
readonly getPriceForAudioOutput: () => number;
|
|
118
133
|
readonly currency: "USD";
|
|
119
134
|
};
|
|
135
|
+
readonly capabilities: {
|
|
136
|
+
readonly vision: true;
|
|
137
|
+
};
|
|
120
138
|
};
|
|
121
139
|
}, GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH | GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH_LITE | GoogleGenerativeAIModelNames.GEMINI_2_5_PRO | GoogleGenerativeAIModelNames.GEMINI_3_PRO_PREVIEW>;
|
|
122
140
|
readonly assistance: Pick<{
|
|
@@ -138,6 +156,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
138
156
|
readonly getPriceForAudioOutput: () => number;
|
|
139
157
|
readonly currency: "USD";
|
|
140
158
|
};
|
|
159
|
+
readonly capabilities: {
|
|
160
|
+
readonly vision: true;
|
|
161
|
+
};
|
|
141
162
|
};
|
|
142
163
|
readonly "gemini-2.5-flash-lite": {
|
|
143
164
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH_LITE;
|
|
@@ -157,6 +178,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
157
178
|
readonly getPriceForAudioOutput: () => number;
|
|
158
179
|
readonly currency: "USD";
|
|
159
180
|
};
|
|
181
|
+
readonly capabilities: {
|
|
182
|
+
readonly vision: true;
|
|
183
|
+
};
|
|
160
184
|
};
|
|
161
185
|
readonly "gemini-2.5-pro": {
|
|
162
186
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_2_5_PRO;
|
|
@@ -176,6 +200,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
176
200
|
readonly getPriceForAudioOutput: () => number;
|
|
177
201
|
readonly currency: "USD";
|
|
178
202
|
};
|
|
203
|
+
readonly capabilities: {
|
|
204
|
+
readonly vision: true;
|
|
205
|
+
};
|
|
179
206
|
};
|
|
180
207
|
readonly "gemini-2.5-flash-preview-tts": {
|
|
181
208
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH_PREVIEW_TTS;
|
|
@@ -193,6 +220,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
193
220
|
readonly getPriceForAudioOutput: (audio_tokens: number) => number;
|
|
194
221
|
readonly currency: "USD";
|
|
195
222
|
};
|
|
223
|
+
readonly capabilities: {
|
|
224
|
+
readonly vision: false;
|
|
225
|
+
};
|
|
196
226
|
};
|
|
197
227
|
readonly "gemini-2.5-pro-preview-tts": {
|
|
198
228
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_2_5_PRO_PREVIEW_TTS;
|
|
@@ -210,6 +240,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
210
240
|
readonly getPriceForAudioOutput: (audio_tokens: number) => number;
|
|
211
241
|
readonly currency: "USD";
|
|
212
242
|
};
|
|
243
|
+
readonly capabilities: {
|
|
244
|
+
readonly vision: false;
|
|
245
|
+
};
|
|
213
246
|
};
|
|
214
247
|
readonly "gemini-3-pro-preview": {
|
|
215
248
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_3_PRO_PREVIEW;
|
|
@@ -232,6 +265,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
232
265
|
readonly getPriceForAudioOutput: () => number;
|
|
233
266
|
readonly currency: "USD";
|
|
234
267
|
};
|
|
268
|
+
readonly capabilities: {
|
|
269
|
+
readonly vision: true;
|
|
270
|
+
};
|
|
235
271
|
};
|
|
236
272
|
}, GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH | GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH_LITE | GoogleGenerativeAIModelNames.GEMINI_2_5_PRO | GoogleGenerativeAIModelNames.GEMINI_3_PRO_PREVIEW>;
|
|
237
273
|
readonly speech_to_text: Pick<{
|
|
@@ -253,6 +289,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
253
289
|
readonly getPriceForAudioOutput: () => number;
|
|
254
290
|
readonly currency: "USD";
|
|
255
291
|
};
|
|
292
|
+
readonly capabilities: {
|
|
293
|
+
readonly vision: true;
|
|
294
|
+
};
|
|
256
295
|
};
|
|
257
296
|
readonly "gemini-2.5-flash-lite": {
|
|
258
297
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH_LITE;
|
|
@@ -272,6 +311,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
272
311
|
readonly getPriceForAudioOutput: () => number;
|
|
273
312
|
readonly currency: "USD";
|
|
274
313
|
};
|
|
314
|
+
readonly capabilities: {
|
|
315
|
+
readonly vision: true;
|
|
316
|
+
};
|
|
275
317
|
};
|
|
276
318
|
readonly "gemini-2.5-pro": {
|
|
277
319
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_2_5_PRO;
|
|
@@ -291,6 +333,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
291
333
|
readonly getPriceForAudioOutput: () => number;
|
|
292
334
|
readonly currency: "USD";
|
|
293
335
|
};
|
|
336
|
+
readonly capabilities: {
|
|
337
|
+
readonly vision: true;
|
|
338
|
+
};
|
|
294
339
|
};
|
|
295
340
|
readonly "gemini-2.5-flash-preview-tts": {
|
|
296
341
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH_PREVIEW_TTS;
|
|
@@ -308,6 +353,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
308
353
|
readonly getPriceForAudioOutput: (audio_tokens: number) => number;
|
|
309
354
|
readonly currency: "USD";
|
|
310
355
|
};
|
|
356
|
+
readonly capabilities: {
|
|
357
|
+
readonly vision: false;
|
|
358
|
+
};
|
|
311
359
|
};
|
|
312
360
|
readonly "gemini-2.5-pro-preview-tts": {
|
|
313
361
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_2_5_PRO_PREVIEW_TTS;
|
|
@@ -325,6 +373,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
325
373
|
readonly getPriceForAudioOutput: (audio_tokens: number) => number;
|
|
326
374
|
readonly currency: "USD";
|
|
327
375
|
};
|
|
376
|
+
readonly capabilities: {
|
|
377
|
+
readonly vision: false;
|
|
378
|
+
};
|
|
328
379
|
};
|
|
329
380
|
readonly "gemini-3-pro-preview": {
|
|
330
381
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_3_PRO_PREVIEW;
|
|
@@ -347,6 +398,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
347
398
|
readonly getPriceForAudioOutput: () => number;
|
|
348
399
|
readonly currency: "USD";
|
|
349
400
|
};
|
|
401
|
+
readonly capabilities: {
|
|
402
|
+
readonly vision: true;
|
|
403
|
+
};
|
|
350
404
|
};
|
|
351
405
|
}, GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH | GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH_LITE | GoogleGenerativeAIModelNames.GEMINI_2_5_PRO | GoogleGenerativeAIModelNames.GEMINI_3_PRO_PREVIEW>;
|
|
352
406
|
readonly text_to_speech: Pick<{
|
|
@@ -368,6 +422,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
368
422
|
readonly getPriceForAudioOutput: () => number;
|
|
369
423
|
readonly currency: "USD";
|
|
370
424
|
};
|
|
425
|
+
readonly capabilities: {
|
|
426
|
+
readonly vision: true;
|
|
427
|
+
};
|
|
371
428
|
};
|
|
372
429
|
readonly "gemini-2.5-flash-lite": {
|
|
373
430
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH_LITE;
|
|
@@ -387,6 +444,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
387
444
|
readonly getPriceForAudioOutput: () => number;
|
|
388
445
|
readonly currency: "USD";
|
|
389
446
|
};
|
|
447
|
+
readonly capabilities: {
|
|
448
|
+
readonly vision: true;
|
|
449
|
+
};
|
|
390
450
|
};
|
|
391
451
|
readonly "gemini-2.5-pro": {
|
|
392
452
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_2_5_PRO;
|
|
@@ -406,6 +466,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
406
466
|
readonly getPriceForAudioOutput: () => number;
|
|
407
467
|
readonly currency: "USD";
|
|
408
468
|
};
|
|
469
|
+
readonly capabilities: {
|
|
470
|
+
readonly vision: true;
|
|
471
|
+
};
|
|
409
472
|
};
|
|
410
473
|
readonly "gemini-2.5-flash-preview-tts": {
|
|
411
474
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH_PREVIEW_TTS;
|
|
@@ -423,6 +486,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
423
486
|
readonly getPriceForAudioOutput: (audio_tokens: number) => number;
|
|
424
487
|
readonly currency: "USD";
|
|
425
488
|
};
|
|
489
|
+
readonly capabilities: {
|
|
490
|
+
readonly vision: false;
|
|
491
|
+
};
|
|
426
492
|
};
|
|
427
493
|
readonly "gemini-2.5-pro-preview-tts": {
|
|
428
494
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_2_5_PRO_PREVIEW_TTS;
|
|
@@ -440,6 +506,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
440
506
|
readonly getPriceForAudioOutput: (audio_tokens: number) => number;
|
|
441
507
|
readonly currency: "USD";
|
|
442
508
|
};
|
|
509
|
+
readonly capabilities: {
|
|
510
|
+
readonly vision: false;
|
|
511
|
+
};
|
|
443
512
|
};
|
|
444
513
|
readonly "gemini-3-pro-preview": {
|
|
445
514
|
readonly name: GoogleGenerativeAIModelNames.GEMINI_3_PRO_PREVIEW;
|
|
@@ -462,6 +531,9 @@ export declare const GOOGLE_AI_MODELS: {
|
|
|
462
531
|
readonly getPriceForAudioOutput: () => number;
|
|
463
532
|
readonly currency: "USD";
|
|
464
533
|
};
|
|
534
|
+
readonly capabilities: {
|
|
535
|
+
readonly vision: true;
|
|
536
|
+
};
|
|
465
537
|
};
|
|
466
538
|
}, GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH_PREVIEW_TTS | GoogleGenerativeAIModelNames.GEMINI_2_5_PRO_PREVIEW_TTS>;
|
|
467
539
|
};
|
|
@@ -26,6 +26,7 @@ const GOOGLE_AI_AVAILABLE_MODELS = {
|
|
|
26
26
|
getPriceForAudioOutput: () => 0,
|
|
27
27
|
currency: 'USD',
|
|
28
28
|
},
|
|
29
|
+
capabilities: { vision: true },
|
|
29
30
|
},
|
|
30
31
|
[GoogleGenerativeAI_typedefs_1.GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH_LITE]: {
|
|
31
32
|
name: GoogleGenerativeAI_typedefs_1.GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH_LITE,
|
|
@@ -45,6 +46,7 @@ const GOOGLE_AI_AVAILABLE_MODELS = {
|
|
|
45
46
|
getPriceForAudioOutput: () => 0,
|
|
46
47
|
currency: 'USD',
|
|
47
48
|
},
|
|
49
|
+
capabilities: { vision: true },
|
|
48
50
|
},
|
|
49
51
|
[GoogleGenerativeAI_typedefs_1.GoogleGenerativeAIModelNames.GEMINI_2_5_PRO]: {
|
|
50
52
|
name: GoogleGenerativeAI_typedefs_1.GoogleGenerativeAIModelNames.GEMINI_2_5_PRO,
|
|
@@ -89,6 +91,7 @@ const GOOGLE_AI_AVAILABLE_MODELS = {
|
|
|
89
91
|
getPriceForAudioOutput: () => 0,
|
|
90
92
|
currency: 'USD',
|
|
91
93
|
},
|
|
94
|
+
capabilities: { vision: true },
|
|
92
95
|
},
|
|
93
96
|
[GoogleGenerativeAI_typedefs_1.GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH_PREVIEW_TTS]: {
|
|
94
97
|
name: GoogleGenerativeAI_typedefs_1.GoogleGenerativeAIModelNames.GEMINI_2_5_FLASH_PREVIEW_TTS,
|
|
@@ -106,6 +109,7 @@ const GOOGLE_AI_AVAILABLE_MODELS = {
|
|
|
106
109
|
getPriceForAudioOutput: (audio_tokens) => 10 * audio_tokens / 1_000_000,
|
|
107
110
|
currency: 'USD',
|
|
108
111
|
},
|
|
112
|
+
capabilities: { vision: false },
|
|
109
113
|
},
|
|
110
114
|
[GoogleGenerativeAI_typedefs_1.GoogleGenerativeAIModelNames.GEMINI_2_5_PRO_PREVIEW_TTS]: {
|
|
111
115
|
name: GoogleGenerativeAI_typedefs_1.GoogleGenerativeAIModelNames.GEMINI_2_5_PRO_PREVIEW_TTS,
|
|
@@ -123,6 +127,7 @@ const GOOGLE_AI_AVAILABLE_MODELS = {
|
|
|
123
127
|
getPriceForAudioOutput: (audio_tokens) => 20 * audio_tokens / 1_000_000,
|
|
124
128
|
currency: 'USD',
|
|
125
129
|
},
|
|
130
|
+
capabilities: { vision: false },
|
|
126
131
|
},
|
|
127
132
|
[GoogleGenerativeAI_typedefs_1.GoogleGenerativeAIModelNames.GEMINI_3_PRO_PREVIEW]: {
|
|
128
133
|
name: GoogleGenerativeAI_typedefs_1.GoogleGenerativeAIModelNames.GEMINI_3_PRO_PREVIEW,
|
|
@@ -170,6 +175,7 @@ const GOOGLE_AI_AVAILABLE_MODELS = {
|
|
|
170
175
|
getPriceForAudioOutput: () => 0,
|
|
171
176
|
currency: 'USD',
|
|
172
177
|
},
|
|
178
|
+
capabilities: { vision: true },
|
|
173
179
|
},
|
|
174
180
|
};
|
|
175
181
|
exports.GOOGLE_AI_MODELS = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleGenerativeAI.constants.js","sourceRoot":"","sources":["../../../src/providers/GoogleGenerativeAI/GoogleGenerativeAI.constants.ts"],"names":[],"mappings":";;;AAAA,+DAM+B;AAE/B,+EAA6E;AAC7E,yCAA8C;AAC9C,sEAKiD;AACjD,mEAAoD;AAEvC,QAAA,wBAAwB,GAAG,MAAM,CAAC;AAE/C,MAAM,0BAA0B,GAAG;IACjC,CAAC,0DAA4B,CAAC,gBAAgB,CAAC,EAAE;QAC/C,IAAI,EAAE,0DAA4B,CAAC,gBAAgB;QACnD,MAAM,EAAE;YACN,cAAc,EAAE,SAAS;YACzB,eAAe,EAAE,MAAM;SACxB;QACD,MAAM,EAAE;YACN,WAAW,EAAE,GAAG;SACjB;QACD,OAAO,EAAE;YACP,oBAAoB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,GAAG,MAAM,GAAG,SAAS;YAC1D,qBAAqB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,GAAG,MAAM,GAAG,SAAS;YAC3D,0BAA0B,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,GAAG,MAAM,GAAG,SAAS;YACjE,qBAAqB,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,GAAG,YAAY,GAAG,SAAS;YACrE,2BAA2B,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,GAAG,GAAG,YAAY,GAAG,SAAS;YAC7E,sBAAsB,EAAE,GAAG,EAAE,CAAC,CAAC;YAC/B,QAAQ,EAAE,KAAK;SAChB;
|
|
1
|
+
{"version":3,"file":"GoogleGenerativeAI.constants.js","sourceRoot":"","sources":["../../../src/providers/GoogleGenerativeAI/GoogleGenerativeAI.constants.ts"],"names":[],"mappings":";;;AAAA,+DAM+B;AAE/B,+EAA6E;AAC7E,yCAA8C;AAC9C,sEAKiD;AACjD,mEAAoD;AAEvC,QAAA,wBAAwB,GAAG,MAAM,CAAC;AAE/C,MAAM,0BAA0B,GAAG;IACjC,CAAC,0DAA4B,CAAC,gBAAgB,CAAC,EAAE;QAC/C,IAAI,EAAE,0DAA4B,CAAC,gBAAgB;QACnD,MAAM,EAAE;YACN,cAAc,EAAE,SAAS;YACzB,eAAe,EAAE,MAAM;SACxB;QACD,MAAM,EAAE;YACN,WAAW,EAAE,GAAG;SACjB;QACD,OAAO,EAAE;YACP,oBAAoB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,GAAG,MAAM,GAAG,SAAS;YAC1D,qBAAqB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,GAAG,MAAM,GAAG,SAAS;YAC3D,0BAA0B,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,GAAG,MAAM,GAAG,SAAS;YACjE,qBAAqB,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,GAAG,YAAY,GAAG,SAAS;YACrE,2BAA2B,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,GAAG,GAAG,YAAY,GAAG,SAAS;YAC7E,sBAAsB,EAAE,GAAG,EAAE,CAAC,CAAC;YAC/B,QAAQ,EAAE,KAAK;SAChB;QACD,YAAY,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;KAC/B;IACD,CAAC,0DAA4B,CAAC,qBAAqB,CAAC,EAAE;QACpD,IAAI,EAAE,0DAA4B,CAAC,qBAAqB;QACxD,MAAM,EAAE;YACN,cAAc,EAAE,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{ type LLMAssistanceOptions, type LLMAssistanceResult, type LLMAssistance
|
|
|
3
3
|
import { type LLMLoggerInterface } from '../../../utilities/logger';
|
|
4
4
|
import { type LLMReporterInterface } from '../../../utilities/reporter';
|
|
5
5
|
import { LLMAssistanceService } from '../../../services';
|
|
6
|
-
import { type LLMSchemaInterface
|
|
6
|
+
import { type LLMSchemaInterface } from '../../../utilities/schema';
|
|
7
7
|
export declare class GoogleGenerativeAIAssistanceService<Reporter extends LLMReporterInterface<any> | undefined> extends LLMAssistanceService<LLMProviders.GoogleGenerativeAI, Reporter> {
|
|
8
8
|
private cachedContent;
|
|
9
9
|
private chatSessions;
|
|
@@ -19,12 +19,13 @@ export declare class GoogleGenerativeAIAssistanceService<Reporter extends LLMRep
|
|
|
19
19
|
deleteFileStorage(fileStorageId: string): Promise<void>;
|
|
20
20
|
createChat(options: LLMCreateChatOptions<LLMProviders.GoogleGenerativeAI, Reporter>): Promise<LLMCreateChatResult>;
|
|
21
21
|
deleteChat(chatId: string): Promise<void>;
|
|
22
|
-
assistInChat<S extends LLMSchemaInterface>(options: LLMAssistanceOptions<LLMProviders.GoogleGenerativeAI, Reporter> & {
|
|
23
|
-
schema: S;
|
|
24
|
-
}): Promise<LLMStructuredResult<InferSchema<S>>>;
|
|
25
|
-
assistInChat(options: LLMAssistanceOptions<LLMProviders.GoogleGenerativeAI, Reporter>): Promise<LLMAssistanceResult>;
|
|
26
22
|
private getStorageFileParts;
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
protected assistInChatText(options: LLMAssistanceOptions<LLMProviders.GoogleGenerativeAI, Reporter>): Promise<LLMAssistanceResult>;
|
|
24
|
+
protected assistInChatStructured(options: LLMAssistanceOptions<LLMProviders.GoogleGenerativeAI, Reporter> & {
|
|
25
|
+
schema: LLMSchemaInterface;
|
|
26
|
+
}): Promise<LLMStructuredResult>;
|
|
27
|
+
private convertCustomToolsToGoogle;
|
|
28
|
+
private executeGoogleToolLoop;
|
|
29
|
+
private executeGoogleFunctionCalls;
|
|
29
30
|
countTokens(messages: LLMAssistanceMessage[], model: LLMModel<LLMProviders.GoogleGenerativeAI>): Promise<number>;
|
|
30
31
|
}
|