n8n-nodes-vlm 2.0.5 → 2.0.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.
@@ -373,7 +373,12 @@ class VLMComplexityWorkflow {
373
373
  this.logger.debug('No documents found to classify');
374
374
  return [items];
375
375
  }
376
- this.logger.debug(`Classifying ${documents.length} documents with model: ${model}`);
376
+ // Debug: Log how many documents have images
377
+ const docsWithImages = documents.filter((doc) => doc.base64Image).length;
378
+ this.logger.debug(`Classifying ${documents.length} documents with model: ${model} (${docsWithImages} have images)`);
379
+ if (docsWithImages === 0) {
380
+ this.logger.warn('⚠️ No images found in documents! Binary extraction may have failed. Check that input items have binary data.');
381
+ }
377
382
  try {
378
383
  // Classify documents
379
384
  const classifiedDocs = await (0, vlm_logic_1.classifyDocuments)(this, {
@@ -40,6 +40,7 @@ async function checkServerStatus(context, serverUrl, timeout = 5000) {
40
40
  * Classify a single document's complexity using VLM Classifier API
41
41
  */
42
42
  async function classifyDocumentComplexity(context, serverUrl, document, timeout) {
43
+ var _a, _b, _c, _d, _e, _f, _g;
43
44
  try {
44
45
  // Prepare document content for classification
45
46
  const content = document.pageContent || JSON.stringify(document);
@@ -50,7 +51,12 @@ async function classifyDocumentComplexity(context, serverUrl, document, timeout)
50
51
  };
51
52
  if (hasImage) {
52
53
  requestBody.image = document.image || document.base64Image;
54
+ (_a = context.logger) === null || _a === void 0 ? void 0 : _a.debug(`VLM Classification: Sending request with image (${requestBody.image.substring(0, 50)}...)`);
53
55
  }
56
+ else {
57
+ (_b = context.logger) === null || _b === void 0 ? void 0 : _b.debug('VLM Classification: Sending request without image');
58
+ }
59
+ (_c = context.logger) === null || _c === void 0 ? void 0 : _c.debug(`VLM Classification: Calling ${serverUrl}/api/classify`);
54
60
  const response = await context.helpers.httpRequest({
55
61
  method: 'POST',
56
62
  url: `${serverUrl}/api/classify`,
@@ -62,6 +68,7 @@ async function classifyDocumentComplexity(context, serverUrl, document, timeout)
62
68
  json: true,
63
69
  timeout,
64
70
  });
71
+ (_d = context.logger) === null || _d === void 0 ? void 0 : _d.debug(`VLM Classification: Received response: ${JSON.stringify(response)}`);
65
72
  return {
66
73
  complexity: response.complexity || response.classification || 'LOW',
67
74
  confidence: response.confidence,
@@ -71,10 +78,16 @@ async function classifyDocumentComplexity(context, serverUrl, document, timeout)
71
78
  }
72
79
  catch (error) {
73
80
  // On error, default to LOW complexity to not filter out documents
81
+ (_e = context.logger) === null || _e === void 0 ? void 0 : _e.error(`VLM Classification FAILED: ${error.message}`, ((_f = error.response) === null || _f === void 0 ? void 0 : _f.body) || error);
74
82
  console.warn('Classification failed, defaulting to LOW complexity:', error.message);
83
+ if ((_g = error.response) === null || _g === void 0 ? void 0 : _g.body) {
84
+ console.warn('Error response body:', error.response.body);
85
+ }
75
86
  return {
76
87
  complexity: 'LOW',
77
88
  confidence: 0,
89
+ processingTime: undefined,
90
+ modelUsed: 'ERROR - Classification failed',
78
91
  };
79
92
  }
80
93
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-vlm",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "Vision-Language Models for n8n - Lightweight specialized VLMs for document analysis and classification",
5
5
  "main": "index.js",
6
6
  "author": "Gabriel BRUMENT",