@contentgrowth/llm-service 1.3.4 → 1.3.6

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/index.cjs CHANGED
@@ -42,6 +42,7 @@ __export(index_exports, {
42
42
  LLMService: () => LLMService,
43
43
  LLMServiceException: () => LLMServiceException,
44
44
  MODEL_CONFIGS: () => MODEL_CONFIGS,
45
+ Modality: () => import_genai2.Modality,
45
46
  OpenAIProvider: () => OpenAIProvider,
46
47
  TranscriptionService: () => TranscriptionService,
47
48
  TranscriptionServiceException: () => TranscriptionServiceException,
@@ -246,6 +247,8 @@ var MODEL_CONFIGS = {
246
247
  fast: "gemini-3.8-flash",
247
248
  cost: "gemini-3.5-flash-lite",
248
249
  free: "gemini-3.5-flash-lite",
250
+ live: "gemini-3.8-live",
251
+ liveThinking: "gemini-3.8-live-extended-thinking",
249
252
  video: "veo",
250
253
  image: "gemini-3-pro-image"
251
254
  },
@@ -256,6 +259,8 @@ var MODEL_CONFIGS = {
256
259
  fast: "gemini-3.7-flash",
257
260
  cost: "gemini-3.5-flash-lite",
258
261
  free: "gemini-3.5-flash-lite",
262
+ live: "gemini-3.8-live",
263
+ liveThinking: "gemini-3.8-live-extended-thinking",
259
264
  video: "veo",
260
265
  image: "gemini-3.1-flash-image"
261
266
  },
@@ -432,6 +437,13 @@ var BaseLLMProvider = class {
432
437
  async extractWithLLM(fileData, mimeType, prompt, schema, options) {
433
438
  throw new Error("This provider does not support extractWithLLM (Multimodal extraction)");
434
439
  }
440
+ /**
441
+ * Connect to a bidirectional real-time Live session
442
+ * @param {Object} options - { model, config, callbacks }
443
+ */
444
+ async connectLive(options) {
445
+ throw new Error(`This provider (${this.constructor.name}) does not support live real-time sessions`);
446
+ }
435
447
  /**
436
448
  * Helper to get the last 6 digits of the API key for logging.
437
449
  * @returns {string} "..." + last 6 chars, or "not_set"
@@ -1355,6 +1367,27 @@ ${prompt}` : prompt;
1355
1367
  throw error;
1356
1368
  }
1357
1369
  }
1370
+ /**
1371
+ * Connect to Gemini Live bidirectional real-time audio/text session
1372
+ *
1373
+ * @param {Object} options
1374
+ * @param {string} [options.model] - Model name (e.g. models/gemini-2.5-flash-native-audio-preview-09-2025)
1375
+ * @param {Object} options.config - Live session configuration
1376
+ * @param {Object} options.callbacks - Event callbacks (onopen, onmessage, onerror, onclose)
1377
+ * @returns {Promise<any>} The active Live session
1378
+ */
1379
+ async connectLive({ model, config, callbacks }) {
1380
+ var _a, _b, _c;
1381
+ if (!((_b = (_a = this.client) == null ? void 0 : _a.live) == null ? void 0 : _b.connect)) {
1382
+ throw new LLMServiceException("The configured Google provider SDK does not support live sessions.", 500);
1383
+ }
1384
+ const resolvedModel = model || ((_c = this.models) == null ? void 0 : _c.live) || "gemini-3.8-live";
1385
+ return this.client.live.connect({
1386
+ model: resolvedModel,
1387
+ config,
1388
+ callbacks
1389
+ });
1390
+ }
1358
1391
  };
1359
1392
 
1360
1393
  // src/llm/providers/anthropic-provider.js
@@ -1887,6 +1920,21 @@ var LLMService = class {
1887
1920
  }
1888
1921
  return provider.extractWithLLM(fileData, mimeType, prompt, schema, options);
1889
1922
  }
1923
+ /**
1924
+ * Connect to a bidirectional real-time Live session
1925
+ *
1926
+ * @param {Object} params - { model, config, callbacks }
1927
+ * @param {string|null} [tenantId] - Tenant ID
1928
+ * @returns {Promise<any>} The active Live session
1929
+ */
1930
+ async connectLive(params, tenantId = null) {
1931
+ var _a;
1932
+ const provider = await this._getProvider(tenantId);
1933
+ if (typeof provider.connectLive !== "function") {
1934
+ throw new LLMServiceException(`Provider ${((_a = provider.config) == null ? void 0 : _a.provider) || provider.constructor.name} does not support live real-time sessions`, 400);
1935
+ }
1936
+ return provider.connectLive(params);
1937
+ }
1890
1938
  };
1891
1939
  var LLMServiceException = class extends Error {
1892
1940
  constructor(message, statusCode = 500, details = null) {
@@ -2221,6 +2269,9 @@ function createSpeechHandler(app, getConfig) {
2221
2269
  });
2222
2270
  return app;
2223
2271
  }
2272
+
2273
+ // src/index.js
2274
+ var import_genai2 = require("@google/genai");
2224
2275
  // Annotate the CommonJS export names for ESM import in node:
2225
2276
  0 && (module.exports = {
2226
2277
  AnthropicProvider,
@@ -2234,6 +2285,7 @@ function createSpeechHandler(app, getConfig) {
2234
2285
  LLMService,
2235
2286
  LLMServiceException,
2236
2287
  MODEL_CONFIGS,
2288
+ Modality,
2237
2289
  OpenAIProvider,
2238
2290
  TranscriptionService,
2239
2291
  TranscriptionServiceException,