n8n-nodes-vlm 1.0.2 → 2.0.0
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.
|
@@ -33,26 +33,55 @@ class VLMComplexityClassifier {
|
|
|
33
33
|
outputNames: ['Classifier'],
|
|
34
34
|
credentials: [
|
|
35
35
|
{
|
|
36
|
-
name: '
|
|
37
|
-
required:
|
|
36
|
+
name: 'ollamaApi',
|
|
37
|
+
required: true,
|
|
38
38
|
},
|
|
39
39
|
],
|
|
40
|
+
requestDefaults: {
|
|
41
|
+
ignoreHttpStatusErrors: true,
|
|
42
|
+
baseURL: '={{ $credentials.baseUrl.replace(new RegExp("/$"), "") }}',
|
|
43
|
+
},
|
|
40
44
|
properties: [
|
|
41
|
-
{
|
|
42
|
-
displayName: 'Server URL',
|
|
43
|
-
name: 'serverUrl',
|
|
44
|
-
type: 'string',
|
|
45
|
-
default: 'http://localhost:8000',
|
|
46
|
-
placeholder: 'http://localhost:8000',
|
|
47
|
-
description: 'URL to your VLM classifier server (e.g., deposium-embeddings-turbov2)',
|
|
48
|
-
required: true,
|
|
49
|
-
},
|
|
50
45
|
{
|
|
51
46
|
displayName: 'Model',
|
|
52
47
|
name: 'model',
|
|
53
|
-
type: '
|
|
54
|
-
default: '
|
|
55
|
-
description: 'VLM model to use
|
|
48
|
+
type: 'options',
|
|
49
|
+
default: '',
|
|
50
|
+
description: 'The VLM classifier model to use - models are loaded from your configured Ollama/Custom API server',
|
|
51
|
+
typeOptions: {
|
|
52
|
+
loadOptions: {
|
|
53
|
+
routing: {
|
|
54
|
+
request: {
|
|
55
|
+
method: 'GET',
|
|
56
|
+
url: '/api/tags',
|
|
57
|
+
},
|
|
58
|
+
output: {
|
|
59
|
+
postReceive: [
|
|
60
|
+
{
|
|
61
|
+
type: 'rootProperty',
|
|
62
|
+
properties: {
|
|
63
|
+
property: 'models',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: 'setKeyValue',
|
|
68
|
+
properties: {
|
|
69
|
+
name: '={{$responseItem.name}}',
|
|
70
|
+
value: '={{$responseItem.name}}',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type: 'sort',
|
|
75
|
+
properties: {
|
|
76
|
+
key: 'name',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
required: true,
|
|
56
85
|
},
|
|
57
86
|
{
|
|
58
87
|
displayName: 'Classification Strategy',
|
|
@@ -139,8 +168,10 @@ class VLMComplexityClassifier {
|
|
|
139
168
|
var _a;
|
|
140
169
|
this.logger.debug('Initializing VLM Complexity Classifier Provider');
|
|
141
170
|
const self = this;
|
|
171
|
+
// Get credentials
|
|
172
|
+
const credentials = await this.getCredentials('ollamaApi');
|
|
173
|
+
const serverUrl = credentials.baseUrl.replace(/\/$/, '');
|
|
142
174
|
// Get node parameters
|
|
143
|
-
const serverUrl = this.getNodeParameter('serverUrl', 0).replace(/\/$/, '');
|
|
144
175
|
const model = this.getNodeParameter('model', 0);
|
|
145
176
|
const classificationStrategy = this.getNodeParameter('classificationStrategy', 0);
|
|
146
177
|
const filterComplexity = this.getNodeParameter('filterComplexity', 0, 'both');
|
|
@@ -33,26 +33,55 @@ class VLMComplexityWorkflow {
|
|
|
33
33
|
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
34
34
|
credentials: [
|
|
35
35
|
{
|
|
36
|
-
name: '
|
|
37
|
-
required:
|
|
36
|
+
name: 'ollamaApi',
|
|
37
|
+
required: true,
|
|
38
38
|
},
|
|
39
39
|
],
|
|
40
|
+
requestDefaults: {
|
|
41
|
+
ignoreHttpStatusErrors: true,
|
|
42
|
+
baseURL: '={{ $credentials.baseUrl.replace(new RegExp("/$"), "") }}',
|
|
43
|
+
},
|
|
40
44
|
properties: [
|
|
41
|
-
{
|
|
42
|
-
displayName: 'Server URL',
|
|
43
|
-
name: 'serverUrl',
|
|
44
|
-
type: 'string',
|
|
45
|
-
default: 'http://localhost:8000',
|
|
46
|
-
placeholder: 'http://localhost:8000',
|
|
47
|
-
description: 'URL to your VLM classifier server (e.g., deposium-embeddings-turbov2)',
|
|
48
|
-
required: true,
|
|
49
|
-
},
|
|
50
45
|
{
|
|
51
46
|
displayName: 'Model',
|
|
52
47
|
name: 'model',
|
|
53
|
-
type: '
|
|
54
|
-
default: '
|
|
55
|
-
description: 'VLM model to use
|
|
48
|
+
type: 'options',
|
|
49
|
+
default: '',
|
|
50
|
+
description: 'The VLM classifier model to use - models are loaded from your configured Ollama/Custom API server',
|
|
51
|
+
typeOptions: {
|
|
52
|
+
loadOptions: {
|
|
53
|
+
routing: {
|
|
54
|
+
request: {
|
|
55
|
+
method: 'GET',
|
|
56
|
+
url: '/api/tags',
|
|
57
|
+
},
|
|
58
|
+
output: {
|
|
59
|
+
postReceive: [
|
|
60
|
+
{
|
|
61
|
+
type: 'rootProperty',
|
|
62
|
+
properties: {
|
|
63
|
+
property: 'models',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: 'setKeyValue',
|
|
68
|
+
properties: {
|
|
69
|
+
name: '={{$responseItem.name}}',
|
|
70
|
+
value: '={{$responseItem.name}}',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type: 'sort',
|
|
75
|
+
properties: {
|
|
76
|
+
key: 'name',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
required: true,
|
|
56
85
|
},
|
|
57
86
|
{
|
|
58
87
|
displayName: 'Document Source',
|
|
@@ -211,8 +240,10 @@ class VLMComplexityWorkflow {
|
|
|
211
240
|
var _a, _b;
|
|
212
241
|
const items = this.getInputData();
|
|
213
242
|
this.logger.debug(`VLM Complexity Workflow: Processing ${items.length} input items`);
|
|
243
|
+
// Get credentials
|
|
244
|
+
const credentials = await this.getCredentials('ollamaApi');
|
|
245
|
+
const serverUrl = credentials.baseUrl.replace(/\/$/, '');
|
|
214
246
|
// Get node parameters
|
|
215
|
-
const serverUrl = this.getNodeParameter('serverUrl', 0).replace(/\/$/, '');
|
|
216
247
|
const model = this.getNodeParameter('model', 0);
|
|
217
248
|
const documentSource = this.getNodeParameter('documentSource', 0);
|
|
218
249
|
const classificationStrategy = this.getNodeParameter('classificationStrategy', 0);
|
package/package.json
CHANGED