@mate-academy/llm-gateway 1.0.2 → 1.0.4
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/README.md +377 -0
- package/dist/LLMService.factory.d.ts +43 -0
- package/dist/LLMService.factory.js +43 -0
- package/dist/LLMService.factory.js.map +1 -1
- package/dist/LLMService.typedefs.d.ts +125 -0
- package/dist/LLMService.typedefs.js +12 -0
- package/dist/LLMService.typedefs.js.map +1 -1
- package/dist/providers/GoogleGenerativeAI/GoogleGenerativeAI.constants.js +1 -0
- package/dist/providers/GoogleGenerativeAI/GoogleGenerativeAI.constants.js.map +1 -1
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.js +2 -0
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -173,6 +173,383 @@ Supports both completion and assistance APIs. For more information, see [OpenAI
|
|
|
173
173
|
|
|
174
174
|
Supports completion API through Google's Generative AI models. For more information, see [Google Generative AI documentation](https://ai.google.dev/docs).
|
|
175
175
|
|
|
176
|
+
## Developer Guide: Adding a New Provider
|
|
177
|
+
|
|
178
|
+
To add support for a new LLM provider, follow these steps:
|
|
179
|
+
|
|
180
|
+
### 1. Create Provider Directory Structure
|
|
181
|
+
|
|
182
|
+
Create a new directory in `src/providers` with your provider name, following the established pattern:
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
src/providers/YourProvider/
|
|
186
|
+
├── index.ts # Entry point for provider exports
|
|
187
|
+
├── YourProvider.constants.ts # Provider-specific constants
|
|
188
|
+
├── YourProvider.entity.ts # Provider-specific entity
|
|
189
|
+
├── YourProvider.typedefs.ts # TypeScript definitions
|
|
190
|
+
├── YourProviderService.factory.ts # Factory for your provider's services
|
|
191
|
+
└── services/ # Provider service implementations
|
|
192
|
+
├── index.ts
|
|
193
|
+
├── YourProviderCompletionService.ts
|
|
194
|
+
└── YourProviderAssistanceService.ts
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### 2. Add Provider to LLM Providers Enum
|
|
198
|
+
|
|
199
|
+
Update the LLM providers enum in `src/LLMService.typedefs.ts`:
|
|
200
|
+
|
|
201
|
+
```typescript
|
|
202
|
+
export enum LLMProviders {
|
|
203
|
+
OpenAI = 'openai',
|
|
204
|
+
GoogleGenerativeAI = 'google',
|
|
205
|
+
YourProvider = 'your-provider-id',
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### 3. Define Provider-Specific Types
|
|
210
|
+
|
|
211
|
+
Create type definitions in `src/providers/YourProvider/YourProvider.typedefs.ts`:
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
// Define model names as an enum for type safety
|
|
215
|
+
export enum YourProviderModelNames {
|
|
216
|
+
MODEL_ONE = 'model-one',
|
|
217
|
+
MODEL_TWO = 'model-extended',
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// Define message roles if applicable
|
|
221
|
+
export enum YourProviderRoles {
|
|
222
|
+
User = 'user',
|
|
223
|
+
Assistant = 'assistant',
|
|
224
|
+
System = 'system',
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Add any other provider-specific enums or interfaces
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Then ensure your provider is properly integrated in the main type system by updating the necessary type mappings in `src/LLMService.typedefs.ts`:
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
// Add import for your provider's types
|
|
234
|
+
import { type YourProviderModelNames } from './providers/YourProvider/YourProvider.typedefs';
|
|
235
|
+
|
|
236
|
+
// Update the LLMProviders enum
|
|
237
|
+
export enum LLMProviders {
|
|
238
|
+
OpenAI = 'OpenAI',
|
|
239
|
+
GoogleGenerativeAI = 'GoogleGenerativeAI',
|
|
240
|
+
YourProvider = 'YourProvider',
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// Update LLMInstances type mapping
|
|
244
|
+
export type LLMInstances = {
|
|
245
|
+
// ...existing code...
|
|
246
|
+
[LLMProviders.YourProvider]: YourProviderClient; // Your provider's client type
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
// Update LLMInstanceOptions type mapping
|
|
250
|
+
export type LLMInstanceOptions = {
|
|
251
|
+
// ...existing code...
|
|
252
|
+
[LLMProviders.YourProvider]: {
|
|
253
|
+
apiKey: string;
|
|
254
|
+
// Add other provider-specific options
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
// Update LLMModelName type mapping
|
|
259
|
+
export type LLMModelName = {
|
|
260
|
+
// ...existing code...
|
|
261
|
+
[LLMProviders.YourProvider]: YourProviderModelNames;
|
|
262
|
+
};
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### 4. Implement Provider Constants
|
|
266
|
+
|
|
267
|
+
Define constants in `src/providers/YourProvider/YourProvider.constants.ts`:
|
|
268
|
+
|
|
269
|
+
```typescript
|
|
270
|
+
import {
|
|
271
|
+
type LLMProviderAvailableModels,
|
|
272
|
+
type LLMProviderModelsByPurpose,
|
|
273
|
+
type LLMProviders,
|
|
274
|
+
LLMPurposes,
|
|
275
|
+
type LLMServiceBuilder,
|
|
276
|
+
} from '../../LLMService.typedefs';
|
|
277
|
+
import { YourProviderModelNames } from './YourProvider.typedefs';
|
|
278
|
+
import {
|
|
279
|
+
YourProviderAssistanceService,
|
|
280
|
+
YourProviderCompletionService,
|
|
281
|
+
} from './services';
|
|
282
|
+
import { pick } from '../../functional.utils';
|
|
283
|
+
|
|
284
|
+
// Define available models with their capabilities and configurations
|
|
285
|
+
const YOUR_PROVIDER_AVAILABLE_MODELS: LLMProviderAvailableModels<
|
|
286
|
+
LLMProviders.YourProvider
|
|
287
|
+
> = {
|
|
288
|
+
[YourProviderModelNames.MODEL_ONE]: {
|
|
289
|
+
name: YourProviderModelNames.MODEL_ONE,
|
|
290
|
+
limits: {
|
|
291
|
+
maxInputTokens: 8_000,
|
|
292
|
+
maxOutputTokens: 2_000,
|
|
293
|
+
},
|
|
294
|
+
config: {
|
|
295
|
+
temperature: 0.2,
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
[YourProviderModelNames.MODEL_TWO]: {
|
|
299
|
+
name: YourProviderModelNames.MODEL_TWO,
|
|
300
|
+
limits: {
|
|
301
|
+
maxInputTokens: 16_000,
|
|
302
|
+
maxOutputTokens: 4_000,
|
|
303
|
+
},
|
|
304
|
+
config: {
|
|
305
|
+
temperature: 0.2,
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
// Specify which models are available for each purpose
|
|
311
|
+
export const YOUR_PROVIDER_MODELS: LLMProviderModelsByPurpose<
|
|
312
|
+
LLMPurposes,
|
|
313
|
+
LLMProviders.YourProvider
|
|
314
|
+
> = {
|
|
315
|
+
[LLMPurposes.Completion]: pick(
|
|
316
|
+
YOUR_PROVIDER_AVAILABLE_MODELS,
|
|
317
|
+
[
|
|
318
|
+
YourProviderModelNames.MODEL_ONE,
|
|
319
|
+
YourProviderModelNames.MODEL_TWO,
|
|
320
|
+
],
|
|
321
|
+
),
|
|
322
|
+
[LLMPurposes.Assistance]: pick(
|
|
323
|
+
YOUR_PROVIDER_AVAILABLE_MODELS,
|
|
324
|
+
[
|
|
325
|
+
YourProviderModelNames.MODEL_TWO, // Only MODEL_TWO supports assistance
|
|
326
|
+
],
|
|
327
|
+
),
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
// Define service builders for each LLM purpose
|
|
331
|
+
export const YOUR_PROVIDER_SERVICE_BUILDERS: {
|
|
332
|
+
[purpose in LLMPurposes]: (
|
|
333
|
+
LLMServiceBuilder<LLMProviders.YourProvider, purpose> | null
|
|
334
|
+
)
|
|
335
|
+
} = {
|
|
336
|
+
[LLMPurposes.Completion]: (logger, options) => (
|
|
337
|
+
new YourProviderCompletionService(logger, options)
|
|
338
|
+
),
|
|
339
|
+
[LLMPurposes.Assistance]: (logger, options) => (
|
|
340
|
+
new YourProviderAssistanceService(logger, options)
|
|
341
|
+
),
|
|
342
|
+
};
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### 5. Implement Provider Entity (if needed)
|
|
346
|
+
|
|
347
|
+
Create the entity class in `src/providers/YourProvider/YourProvider.entity.ts`:
|
|
348
|
+
|
|
349
|
+
```typescript
|
|
350
|
+
export class YourProviderEntity {
|
|
351
|
+
// Implement provider-specific methods
|
|
352
|
+
}
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### 6. Implement Service Classes
|
|
356
|
+
|
|
357
|
+
Create service implementations in the `services` directory:
|
|
358
|
+
|
|
359
|
+
**CompletionService (src/providers/YourProvider/services/YourProviderCompletionService.ts)**:
|
|
360
|
+
|
|
361
|
+
```typescript
|
|
362
|
+
import { Logger } from '../../../LLMService.typedefs';
|
|
363
|
+
import { LLMCompletionService } from '../../../services/LLMCompletionService.abstract';
|
|
364
|
+
import { CompletionParams, CompletionResult, LLMProviders } from '../../../LLMService.typedefs';
|
|
365
|
+
import { YourProviderEntity } from '../YourProvider.entity';
|
|
366
|
+
|
|
367
|
+
export class YourProviderCompletionService extends LLMCompletionService<LLMProviders.YourProvider> {
|
|
368
|
+
constructor(
|
|
369
|
+
logger: Logger,
|
|
370
|
+
private readonly providerEntity: YourProviderEntity,
|
|
371
|
+
) {
|
|
372
|
+
super(logger);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
async complete(params: CompletionParams): Promise<CompletionResult> {
|
|
376
|
+
this.logger.info('Starting completion with YourProvider', { params });
|
|
377
|
+
|
|
378
|
+
try {
|
|
379
|
+
// Implement provider-specific completion logic
|
|
380
|
+
|
|
381
|
+
return {
|
|
382
|
+
text: 'Completed text',
|
|
383
|
+
// Include other required fields
|
|
384
|
+
};
|
|
385
|
+
} catch (error) {
|
|
386
|
+
this.logger.error('Error in YourProvider completion', { error });
|
|
387
|
+
throw error;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
**AssistanceService (if applicable)**:
|
|
394
|
+
|
|
395
|
+
```typescript
|
|
396
|
+
import { Logger } from '../../../LLMService.typedefs';
|
|
397
|
+
import { LLMAssistanceService } from '../../../services/LLMAssistanceService.abstract';
|
|
398
|
+
import {
|
|
399
|
+
AssistantParams,
|
|
400
|
+
ThreadParams,
|
|
401
|
+
MessageParams,
|
|
402
|
+
LLMProviders
|
|
403
|
+
} from '../../../LLMService.typedefs';
|
|
404
|
+
import { YourProviderEntity } from '../YourProvider.entity';
|
|
405
|
+
|
|
406
|
+
export class YourProviderAssistanceService extends LLMAssistanceService<LLMProviders.YourProvider> {
|
|
407
|
+
constructor(
|
|
408
|
+
logger: Logger,
|
|
409
|
+
private readonly providerEntity: YourProviderEntity,
|
|
410
|
+
) {
|
|
411
|
+
super(logger);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// Implement required assistance methods
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### 7. Create Service Factory
|
|
419
|
+
|
|
420
|
+
First, define service builders in `src/providers/YourProvider/YourProvider.constants.ts`:
|
|
421
|
+
|
|
422
|
+
```typescript
|
|
423
|
+
import {
|
|
424
|
+
LLMPurposes,
|
|
425
|
+
type LLMServiceBuilder,
|
|
426
|
+
} from '../../LLMService.typedefs';
|
|
427
|
+
import {
|
|
428
|
+
YourProviderAssistanceService,
|
|
429
|
+
YourProviderCompletionService,
|
|
430
|
+
} from './services';
|
|
431
|
+
|
|
432
|
+
export const YOUR_PROVIDER_SERVICE_BUILDERS: {
|
|
433
|
+
[purpose in LLMPurposes]: (
|
|
434
|
+
LLMServiceBuilder<LLMProviders.YourProvider, purpose> | null
|
|
435
|
+
)
|
|
436
|
+
} = {
|
|
437
|
+
[LLMPurposes.Completion]: (logger, options) => (
|
|
438
|
+
new YourProviderCompletionService(logger, options)
|
|
439
|
+
),
|
|
440
|
+
[LLMPurposes.Assistance]: (logger, options) => (
|
|
441
|
+
new YourProviderAssistanceService(logger, options)
|
|
442
|
+
),
|
|
443
|
+
};
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
Then, implement the service factory in `src/providers/YourProvider/YourProviderService.factory.ts`:
|
|
447
|
+
|
|
448
|
+
```typescript
|
|
449
|
+
import { type Logger } from '@mate-academy/core';
|
|
450
|
+
import {
|
|
451
|
+
type LLMInstanceOptions,
|
|
452
|
+
LLMProviders,
|
|
453
|
+
type LLMPurposes,
|
|
454
|
+
type LLMServiceByPurpose,
|
|
455
|
+
} from '../../LLMService.typedefs';
|
|
456
|
+
import { LLMServicePurposeFactory } from '../../services';
|
|
457
|
+
import { YOUR_PROVIDER_SERVICE_BUILDERS } from './YourProvider.constants';
|
|
458
|
+
|
|
459
|
+
export class YourProviderServiceFactory extends LLMServicePurposeFactory<
|
|
460
|
+
LLMProviders.YourProvider
|
|
461
|
+
> {
|
|
462
|
+
createService<
|
|
463
|
+
Purpose extends LLMPurposes
|
|
464
|
+
>(
|
|
465
|
+
purpose: Purpose,
|
|
466
|
+
logger: Logger,
|
|
467
|
+
options: LLMInstanceOptions[LLMProviders.YourProvider],
|
|
468
|
+
): LLMServiceByPurpose<LLMProviders.YourProvider>[Purpose] {
|
|
469
|
+
const serviceBuilder = YOUR_PROVIDER_SERVICE_BUILDERS[purpose];
|
|
470
|
+
|
|
471
|
+
if (!serviceBuilder) {
|
|
472
|
+
throw new Error(`Purpose [${purpose}] is not supported for [${LLMProviders.YourProvider}] service`);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
return serviceBuilder(logger, options);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
### 8. Update Entry Point Files
|
|
481
|
+
|
|
482
|
+
Update the provider's `index.ts`:
|
|
483
|
+
|
|
484
|
+
```typescript
|
|
485
|
+
export * from './YourProvider.constants';
|
|
486
|
+
export * from './YourProvider.entity';
|
|
487
|
+
export * from './YourProvider.typedefs';
|
|
488
|
+
export * from './YourProviderService.factory';
|
|
489
|
+
export * from './services';
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
Update the main providers `index.ts` at `src/providers/index.ts`:
|
|
493
|
+
|
|
494
|
+
```typescript
|
|
495
|
+
// ... other providers
|
|
496
|
+
export * from './YourProvider';
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
### 9. Update LLM Service Factory
|
|
500
|
+
|
|
501
|
+
Modify `src/LLMService.factory.ts` to include your new provider:
|
|
502
|
+
|
|
503
|
+
```typescript
|
|
504
|
+
import {
|
|
505
|
+
LLMProviders,
|
|
506
|
+
Logger,
|
|
507
|
+
YourProviderOptions,
|
|
508
|
+
} from './LLMService.typedefs';
|
|
509
|
+
import { YourProviderServiceFactory } from './providers/YourProvider';
|
|
510
|
+
import { YourProviderOptions } from './providers/YourProvider/YourProvider.typedefs';
|
|
511
|
+
|
|
512
|
+
export class LLMServiceFactory {
|
|
513
|
+
static resolveProviderOptions<T extends LLMProviders>(
|
|
514
|
+
provider: T,
|
|
515
|
+
optionsMap: {
|
|
516
|
+
// ... other providers
|
|
517
|
+
[LLMProviders.YourProvider]?: YourProviderOptions;
|
|
518
|
+
},
|
|
519
|
+
) {
|
|
520
|
+
return optionsMap[provider];
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
static getCompletionService<T extends LLMProviders>(
|
|
524
|
+
provider: T,
|
|
525
|
+
logger: Logger,
|
|
526
|
+
options: any,
|
|
527
|
+
) {
|
|
528
|
+
switch (provider) {
|
|
529
|
+
// ... other providers
|
|
530
|
+
case LLMProviders.YourProvider:
|
|
531
|
+
return YourProviderServiceFactory.createCompletionService(logger, options);
|
|
532
|
+
default:
|
|
533
|
+
throw new Error(`Unsupported provider: ${provider}`);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
static getAssistanceService<T extends LLMProviders>(
|
|
538
|
+
provider: T,
|
|
539
|
+
logger: Logger,
|
|
540
|
+
options: any,
|
|
541
|
+
) {
|
|
542
|
+
switch (provider) {
|
|
543
|
+
// ... other providers
|
|
544
|
+
case LLMProviders.YourProvider:
|
|
545
|
+
return YourProviderServiceFactory.createAssistanceService(logger, options);
|
|
546
|
+
default:
|
|
547
|
+
throw new Error(`Unsupported provider: ${provider}`);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
```
|
|
552
|
+
|
|
176
553
|
## License
|
|
177
554
|
|
|
178
555
|
[MIT](LICENSE)
|
|
@@ -1,8 +1,51 @@
|
|
|
1
1
|
import { type Logger } from '@mate-academy/core';
|
|
2
2
|
import { type LLMInstanceOptions, LLMProviders, LLMPurposes, type LLMServiceByPurpose } from './LLMService.typedefs';
|
|
3
3
|
export declare class LLMServiceFactory {
|
|
4
|
+
/**
|
|
5
|
+
* Gets a service for the specified LLM purpose and provider
|
|
6
|
+
*
|
|
7
|
+
* @private
|
|
8
|
+
* @static
|
|
9
|
+
* @template Purpose - The purpose of the LLM service (Completion or Assistance)
|
|
10
|
+
* @template Provider - The LLM provider (OpenAI, GoogleGenerativeAI)
|
|
11
|
+
* @param {Purpose} purpose - The purpose of the service
|
|
12
|
+
* @param {Provider} provider - The LLM provider
|
|
13
|
+
* @param {Logger} logger - Logger instance
|
|
14
|
+
* @param {LLMInstanceOptions[Provider]} options - Provider-specific options
|
|
15
|
+
* @returns {LLMServiceByPurpose<Provider>[Purpose]} The LLM service instance
|
|
16
|
+
* @throws {Error} If the provider is not supported
|
|
17
|
+
*/
|
|
4
18
|
private static getService;
|
|
19
|
+
/**
|
|
20
|
+
* Gets a completion service for the specified LLM provider
|
|
21
|
+
*
|
|
22
|
+
* @static
|
|
23
|
+
* @template Provider - The LLM provider type
|
|
24
|
+
* @param {Provider} provider - The LLM provider (OpenAI, GoogleGenerativeAI)
|
|
25
|
+
* @param {Logger} logger - Logger instance
|
|
26
|
+
* @param {LLMInstanceOptions[Provider]} options - Provider-specific options
|
|
27
|
+
* @returns {LLMServiceByPurpose<Provider>[LLMPurposes.Completion]} A completion service instance
|
|
28
|
+
*/
|
|
5
29
|
static getCompletionService<Provider extends LLMProviders>(provider: Provider, logger: Logger, options: LLMInstanceOptions[Provider]): LLMServiceByPurpose<Provider>[LLMPurposes.Completion];
|
|
30
|
+
/**
|
|
31
|
+
* Gets an assistance service for the specified LLM provider
|
|
32
|
+
*
|
|
33
|
+
* @static
|
|
34
|
+
* @template Provider - The LLM provider type
|
|
35
|
+
* @param {Provider} provider - The LLM provider (OpenAI, GoogleGenerativeAI)
|
|
36
|
+
* @param {Logger} logger - Logger instance
|
|
37
|
+
* @param {LLMInstanceOptions[Provider]} options - Provider-specific options
|
|
38
|
+
* @returns {LLMServiceByPurpose<Provider>[LLMPurposes.Assistance]} An assistance service instance
|
|
39
|
+
*/
|
|
6
40
|
static getAssistanceService<Provider extends LLMProviders>(provider: Provider, logger: Logger, options: LLMInstanceOptions[Provider]): LLMServiceByPurpose<Provider>[LLMPurposes.Assistance];
|
|
41
|
+
/**
|
|
42
|
+
* Resolves the options for the specified provider from an options map
|
|
43
|
+
*
|
|
44
|
+
* @static
|
|
45
|
+
* @template Provider - The LLM provider type
|
|
46
|
+
* @param {Provider} provider - The LLM provider to get options for
|
|
47
|
+
* @param {Record<Provider, LLMInstanceOptions[Provider]>} options - Map of provider options
|
|
48
|
+
* @returns {LLMInstanceOptions[Provider]} The options for the specified provider
|
|
49
|
+
*/
|
|
7
50
|
static resolveProviderOptions<Provider extends LLMProviders>(provider: Provider, options: Record<Provider, LLMInstanceOptions[Provider]>): LLMInstanceOptions[Provider];
|
|
8
51
|
}
|
|
@@ -4,6 +4,20 @@ exports.LLMServiceFactory = void 0;
|
|
|
4
4
|
const LLMService_typedefs_1 = require("./LLMService.typedefs");
|
|
5
5
|
const LLMService_constants_1 = require("./LLMService.constants");
|
|
6
6
|
class LLMServiceFactory {
|
|
7
|
+
/**
|
|
8
|
+
* Gets a service for the specified LLM purpose and provider
|
|
9
|
+
*
|
|
10
|
+
* @private
|
|
11
|
+
* @static
|
|
12
|
+
* @template Purpose - The purpose of the LLM service (Completion or Assistance)
|
|
13
|
+
* @template Provider - The LLM provider (OpenAI, GoogleGenerativeAI)
|
|
14
|
+
* @param {Purpose} purpose - The purpose of the service
|
|
15
|
+
* @param {Provider} provider - The LLM provider
|
|
16
|
+
* @param {Logger} logger - Logger instance
|
|
17
|
+
* @param {LLMInstanceOptions[Provider]} options - Provider-specific options
|
|
18
|
+
* @returns {LLMServiceByPurpose<Provider>[Purpose]} The LLM service instance
|
|
19
|
+
* @throws {Error} If the provider is not supported
|
|
20
|
+
*/
|
|
7
21
|
static getService(purpose, provider, logger, options) {
|
|
8
22
|
switch (provider) {
|
|
9
23
|
case LLMService_typedefs_1.LLMProviders.OpenAI:
|
|
@@ -14,12 +28,41 @@ class LLMServiceFactory {
|
|
|
14
28
|
throw new Error(`Provider [${provider}] is not supported`);
|
|
15
29
|
}
|
|
16
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Gets a completion service for the specified LLM provider
|
|
33
|
+
*
|
|
34
|
+
* @static
|
|
35
|
+
* @template Provider - The LLM provider type
|
|
36
|
+
* @param {Provider} provider - The LLM provider (OpenAI, GoogleGenerativeAI)
|
|
37
|
+
* @param {Logger} logger - Logger instance
|
|
38
|
+
* @param {LLMInstanceOptions[Provider]} options - Provider-specific options
|
|
39
|
+
* @returns {LLMServiceByPurpose<Provider>[LLMPurposes.Completion]} A completion service instance
|
|
40
|
+
*/
|
|
17
41
|
static getCompletionService(provider, logger, options) {
|
|
18
42
|
return this.getService(LLMService_typedefs_1.LLMPurposes.Completion, provider, logger, options);
|
|
19
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Gets an assistance service for the specified LLM provider
|
|
46
|
+
*
|
|
47
|
+
* @static
|
|
48
|
+
* @template Provider - The LLM provider type
|
|
49
|
+
* @param {Provider} provider - The LLM provider (OpenAI, GoogleGenerativeAI)
|
|
50
|
+
* @param {Logger} logger - Logger instance
|
|
51
|
+
* @param {LLMInstanceOptions[Provider]} options - Provider-specific options
|
|
52
|
+
* @returns {LLMServiceByPurpose<Provider>[LLMPurposes.Assistance]} An assistance service instance
|
|
53
|
+
*/
|
|
20
54
|
static getAssistanceService(provider, logger, options) {
|
|
21
55
|
return this.getService(LLMService_typedefs_1.LLMPurposes.Assistance, provider, logger, options);
|
|
22
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Resolves the options for the specified provider from an options map
|
|
59
|
+
*
|
|
60
|
+
* @static
|
|
61
|
+
* @template Provider - The LLM provider type
|
|
62
|
+
* @param {Provider} provider - The LLM provider to get options for
|
|
63
|
+
* @param {Record<Provider, LLMInstanceOptions[Provider]>} options - Map of provider options
|
|
64
|
+
* @returns {LLMInstanceOptions[Provider]} The options for the specified provider
|
|
65
|
+
*/
|
|
23
66
|
static resolveProviderOptions(provider, options) {
|
|
24
67
|
return options[provider];
|
|
25
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LLMService.factory.js","sourceRoot":"","sources":["../src/LLMService.factory.ts"],"names":[],"mappings":";;;AACA,+DAK+B;AAC/B,iEAA+D;AAE/D,MAAa,iBAAiB;
|
|
1
|
+
{"version":3,"file":"LLMService.factory.js","sourceRoot":"","sources":["../src/LLMService.factory.ts"],"names":[],"mappings":";;;AACA,+DAK+B;AAC/B,iEAA+D;AAE/D,MAAa,iBAAiB;IAC5B;;;;;;;;;;;;;OAaG;IACK,MAAM,CAAC,UAAU,CAIvB,OAAgB,EAChB,QAAkB,EAClB,MAAc,EACd,OAAqC;QAErC,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,kCAAY,CAAC,MAAM,CAAC;YACzB,KAAK,kCAAY,CAAC,kBAAkB;gBAClC,OAAO,4CAAqB,CAAC,QAAQ,CAAC;qBACnC,aAAa,CACZ,OAAO,EACP,MAAM,EACN,OAAO,CACR,CAAC;YAEN;gBACE,MAAM,IAAI,KAAK,CAAC,aAAa,QAAQ,oBAAoB,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,oBAAoB,CACzB,QAAkB,EAClB,MAAc,EACd,OAAqC;QAErC,OAAO,IAAI,CAAC,UAAU,CAAC,iCAAW,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,oBAAoB,CACzB,QAAkB,EAClB,MAAc,EACd,OAAqC;QAErC,OAAO,IAAI,CAAC,UAAU,CAAC,iCAAW,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,sBAAsB,CAC3B,QAAkB,EAClB,OAAuD;QAEvD,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;CACF;AA1FD,8CA0FC"}
|
|
@@ -5,100 +5,202 @@ import { type OpenAIModelNames } from './providers/OpenAI/OpenAI.typedefs';
|
|
|
5
5
|
import { type GoogleGenerativeAIModelNames } from './providers/GoogleGenerativeAI/GoogleGenerativeAI.typedefs';
|
|
6
6
|
import { type LLMCompletionService } from './services/LLMCompletionService.abstract';
|
|
7
7
|
import { type LLMAssistanceService } from './services/LLMAssistanceService.abstract';
|
|
8
|
+
/**
|
|
9
|
+
* Enum of supported LLM providers.
|
|
10
|
+
*/
|
|
8
11
|
export declare enum LLMProviders {
|
|
9
12
|
OpenAI = "OpenAI",
|
|
10
13
|
GoogleGenerativeAI = "GoogleGenerativeAI"
|
|
11
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Maps each LLM provider to its corresponding instance type.
|
|
17
|
+
*/
|
|
12
18
|
export type LLMInstances = {
|
|
13
19
|
[LLMProviders.OpenAI]: OpenAI;
|
|
14
20
|
[LLMProviders.GoogleGenerativeAI]: GoogleGenAI;
|
|
15
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* Configuration options for initializing each LLM provider's client.
|
|
24
|
+
*/
|
|
16
25
|
export type LLMInstanceOptions = {
|
|
17
26
|
[LLMProviders.OpenAI]: ClientOptions;
|
|
18
27
|
[LLMProviders.GoogleGenerativeAI]: {
|
|
19
28
|
apiKey: string;
|
|
20
29
|
};
|
|
21
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Supported service purposes/types that the LLM gateway provides.
|
|
33
|
+
*/
|
|
22
34
|
export declare enum LLMPurposes {
|
|
23
35
|
Completion = "completion",
|
|
24
36
|
Assistance = "assistance"
|
|
25
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Maps each LLM purpose to its corresponding service implementation for a specific provider.
|
|
40
|
+
* @template Provider - The LLM provider type
|
|
41
|
+
*/
|
|
26
42
|
export type LLMServiceByPurpose<Provider extends LLMProviders> = {
|
|
27
43
|
[LLMPurposes.Completion]: LLMCompletionService<Provider>;
|
|
28
44
|
[LLMPurposes.Assistance]: LLMAssistanceService<Provider>;
|
|
29
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* Function type for building an LLM service instance for a specific provider and purpose.
|
|
48
|
+
* @template Provider - The LLM provider type
|
|
49
|
+
* @template Purpose - The service purpose type
|
|
50
|
+
* @param logger - Logger instance for service logging
|
|
51
|
+
* @param options - Provider-specific configuration options
|
|
52
|
+
* @returns An instance of the requested LLM service
|
|
53
|
+
*/
|
|
30
54
|
export type LLMServiceBuilder<Provider extends LLMProviders, Purpose extends LLMPurposes> = (logger: Logger, options: LLMInstanceOptions[Provider]) => LLMServiceByPurpose<Provider>[Purpose];
|
|
55
|
+
/**
|
|
56
|
+
* Defines token limits for LLM models.
|
|
57
|
+
*/
|
|
31
58
|
export interface LLMLimits {
|
|
32
59
|
maxInputTokens: number;
|
|
33
60
|
maxOutputTokens: number;
|
|
34
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Configuration parameters that control LLM generation behavior.
|
|
64
|
+
*/
|
|
35
65
|
export interface LLMConfig {
|
|
36
66
|
temperature?: number;
|
|
37
67
|
top_p?: number | null;
|
|
38
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Maps a provider to all available models it can access.
|
|
71
|
+
* @template Provider - The LLM provider type
|
|
72
|
+
*/
|
|
39
73
|
export type LLMProviderAvailableModels<Provider extends LLMProviders> = Record<LLMModelName[Provider], LLMModel<Provider>>;
|
|
74
|
+
/**
|
|
75
|
+
* Maps service purposes to the available models for a specific provider.
|
|
76
|
+
* @template Purpose - The service purpose type
|
|
77
|
+
* @template Provider - The LLM provider type
|
|
78
|
+
*/
|
|
40
79
|
export type LLMProviderModelsByPurpose<Purpose extends LLMPurposes, Provider extends LLMProviders> = Record<Purpose, Partial<LLMProviderAvailableModels<Provider>>>;
|
|
80
|
+
/**
|
|
81
|
+
* Maps each provider to its supported model names.
|
|
82
|
+
*/
|
|
41
83
|
export type LLMModelName = {
|
|
42
84
|
[LLMProviders.OpenAI]: OpenAIModelNames;
|
|
43
85
|
[LLMProviders.GoogleGenerativeAI]: GoogleGenerativeAIModelNames;
|
|
44
86
|
};
|
|
87
|
+
/**
|
|
88
|
+
* Represents an LLM model with its configuration and limitations.
|
|
89
|
+
* @template Provider - The LLM provider type
|
|
90
|
+
*/
|
|
45
91
|
export interface LLMModel<Provider extends LLMProviders> {
|
|
46
92
|
name: LLMModelName[Provider];
|
|
47
93
|
limits: LLMLimits;
|
|
48
94
|
config: LLMConfig;
|
|
49
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Roles that can be assigned to messages in an LLM conversation.
|
|
98
|
+
*/
|
|
50
99
|
export declare enum LLMRoles {
|
|
51
100
|
User = "user",
|
|
52
101
|
Assistant = "assistant"
|
|
53
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Represents a message in an LLM conversation.
|
|
105
|
+
*/
|
|
54
106
|
export interface LLMMessage {
|
|
55
107
|
role: LLMRoles;
|
|
56
108
|
content: string;
|
|
57
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Represents an error that occurred during an LLM request.
|
|
112
|
+
*/
|
|
58
113
|
export type LLMRequestError = Error;
|
|
114
|
+
/**
|
|
115
|
+
* Generic result type for LLM requests that can either succeed or fail.
|
|
116
|
+
* @template R - The type of the successful result
|
|
117
|
+
*/
|
|
59
118
|
export type LLMRequestResult<R> = R | {
|
|
60
119
|
error: LLMRequestError;
|
|
61
120
|
};
|
|
121
|
+
/**
|
|
122
|
+
* Result type for LLM completion requests.
|
|
123
|
+
*/
|
|
62
124
|
export type LLMCompletionResult = LLMRequestResult<{
|
|
63
125
|
text: string;
|
|
64
126
|
}>;
|
|
127
|
+
/**
|
|
128
|
+
* Options for sending a message to an LLM service.
|
|
129
|
+
* @template Provider - The LLM provider type
|
|
130
|
+
*/
|
|
65
131
|
export interface LLMSendMessageOptions<Provider extends LLMProviders> {
|
|
66
132
|
message: LLMMessage;
|
|
67
133
|
model: LLMModel<Provider>;
|
|
68
134
|
history?: LLMMessage[];
|
|
69
135
|
instructions?: string;
|
|
70
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* Supported MIME types for files that can be uploaded to LLM services.
|
|
139
|
+
*/
|
|
71
140
|
export declare enum LLMUploadFileMimeTypes {
|
|
72
141
|
PNG = "image/png",
|
|
73
142
|
PLAIN_TEXT = "text/plain"
|
|
74
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* Represents a file to be uploaded to an LLM service.
|
|
146
|
+
*/
|
|
75
147
|
export interface LLMUploadFile {
|
|
76
148
|
mimeType: LLMUploadFileMimeTypes;
|
|
77
149
|
name: string;
|
|
78
150
|
path: string;
|
|
79
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* Represents a file that has been successfully uploaded to an LLM service.
|
|
154
|
+
*/
|
|
80
155
|
export interface LLMUploadedFile extends LLMUploadFile {
|
|
81
156
|
fileId: string;
|
|
82
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Result type for file upload operations.
|
|
160
|
+
*/
|
|
83
161
|
export type LLMUploadFileResult = LLMRequestResult<LLMUploadedFile>;
|
|
162
|
+
/**
|
|
163
|
+
* Options for creating a file storage for a specific LLM provider.
|
|
164
|
+
* @template Provider - The LLM provider type
|
|
165
|
+
*/
|
|
84
166
|
export interface LLMCreateFileStorageOptions<Provider extends LLMProviders> {
|
|
85
167
|
uploadedFiles: LLMUploadedFile[];
|
|
86
168
|
model: LLMModel<Provider>;
|
|
87
169
|
instructions?: string;
|
|
88
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Represents a created file storage in an LLM service.
|
|
173
|
+
*/
|
|
89
174
|
export interface LLMCreatedFileStorage {
|
|
90
175
|
storageId: string;
|
|
91
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* Result type for file storage creation operations.
|
|
179
|
+
*/
|
|
92
180
|
export type LLMCreateFileStorageResult = LLMRequestResult<LLMCreatedFileStorage>;
|
|
181
|
+
/**
|
|
182
|
+
* Options for creating an assistant with a specific LLM provider.
|
|
183
|
+
* @template Provider - The LLM provider type
|
|
184
|
+
*/
|
|
93
185
|
export interface LLMCreateAssistantOptions<Provider extends LLMProviders> {
|
|
94
186
|
model: LLMModel<Provider>;
|
|
95
187
|
instructions?: string;
|
|
96
188
|
storageIds?: string[];
|
|
97
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* Represents a created assistant in an LLM service.
|
|
192
|
+
*/
|
|
98
193
|
export interface LLMCreatedAssistant {
|
|
99
194
|
assistantId: string;
|
|
100
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* Result type for assistant creation operations.
|
|
198
|
+
*/
|
|
101
199
|
export type LLMCreateAssistantResult = LLMRequestResult<LLMCreatedAssistant>;
|
|
200
|
+
/**
|
|
201
|
+
* Options for creating a chat session with a specific LLM provider.
|
|
202
|
+
* @template Provider - The LLM provider type
|
|
203
|
+
*/
|
|
102
204
|
export interface LLMCreateChatOptions<Provider extends LLMProviders> {
|
|
103
205
|
model: LLMModel<Provider>;
|
|
104
206
|
instructions?: string;
|
|
@@ -106,21 +208,44 @@ export interface LLMCreateChatOptions<Provider extends LLMProviders> {
|
|
|
106
208
|
files?: LLMUploadedFile[];
|
|
107
209
|
storageId?: string;
|
|
108
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Represents a created chat session in an LLM service.
|
|
213
|
+
*/
|
|
109
214
|
export interface LLMCreatedChat {
|
|
110
215
|
chatId: string;
|
|
111
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* Result type for chat creation operations.
|
|
219
|
+
*/
|
|
112
220
|
export type LLMCreateChatResult = LLMRequestResult<LLMCreatedChat>;
|
|
221
|
+
/**
|
|
222
|
+
* Extends LLMMessage with attachment and instruction capabilities for assistance services.
|
|
223
|
+
*/
|
|
113
224
|
export interface LLMAssistanceMessage extends LLMMessage {
|
|
114
225
|
attachment?: LLMUploadFileResult;
|
|
115
226
|
instructions?: string;
|
|
116
227
|
}
|
|
228
|
+
/**
|
|
229
|
+
* Options for using an assistant with a specific LLM provider.
|
|
230
|
+
* @template Provider - The LLM provider type
|
|
231
|
+
*/
|
|
117
232
|
export interface LLMAssistanceOptions<Provider extends LLMProviders> {
|
|
118
233
|
model: LLMModel<Provider>;
|
|
119
234
|
message: LLMAssistanceMessage;
|
|
120
235
|
chatId: string;
|
|
121
236
|
assistantId: string;
|
|
122
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* Result type for assistance requests.
|
|
240
|
+
*/
|
|
123
241
|
export type LLMAssistanceResult = LLMRequestResult<{
|
|
124
242
|
text: string;
|
|
125
243
|
}>;
|
|
244
|
+
/**
|
|
245
|
+
* Function type for counting tokens in messages for a specific provider's model.
|
|
246
|
+
* @template Provider - The LLM provider type
|
|
247
|
+
* @param messages - Array of message strings to count tokens for
|
|
248
|
+
* @param model - The LLM model to use for token counting
|
|
249
|
+
* @returns Promise resolving to the number of tokens
|
|
250
|
+
*/
|
|
126
251
|
export type LLMCountTokensFunction<Provider extends LLMProviders> = (messages: string[], model: LLMModel<Provider>) => Promise<number>;
|
|
@@ -1,21 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LLMUploadFileMimeTypes = exports.LLMRoles = exports.LLMPurposes = exports.LLMProviders = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Enum of supported LLM providers.
|
|
6
|
+
*/
|
|
4
7
|
var LLMProviders;
|
|
5
8
|
(function (LLMProviders) {
|
|
6
9
|
LLMProviders["OpenAI"] = "OpenAI";
|
|
7
10
|
LLMProviders["GoogleGenerativeAI"] = "GoogleGenerativeAI";
|
|
8
11
|
})(LLMProviders || (exports.LLMProviders = LLMProviders = {}));
|
|
12
|
+
/**
|
|
13
|
+
* Supported service purposes/types that the LLM gateway provides.
|
|
14
|
+
*/
|
|
9
15
|
var LLMPurposes;
|
|
10
16
|
(function (LLMPurposes) {
|
|
11
17
|
LLMPurposes["Completion"] = "completion";
|
|
12
18
|
LLMPurposes["Assistance"] = "assistance";
|
|
13
19
|
})(LLMPurposes || (exports.LLMPurposes = LLMPurposes = {}));
|
|
20
|
+
/**
|
|
21
|
+
* Roles that can be assigned to messages in an LLM conversation.
|
|
22
|
+
*/
|
|
14
23
|
var LLMRoles;
|
|
15
24
|
(function (LLMRoles) {
|
|
16
25
|
LLMRoles["User"] = "user";
|
|
17
26
|
LLMRoles["Assistant"] = "assistant";
|
|
18
27
|
})(LLMRoles || (exports.LLMRoles = LLMRoles = {}));
|
|
28
|
+
/**
|
|
29
|
+
* Supported MIME types for files that can be uploaded to LLM services.
|
|
30
|
+
*/
|
|
19
31
|
var LLMUploadFileMimeTypes;
|
|
20
32
|
(function (LLMUploadFileMimeTypes) {
|
|
21
33
|
LLMUploadFileMimeTypes["PNG"] = "image/png";
|
|
@@ -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":";;;AAQA;;GAEG;AACH,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,yDAAyC,CAAA;AAC3C,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAkBD;;GAEG;AACH,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,wCAAyB,CAAA;IACzB,wCAAyB,CAAA;AAC3B,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAqFD;;GAEG;AACH,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,mCAAuB,CAAA;AACzB,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAqCD;;GAEG;AACH,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,2CAAiB,CAAA;IACjB,mDAAyB,CAAA;AAC3B,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC"}
|
|
@@ -85,6 +85,7 @@ exports.GOOGLE_AI_MODELS = {
|
|
|
85
85
|
GoogleGenerativeAI_typedefs_1.GoogleGenerativeAIModelNames.GEMINI_2_0_FLASH,
|
|
86
86
|
GoogleGenerativeAI_typedefs_1.GoogleGenerativeAIModelNames.GEMINI_2_5_PRO_PREVIEW,
|
|
87
87
|
]),
|
|
88
|
+
// Stable models are used for assistance as they support additional methods
|
|
88
89
|
[LLMService_typedefs_1.LLMPurposes.Assistance]: (0, functional_utils_1.pick)(GOOGLE_AI_AVAILABLE_MODELS, [
|
|
89
90
|
GoogleGenerativeAI_typedefs_1.GoogleGenerativeAIModelNames.GEMINI_1_5_FLASH_STABLE,
|
|
90
91
|
GoogleGenerativeAI_typedefs_1.GoogleGenerativeAIModelNames.GEMINI_1_5_PRO_STABLE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleGenerativeAI.constants.js","sourceRoot":"","sources":["../../../src/providers/GoogleGenerativeAI/GoogleGenerativeAI.constants.ts"],"names":[],"mappings":";;;AAAA,mEAMmC;AACnC,+EAA6E;AAC7E,0EAGqD;AACrD,6DAA8C;AAEjC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YACzB,eAAe,EAAE,KAAK;SACvB;QACD,MAAM,EAAE;YACN,WAAW,EAAE,GAAG;SACjB;KACF;IACD,CAAC,0DAA4B,CAAC,sBAAsB,CAAC,EAAE;QACrD,IAAI,EAAE,0DAA4B,CAAC,sBAAsB;QACzD,MAAM,EAAE;YACN,cAAc,EAAE,SAAS;YACzB,eAAe,EAAE,MAAM;SACxB;QACD,MAAM,EAAE;YACN,WAAW,EAAE,GAAG;SACjB;KACF;CACF,CAAC;AAEW,QAAA,gBAAgB,GAGzB;IACF,CAAC,iCAAW,CAAC,UAAU,CAAC,EAAE,IAAA,uBAAI,EAC5B,0BAA0B,EAC1B;QACE,0DAA4B,CAAC,gBAAgB;QAC7C,0DAA4B,CAAC,cAAc;QAC3C,0DAA4B,CAAC,gBAAgB;QAC7C,0DAA4B,CAAC,sBAAsB;KACpD,CACF;
|
|
1
|
+
{"version":3,"file":"GoogleGenerativeAI.constants.js","sourceRoot":"","sources":["../../../src/providers/GoogleGenerativeAI/GoogleGenerativeAI.constants.ts"],"names":[],"mappings":";;;AAAA,mEAMmC;AACnC,+EAA6E;AAC7E,0EAGqD;AACrD,6DAA8C;AAEjC,QAAA,wBAAwB,GAAG,MAAM,CAAC;AAE/C,MAAM,0BAA0B,GAE5B;IACF,CAAC,0DAA4B,CAAC,gBAAgB,CAAC,EAAE;QAC/C,IAAI,EAAE,0DAA4B,CAAC,gBAAgB;QACnD,MAAM,EAAE;YACN,cAAc,EAAE,SAAS;YACzB,eAAe,EAAE,KAAK;SACvB;QACD,MAAM,EAAE;YACN,WAAW,EAAE,GAAG;SACjB;KACF;IACD,CAAC,0DAA4B,CAAC,uBAAuB,CAAC,EAAE;QACtD,IAAI,EAAE,0DAA4B,CAAC,uBAAuB;QAC1D,MAAM,EAAE;YACN,cAAc,EAAE,SAAS;YACzB,eAAe,EAAE,KAAK;SACvB;QACD,MAAM,EAAE;YACN,WAAW,EAAE,GAAG;SACjB;KACF;IACD,CAAC,0DAA4B,CAAC,cAAc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,sBAAsB;KACpD,CACF;IACD,2EAA2E;IAC3E,CAAC,iCAAW,CAAC,UAAU,CAAC,EAAE,IAAA,uBAAI,EAC5B,0BAA0B,EAC1B;QACE,0DAA4B,CAAC,uBAAuB;QACpD,0DAA4B,CAAC,qBAAqB;QAClD,0DAA4B,CAAC,uBAAuB;KACrD,CACF;CACF,CAAC;AAEW,QAAA,0BAA0B,GAInC;IACF,CAAC,iCAAW,CAAC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,CAC7C,IAAI,8CAAmC,CAAC,MAAM,EAAE,OAAO,CAAC,CACzD;IACD,CAAC,iCAAW,CAAC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,CAC7C,IAAI,8CAAmC,CAAC,MAAM,EAAE,OAAO,CAAC,CACzD;CACF,CAAC"}
|
|
@@ -173,11 +173,13 @@ class GoogleGenerativeAIAssistanceService extends services_1.LLMAssistanceServic
|
|
|
173
173
|
return Promise.resolve();
|
|
174
174
|
}
|
|
175
175
|
createAssistant() {
|
|
176
|
+
// Google Generative AI does not have an assistant concept at the moment
|
|
176
177
|
return Promise.resolve({
|
|
177
178
|
assistantId: '',
|
|
178
179
|
});
|
|
179
180
|
}
|
|
180
181
|
deleteAssistant() {
|
|
182
|
+
// Google Generative AI does not have an assistant concept at the moment
|
|
181
183
|
return Promise.resolve();
|
|
182
184
|
}
|
|
183
185
|
async assistInChat(options) {
|
package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleGenerativeAIAssistance.service.js","sourceRoot":"","sources":["../../../../src/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.ts"],"names":[],"mappings":";;;AACA,+BAAoC;AACpC,yCAKuB;AACvB,sEAasC;AACtC,gDAAyD;AACzD,gFAAyE;AACzE,4EAAwE;AACxE,kFAA2E;AAE3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,CAAC,CAAC;YAEL,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IAED,UAAU,CACR,MAAc;QAEd,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAEjC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,eAAe;
|
|
1
|
+
{"version":3,"file":"GoogleGenerativeAIAssistance.service.js","sourceRoot":"","sources":["../../../../src/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.ts"],"names":[],"mappings":";;;AACA,+BAAoC;AACpC,yCAKuB;AACvB,sEAasC;AACtC,gDAAyD;AACzD,gFAAyE;AACzE,4EAAwE;AACxE,kFAA2E;AAE3E,MAAa,mCACX,SAAQ,+BAAqD;IAC7D,SAAS,GAAuB,IAAI,CAAC;IAE7B,aAAa,GAA+B,IAAI,GAAG,EAAE,CAAC;IAEtD,YAAY,GAAsB,IAAI,GAAG,EAAE,CAAC;IAE5C,aAAa,GAAiC,IAAI,GAAG,EAAE,CAAC;IAEhE,YACE,MAAc,EACd,OAA4D;QAE5D,KAAK,CAAC,kCAAY,CAAC,kBAAkB,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED,IAAc,QAAQ;QACpB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,IAAI,CAAC,SAAS,GAAG,IAAI,mBAAW,CAAC;gBAC/B,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;aAC5B,CAAC,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,IAAmB;QAClC,IAAI,CAAC;YACH,MAAM,EACJ,IAAI,EACJ,QAAQ,EACR,IAAI,GACL,GAAG,IAAI,CAAC;YAET,MAAM,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,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