@contentgrowth/llm-service 1.0.6 → 1.0.8

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.d.cts CHANGED
@@ -84,6 +84,15 @@ declare class BaseLLMProvider {
84
84
  videoUri?: string;
85
85
  error?: object;
86
86
  }>;
87
+ /**
88
+ * Extract structured data from a file (Multimodal)
89
+ * @param {Buffer|string} fileData - File content (base64 or buffer)
90
+ * @param {string} mimeType - File mime type (e.g. 'application/pdf')
91
+ * @param {string} prompt - Extraction instructions
92
+ * @param {Object} schema - Optional JSON schema
93
+ * @param {Object} options - Options
94
+ */
95
+ extractWithLLM(fileData: Buffer | string, mimeType: string, prompt: string, schema: any, options: any): Promise<void>;
87
96
  /**
88
97
  * Helper to get the last 6 digits of the API key for logging.
89
98
  * @returns {string} "..." + last 6 chars, or "not_set"
@@ -345,11 +354,12 @@ declare class LLMService {
345
354
  * @param {Buffer|string} fileData - File content (base64 or buffer)
346
355
  * @param {string} mimeType - File mime type (e.g. 'application/pdf')
347
356
  * @param {string} prompt - Extraction instructions
348
- * @param {string} tenantId - Tenant ID
349
- * @param {Object} schema - Optional JSON schema
350
- * @param {Object} options - Options
357
+ * @param {string|null} tenantId - Tenant ID
358
+ * @param {Object|null} [schema] - Optional JSON schema
359
+ * @param {Object} [options] - Options
360
+ * @returns {Promise<any>} Extracted data
351
361
  */
352
- extractWithLLM(fileData: Buffer | string, mimeType: string, prompt: string, tenantId: string, schema?: any, options?: any): Promise<any>;
362
+ extractWithLLM(fileData: Buffer | string, mimeType: string, prompt: string, tenantId: string | null, schema?: any | null, options?: any): Promise<any>;
353
363
  }
354
364
  declare class LLMServiceException extends Error {
355
365
  constructor(message: any, statusCode?: number, details?: any);
package/dist/index.d.ts CHANGED
@@ -84,6 +84,15 @@ declare class BaseLLMProvider {
84
84
  videoUri?: string;
85
85
  error?: object;
86
86
  }>;
87
+ /**
88
+ * Extract structured data from a file (Multimodal)
89
+ * @param {Buffer|string} fileData - File content (base64 or buffer)
90
+ * @param {string} mimeType - File mime type (e.g. 'application/pdf')
91
+ * @param {string} prompt - Extraction instructions
92
+ * @param {Object} schema - Optional JSON schema
93
+ * @param {Object} options - Options
94
+ */
95
+ extractWithLLM(fileData: Buffer | string, mimeType: string, prompt: string, schema: any, options: any): Promise<void>;
87
96
  /**
88
97
  * Helper to get the last 6 digits of the API key for logging.
89
98
  * @returns {string} "..." + last 6 chars, or "not_set"
@@ -345,11 +354,12 @@ declare class LLMService {
345
354
  * @param {Buffer|string} fileData - File content (base64 or buffer)
346
355
  * @param {string} mimeType - File mime type (e.g. 'application/pdf')
347
356
  * @param {string} prompt - Extraction instructions
348
- * @param {string} tenantId - Tenant ID
349
- * @param {Object} schema - Optional JSON schema
350
- * @param {Object} options - Options
357
+ * @param {string|null} tenantId - Tenant ID
358
+ * @param {Object|null} [schema] - Optional JSON schema
359
+ * @param {Object} [options] - Options
360
+ * @returns {Promise<any>} Extracted data
351
361
  */
352
- extractWithLLM(fileData: Buffer | string, mimeType: string, prompt: string, tenantId: string, schema?: any, options?: any): Promise<any>;
362
+ extractWithLLM(fileData: Buffer | string, mimeType: string, prompt: string, tenantId: string | null, schema?: any | null, options?: any): Promise<any>;
353
363
  }
354
364
  declare class LLMServiceException extends Error {
355
365
  constructor(message: any, statusCode?: number, details?: any);
package/dist/index.js CHANGED
@@ -259,6 +259,17 @@ var BaseLLMProvider = class {
259
259
  async getVideoGenerationStatus(operationName) {
260
260
  throw new Error("Video generation not supported by this provider");
261
261
  }
262
+ /**
263
+ * Extract structured data from a file (Multimodal)
264
+ * @param {Buffer|string} fileData - File content (base64 or buffer)
265
+ * @param {string} mimeType - File mime type (e.g. 'application/pdf')
266
+ * @param {string} prompt - Extraction instructions
267
+ * @param {Object} schema - Optional JSON schema
268
+ * @param {Object} options - Options
269
+ */
270
+ async extractWithLLM(fileData, mimeType, prompt, schema, options) {
271
+ throw new Error("This provider does not support extractWithLLM (Multimodal extraction)");
272
+ }
262
273
  /**
263
274
  * Helper to get the last 6 digits of the API key for logging.
264
275
  * @returns {string} "..." + last 6 chars, or "not_set"
@@ -1313,9 +1324,10 @@ var LLMService = class {
1313
1324
  * @param {Buffer|string} fileData - File content (base64 or buffer)
1314
1325
  * @param {string} mimeType - File mime type (e.g. 'application/pdf')
1315
1326
  * @param {string} prompt - Extraction instructions
1316
- * @param {string} tenantId - Tenant ID
1317
- * @param {Object} schema - Optional JSON schema
1318
- * @param {Object} options - Options
1327
+ * @param {string|null} tenantId - Tenant ID
1328
+ * @param {Object|null} [schema] - Optional JSON schema
1329
+ * @param {Object} [options] - Options
1330
+ * @returns {Promise<any>} Extracted data
1319
1331
  */
1320
1332
  async extractWithLLM(fileData, mimeType, prompt, tenantId, schema = null, options = {}) {
1321
1333
  const provider = await this._getProvider(tenantId);