n8n-nodes-vlm 2.0.6 → 2.0.7
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
|
-
|
|
50
|
-
|
|
51
|
-
};
|
|
49
|
+
// For /api/classify/base64 endpoint, only send image field
|
|
50
|
+
let requestBody;
|
|
52
51
|
if (hasImage) {
|
|
53
|
-
requestBody
|
|
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
|
-
|
|
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',
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-vlm",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "Vision-Language Models for n8n - Lightweight specialized VLMs for document analysis and classification",
|
|
5
5
|
"main": "index.js",
|
|
6
|
-
"author": "
|
|
6
|
+
"author": "Nicolas Geysse",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|