n8n-nodes-ollama-reranker 1.4.0 → 1.4.2
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.
|
@@ -145,6 +145,11 @@ class OllamaReranker {
|
|
|
145
145
|
value: 'custom',
|
|
146
146
|
description: 'Custom /api/rerank endpoint (for deposium-embeddings-turbov2, etc.)',
|
|
147
147
|
},
|
|
148
|
+
{
|
|
149
|
+
name: 'VL Classifier API',
|
|
150
|
+
value: 'vl-classifier',
|
|
151
|
+
description: 'Document complexity classification with VL models (vl-classifier, lfm25-vl)',
|
|
152
|
+
},
|
|
148
153
|
],
|
|
149
154
|
default: 'ollama',
|
|
150
155
|
description: 'Which API endpoint to use for reranking',
|
|
@@ -148,6 +148,11 @@ class OllamaRerankerWorkflow {
|
|
|
148
148
|
value: 'custom',
|
|
149
149
|
description: 'Custom /api/rerank endpoint (for deposium-embeddings-turbov2, etc.)',
|
|
150
150
|
},
|
|
151
|
+
{
|
|
152
|
+
name: 'VL Classifier API',
|
|
153
|
+
value: 'vl-classifier',
|
|
154
|
+
description: 'Document complexity classification with VL models (vl-classifier, lfm25-vl)',
|
|
155
|
+
},
|
|
151
156
|
],
|
|
152
157
|
default: 'ollama',
|
|
153
158
|
description: 'Which API endpoint to use for reranking',
|
|
@@ -408,7 +408,7 @@ async function detectServerType(context, serverUrl) {
|
|
|
408
408
|
/**
|
|
409
409
|
* Classify document complexity using VL Classifier API
|
|
410
410
|
*/
|
|
411
|
-
async function classifyDocumentComplexity(context, serverUrl, document, timeout) {
|
|
411
|
+
async function classifyDocumentComplexity(context, serverUrl, document, timeout, model) {
|
|
412
412
|
try {
|
|
413
413
|
// Prepare document content for classification
|
|
414
414
|
const content = document.pageContent || JSON.stringify(document);
|
|
@@ -417,6 +417,7 @@ async function classifyDocumentComplexity(context, serverUrl, document, timeout)
|
|
|
417
417
|
const hasImage = document.image || document.base64Image;
|
|
418
418
|
let requestBody = {
|
|
419
419
|
text: content,
|
|
420
|
+
model: model || 'vl-classifier',
|
|
420
421
|
};
|
|
421
422
|
if (hasImage) {
|
|
422
423
|
requestBody.image = document.image || document.base64Image;
|
|
@@ -455,7 +456,7 @@ async function rerankWithVLClassifier(context, config) {
|
|
|
455
456
|
const { ollamaHost, model, query, documents, topK, threshold, timeout, includeOriginalScores, classificationStrategy = 'metadata', filterComplexity = 'both' } = config;
|
|
456
457
|
// Step 1: Classify all documents
|
|
457
458
|
const classificationPromises = documents.map(async (doc, index) => {
|
|
458
|
-
const classification = await classifyDocumentComplexity(context, ollamaHost, doc, timeout);
|
|
459
|
+
const classification = await classifyDocumentComplexity(context, ollamaHost, doc, timeout, model);
|
|
459
460
|
return { doc, index, classification };
|
|
460
461
|
});
|
|
461
462
|
const classifiedDocs = await Promise.all(classificationPromises);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-ollama-reranker",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "Ollama Reranker for n8n - VL Classifier integration + Auto-detect + Dynamic model loading (Vector Store provider + workflow node)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Gabriel BRUMENT",
|
|
@@ -56,12 +56,15 @@
|
|
|
56
56
|
"husky": "^9.1.7",
|
|
57
57
|
"jest": "^29.0.0",
|
|
58
58
|
"lint-staged": "^15.2.11",
|
|
59
|
+
"n8n-workflow": "^1.0.0",
|
|
59
60
|
"prettier": "^3.4.2",
|
|
60
61
|
"ts-jest": "^29.0.0",
|
|
61
62
|
"typescript": "^5.0.0"
|
|
62
63
|
},
|
|
64
|
+
"peerDependencies": {
|
|
65
|
+
"n8n-workflow": "^1.0.0"
|
|
66
|
+
},
|
|
63
67
|
"dependencies": {
|
|
64
|
-
"n8n-workflow": "^1.0.0",
|
|
65
68
|
"form-data": "^4.0.4"
|
|
66
69
|
},
|
|
67
70
|
"lint-staged": {
|