n8n-nodes-vlm 2.0.6 → 2.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.
@@ -46,20 +46,25 @@ async function classifyDocumentComplexity(context, serverUrl, document, timeout)
46
46
  const content = document.pageContent || JSON.stringify(document);
47
47
  // Check if document contains image data
48
48
  const hasImage = document.image || document.base64Image;
49
- let requestBody = {
50
- text: content,
51
- };
49
+ // For /api/classify/base64 endpoint, only send image field
50
+ let requestBody;
52
51
  if (hasImage) {
53
- requestBody.image = document.image || document.base64Image;
52
+ requestBody = {
53
+ image: document.base64Image || document.image
54
+ };
54
55
  (_a = context.logger) === null || _a === void 0 ? void 0 : _a.debug(`VLM Classification: Sending request with image (${requestBody.image.substring(0, 50)}...)`);
55
56
  }
56
57
  else {
57
- (_b = context.logger) === null || _b === void 0 ? void 0 : _b.debug('VLM Classification: Sending request without image');
58
+ // Fallback: send text if no image available
59
+ requestBody = {
60
+ text: content,
61
+ };
62
+ (_b = context.logger) === null || _b === void 0 ? void 0 : _b.debug('VLM Classification: Sending request without image (text only)');
58
63
  }
59
- (_c = context.logger) === null || _c === void 0 ? void 0 : _c.debug(`VLM Classification: Calling ${serverUrl}/api/classify`);
64
+ (_c = context.logger) === null || _c === void 0 ? void 0 : _c.debug(`VLM Classification: Calling ${serverUrl}/api/classify/base64`);
60
65
  const response = await context.helpers.httpRequest({
61
66
  method: 'POST',
62
- url: `${serverUrl}/api/classify`,
67
+ url: `${serverUrl}/api/classify/base64`,
63
68
  headers: {
64
69
  'Content-Type': 'application/json',
65
70
  Accept: 'application/json',
@@ -70,9 +75,9 @@ async function classifyDocumentComplexity(context, serverUrl, document, timeout)
70
75
  });
71
76
  (_d = context.logger) === null || _d === void 0 ? void 0 : _d.debug(`VLM Classification: Received response: ${JSON.stringify(response)}`);
72
77
  return {
73
- complexity: response.complexity || response.classification || 'LOW',
78
+ complexity: response.class_name || response.complexity || response.classification || 'LOW',
74
79
  confidence: response.confidence,
75
- processingTime: response.processing_time || response.processingTime,
80
+ processingTime: response.processing_time || response.processingTime || response.latency_ms,
76
81
  modelUsed: response.model || 'VLM-Classifier',
77
82
  };
78
83
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "n8n-nodes-vlm",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
4
4
  "description": "Vision-Language Models for n8n - Lightweight specialized VLMs for document analysis and classification",
5
5
  "main": "index.js",
6
- "author": "Gabriel BRUMENT",
6
+ "author": "Nicolas Geysse",
7
7
  "license": "MIT",
8
8
  "repository": {
9
9
  "type": "git",