node-red-contrib-ollama 0.2.6 → 0.4.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.
- package/nodes/ollama-abort.html +3 -5
- package/nodes/ollama-abort.js +1 -5
- package/nodes/ollama-chat.html +114 -54
- package/nodes/ollama-chat.js +56 -19
- package/nodes/ollama-copy.html +44 -9
- package/nodes/ollama-copy.js +39 -9
- package/nodes/ollama-create.html +173 -17
- package/nodes/ollama-create.js +164 -20
- package/nodes/ollama-delete.html +19 -11
- package/nodes/ollama-delete.js +18 -9
- package/nodes/ollama-embed.html +91 -41
- package/nodes/ollama-embed.js +52 -14
- package/nodes/ollama-generate.html +156 -21
- package/nodes/ollama-generate.js +122 -21
- package/nodes/ollama-list.html +3 -5
- package/nodes/ollama-list.js +1 -5
- package/nodes/ollama-ps.html +3 -5
- package/nodes/ollama-ps.js +1 -5
- package/nodes/ollama-pull.html +33 -13
- package/nodes/ollama-pull.js +26 -13
- package/nodes/ollama-push.html +33 -13
- package/nodes/ollama-push.js +24 -11
- package/nodes/ollama-show.html +56 -15
- package/nodes/ollama-show.js +59 -21
- package/package.json +2 -3
- package/nodes/ollama-config-model.html +0 -18
- package/nodes/ollama-config-model.js +0 -9
package/nodes/ollama-embed.html
CHANGED
|
@@ -5,7 +5,13 @@
|
|
|
5
5
|
defaults: {
|
|
6
6
|
name: { value: 'Ollama Embed' },
|
|
7
7
|
server: { value: '', type: 'ollama-config-server', required: false },
|
|
8
|
-
model: { value: '',
|
|
8
|
+
model: { value: '', required: false },
|
|
9
|
+
modelType: { value: 'str', required: false },
|
|
10
|
+
input: { value: '', required: false },
|
|
11
|
+
inputType: { value: 'str', required: false },
|
|
12
|
+
truncate: { value: false, required: false },
|
|
13
|
+
keepAlive: { value: '5m', required: false },
|
|
14
|
+
keepAliveType: { value: 'str', required: false },
|
|
9
15
|
options: { value: '', type: 'ollama-config-options', required: false },
|
|
10
16
|
},
|
|
11
17
|
inputs: 1,
|
|
@@ -14,6 +20,37 @@
|
|
|
14
20
|
label: function() {
|
|
15
21
|
return this.name || 'ollama-embed';
|
|
16
22
|
},
|
|
23
|
+
oneditprepare: function() {
|
|
24
|
+
if( !this.modelType ) {
|
|
25
|
+
this.modelType = 'str'
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
$( '#node-input-model' ).typedInput( {
|
|
29
|
+
type: 'str',
|
|
30
|
+
types: [ 'str', 'msg', 'flow', 'global' ],
|
|
31
|
+
typeField: '#node-input-modelType'
|
|
32
|
+
} )
|
|
33
|
+
|
|
34
|
+
if( !this.inputType ) {
|
|
35
|
+
this.inputType = 'str'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
$( '#node-input-input' ).typedInput( {
|
|
39
|
+
type: 'str',
|
|
40
|
+
types: [ 'str', 'json', 'msg', 'flow', 'global' ],
|
|
41
|
+
typeField: '#node-input-inputType'
|
|
42
|
+
} )
|
|
43
|
+
|
|
44
|
+
if( !this.keepAliveType ) {
|
|
45
|
+
this.keepAliveType = 'str'
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
$( '#node-input-keepAlive' ).typedInput( {
|
|
49
|
+
type: 'str',
|
|
50
|
+
types: [ 'str', 'num' ],
|
|
51
|
+
typeField: '#node-input-keepAliveType'
|
|
52
|
+
} )
|
|
53
|
+
}
|
|
17
54
|
} )
|
|
18
55
|
</script>
|
|
19
56
|
|
|
@@ -29,8 +66,26 @@
|
|
|
29
66
|
</div>
|
|
30
67
|
|
|
31
68
|
<div class="form-row">
|
|
32
|
-
<label for="node-input-model"><i class="fa fa-
|
|
69
|
+
<label for="node-input-model"><i class="fa fa-comment"></i> Model</label>
|
|
33
70
|
<input type="text" id="node-input-model" />
|
|
71
|
+
<input type="hidden" id="node-input-modelType" />
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<div class="form-row">
|
|
75
|
+
<label for="node-input-input"><i class="fa fa-comment"></i> Input</label>
|
|
76
|
+
<input type="text" id="node-input-input" />
|
|
77
|
+
<input type="hidden" id="node-input-inputType" />
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div class="form-row">
|
|
81
|
+
<label for="node-input-truncate"><i class="fa fa-cog"></i> Truncate</label>
|
|
82
|
+
<input type="checkbox" id="node-input-truncate" />
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<div class="form-row">
|
|
86
|
+
<label for="node-input-keepAlive"><i class="fa fa-cog"></i> Keep Alive</label>
|
|
87
|
+
<input type="text" id="node-input-keepAlive" />
|
|
88
|
+
<input type="hidden" id="node-input-keepAliveType" />
|
|
34
89
|
</div>
|
|
35
90
|
|
|
36
91
|
<div class="form-row">
|
|
@@ -50,28 +105,23 @@
|
|
|
50
105
|
</dt>
|
|
51
106
|
|
|
52
107
|
<dd>
|
|
53
|
-
The payload object
|
|
108
|
+
The payload object is an alternative way to configure the node.<br />
|
|
109
|
+
Any properties in the payload object will override the node configuration.
|
|
54
110
|
|
|
55
111
|
<dl class="message-properties">
|
|
56
112
|
<dt class="optional">
|
|
57
113
|
payload.host <span class="property-type">string</span>
|
|
58
114
|
</dt>
|
|
59
|
-
<dd>
|
|
60
|
-
The host of the Ollama instance.<br />
|
|
61
|
-
<em>Alternative to the <code>Server</code> field.</em>
|
|
62
|
-
</dd>
|
|
115
|
+
<dd>The host of the Ollama instance.</dd>
|
|
63
116
|
|
|
64
117
|
<dt class="optional">
|
|
65
118
|
payload.model <span class="property-type">string</span>
|
|
66
119
|
</dt>
|
|
67
|
-
<dd>
|
|
68
|
-
The name of the model used to generate the embeddings.<br />
|
|
69
|
-
<em>Alternative to the <code>Model</code> field.</em>
|
|
70
|
-
</dd>
|
|
120
|
+
<dd>The name of the model used to generate the embeddings.</dd>
|
|
71
121
|
|
|
72
|
-
<dt>
|
|
122
|
+
<dt class="optional">
|
|
73
123
|
payload.input <span class="property-type">string | array[string]</span>
|
|
74
|
-
</
|
|
124
|
+
</d>
|
|
75
125
|
<dd>The input used to generate the embeddings.</dd>
|
|
76
126
|
|
|
77
127
|
<dt class="optional">
|
|
@@ -93,140 +143,140 @@
|
|
|
93
143
|
|
|
94
144
|
<h4>Options</h4>
|
|
95
145
|
<dl class="message-properties">
|
|
96
|
-
<dt>
|
|
146
|
+
<dt class="optional">
|
|
97
147
|
numa <span class="property-type">boolean</span>
|
|
98
148
|
</dt>
|
|
99
149
|
<dd>Use NUMA for the runtime.</dd>
|
|
100
150
|
|
|
101
|
-
<dt>
|
|
151
|
+
<dt class="optional">
|
|
102
152
|
num_ctx <span class="property-type">number</span>
|
|
103
153
|
</dt>
|
|
104
154
|
<dd>The number of contexts to use.</dd>
|
|
105
155
|
|
|
106
|
-
<dt>
|
|
156
|
+
<dt class="optional">
|
|
107
157
|
num_batch <span class="property-type">number</span>
|
|
108
158
|
</dt>
|
|
109
159
|
<dd>The number of batches to use.</dd>
|
|
110
160
|
|
|
111
|
-
<dt>
|
|
161
|
+
<dt class="optional">
|
|
112
162
|
main_gpu <span class="property-type">number</span>
|
|
113
163
|
</dt>
|
|
114
164
|
<dd>The main GPU to use.</dd>
|
|
115
165
|
|
|
116
|
-
<dt>
|
|
166
|
+
<dt class="optional">
|
|
117
167
|
low_vram <span class="property-type">boolean</span>
|
|
118
168
|
</dt>
|
|
119
169
|
<dd>Use low VRAM.</dd>
|
|
120
170
|
|
|
121
|
-
<dt>
|
|
171
|
+
<dt class="optional">
|
|
122
172
|
f16_kv <span class="property-type">boolean</span>
|
|
123
173
|
</dt>
|
|
124
174
|
<dd>Use f16 key-value.</dd>
|
|
125
175
|
|
|
126
|
-
<dt>
|
|
176
|
+
<dt class="optional">
|
|
127
177
|
logits_all <span class="property-type">boolean</span>
|
|
128
178
|
</dt>
|
|
129
179
|
<dd>Return all logits.</dd>
|
|
130
180
|
|
|
131
|
-
<dt>
|
|
181
|
+
<dt class="optional">
|
|
132
182
|
vocab_only <span class="property-type">boolean</span>
|
|
133
183
|
</dt>
|
|
134
184
|
<dd>Return only the vocabulary.</dd>
|
|
135
185
|
|
|
136
|
-
<dt>
|
|
186
|
+
<dt class="optional">
|
|
137
187
|
use_nmap <span class="property-type">boolean</span>
|
|
138
188
|
</dt>
|
|
139
189
|
<dd>Use NMAP.</dd>
|
|
140
190
|
|
|
141
|
-
<dt>
|
|
191
|
+
<dt class="optional">
|
|
142
192
|
use_mlock <span class="property-type">boolean</span>
|
|
143
193
|
</dt>
|
|
144
194
|
<dd>Use mlock.</dd>
|
|
145
195
|
|
|
146
|
-
<dt>
|
|
196
|
+
<dt class="optional">
|
|
147
197
|
embedding_only <span class="property-type">boolean</span>
|
|
148
198
|
</dt>
|
|
149
199
|
<dd>Return only the embeddings.</dd>
|
|
150
200
|
|
|
151
|
-
<dt>
|
|
201
|
+
<dt class="optional">
|
|
152
202
|
num_thread <span class="property-type">number</span>
|
|
153
203
|
</dt>
|
|
154
204
|
<dd>The number of threads to use.</dd>
|
|
155
205
|
|
|
156
|
-
<dt>
|
|
206
|
+
<dt class="optional">
|
|
157
207
|
num_keep <span class="property-type">number</span>
|
|
158
208
|
</dt>
|
|
159
209
|
<dd>The number of models to keep.</dd>
|
|
160
210
|
|
|
161
|
-
<dt>
|
|
211
|
+
<dt class="optional">
|
|
162
212
|
seed <span class="property-type">number</span>
|
|
163
213
|
</dt>
|
|
164
214
|
<dd>The seed to use.</dd>
|
|
165
215
|
|
|
166
|
-
<dt>
|
|
216
|
+
<dt class="optional">
|
|
167
217
|
num_predict <span class="property-type">number</span>
|
|
168
218
|
</dt>
|
|
169
219
|
<dd>The number of predictions to use.</dd>
|
|
170
220
|
|
|
171
|
-
<dt>
|
|
221
|
+
<dt class="optional">
|
|
172
222
|
top_k <span class="property-type">number</span>
|
|
173
223
|
</dt>
|
|
174
224
|
<dd>The top k to use.</dd>
|
|
175
225
|
|
|
176
|
-
<dt>
|
|
226
|
+
<dt class="optional">
|
|
177
227
|
top_p <span class="property-type">number</span>
|
|
178
228
|
</dt>
|
|
179
229
|
<dd>The top p to use.</dd>
|
|
180
230
|
|
|
181
|
-
<dt>
|
|
231
|
+
<dt class="optional">
|
|
182
232
|
typical_p <span class="property-type">number</span>
|
|
183
233
|
</dt>
|
|
184
234
|
<dd>The typical p to use.</dd>
|
|
185
235
|
|
|
186
|
-
<dt>
|
|
236
|
+
<dt class="optional">
|
|
187
237
|
repeat_last_n <span class="property-type">number</span>
|
|
188
238
|
</dt>
|
|
189
239
|
<dd>The repeat last n to use.</dd>
|
|
190
240
|
|
|
191
|
-
<dt>
|
|
241
|
+
<dt class="optional">
|
|
192
242
|
temperature <span class="property-type">number</span>
|
|
193
243
|
</dt>
|
|
194
244
|
<dd>The temperature to use.</dd>
|
|
195
245
|
|
|
196
|
-
<dt>
|
|
246
|
+
<dt class="optional">
|
|
197
247
|
repeat_pentalty <span class="property-type">number</span>
|
|
198
248
|
</dt>
|
|
199
249
|
<dd>The repeat pentalty to use.</dd>
|
|
200
250
|
|
|
201
|
-
<dt>
|
|
251
|
+
<dt class="optional">
|
|
202
252
|
presence_penalty <span class="property-type">number</span>
|
|
203
253
|
</dt>
|
|
204
254
|
<dd>The presence penalty to use.</dd>
|
|
205
255
|
|
|
206
|
-
<dt>
|
|
256
|
+
<dt class="optional">
|
|
207
257
|
frequency_penalty <span class="property-type">number</span>
|
|
208
258
|
</dt>
|
|
209
259
|
<dd>The frequency penalty to use.</dd>
|
|
210
260
|
|
|
211
|
-
<dt>
|
|
261
|
+
<dt class="optional">
|
|
212
262
|
mirostat <span class="property-type">boolean</span>
|
|
213
263
|
</dt>
|
|
214
264
|
<dd>Use mirostat.</dd>
|
|
215
265
|
|
|
216
|
-
<dt>
|
|
266
|
+
<dt class="optional">
|
|
217
267
|
mirostat_tau <span class="property-type">number</span>
|
|
218
268
|
</dt>
|
|
219
269
|
|
|
220
|
-
<dt>
|
|
270
|
+
<dt class="optional">
|
|
221
271
|
mirostat_eta <span class="property-type">number</span>
|
|
222
272
|
</dt>
|
|
223
273
|
|
|
224
|
-
<dt>
|
|
274
|
+
<dt class="optional">
|
|
225
275
|
penalize_newline <span class="property-type">boolean</span>
|
|
226
276
|
</dt>
|
|
227
277
|
<dd>Penalize newline.</dd>
|
|
228
278
|
|
|
229
|
-
<dt>
|
|
279
|
+
<dt class="optional">
|
|
230
280
|
stop <span class="property-type">array</span>
|
|
231
281
|
</dt>
|
|
232
282
|
<dd>The stop to use.</dd>
|
package/nodes/ollama-embed.js
CHANGED
|
@@ -3,28 +3,66 @@ module.exports = function( RED ) {
|
|
|
3
3
|
|
|
4
4
|
function OllamaEmbedNode( config ) {
|
|
5
5
|
RED.nodes.createNode( this, config )
|
|
6
|
-
const node = this
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
input,
|
|
13
|
-
truncate,
|
|
14
|
-
keep_alive,
|
|
15
|
-
options: payloadOptions
|
|
16
|
-
} = msg.payload
|
|
7
|
+
this.modelType = config.modelType || 'str'
|
|
8
|
+
this.inputType = config.inputType || 'str'
|
|
9
|
+
this.thuncate = config.thuncate || false
|
|
10
|
+
this.keepAliveType = config.keepAliveType || 'str'
|
|
17
11
|
|
|
12
|
+
const node = this
|
|
13
|
+
node.on( 'input', async function( msg ) {
|
|
18
14
|
const server = RED.nodes.getNode( config.server )
|
|
19
|
-
const host = ( server ) ? server.host + ':' + server.port :
|
|
15
|
+
const host = msg?.payload?.host || ( server ) ? server.host + ':' + server.port : null
|
|
20
16
|
|
|
21
17
|
const ollama = new Ollama( { host } )
|
|
22
18
|
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
let model = null
|
|
20
|
+
if( msg?.payload?.model ) {
|
|
21
|
+
model = msg?.payload?.model
|
|
22
|
+
} else if( !!config.model ) {
|
|
23
|
+
if( node.modelType === 'str' ) {
|
|
24
|
+
model = config.model
|
|
25
|
+
} else if( node.modelType === 'msg' ) {
|
|
26
|
+
model = msg[ config.model ]
|
|
27
|
+
} else if( node.modelType === 'flow' ) {
|
|
28
|
+
model = node.context().flow.get( config.model )
|
|
29
|
+
} else if( node.modelType === 'global' ) {
|
|
30
|
+
model = node.context().global.get( config.model )
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let input = null
|
|
35
|
+
if( msg?.payload?.input ) {
|
|
36
|
+
input = msg?.payload?.input
|
|
37
|
+
} else if( !!config.input ) {
|
|
38
|
+
if( node.inputType === 'str' ) {
|
|
39
|
+
input = config.input
|
|
40
|
+
} else if( node.inputType === 'msg' ) {
|
|
41
|
+
input = msg[ config.input ]
|
|
42
|
+
} else if( node.inputType === 'flow' ) {
|
|
43
|
+
input = node.context().flow.get( config.input )
|
|
44
|
+
} else if( node.inputType === 'global' ) {
|
|
45
|
+
input = node.context().global.get( config.input )
|
|
46
|
+
} else if( node.inputType === 'json' ) {
|
|
47
|
+
input = JSON.parse( config.input )
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const truncate = ( msg?.payload?.truncate !== undefined ) ? msg?.payload?.truncate : node.truncate
|
|
52
|
+
|
|
53
|
+
let keep_alive = null
|
|
54
|
+
if( msg?.payload?.keep_alive ) {
|
|
55
|
+
keep_alive = msg?.payload?.keep_alive
|
|
56
|
+
} else if( !!config.keepAlive ) {
|
|
57
|
+
if( node.keepAliveType === 'str' ) {
|
|
58
|
+
keep_alive = config.keepAlive
|
|
59
|
+
} else if( node.keepAliveType === 'num' ) {
|
|
60
|
+
keep_alive = Number( config.keepAlive )
|
|
61
|
+
}
|
|
62
|
+
}
|
|
25
63
|
|
|
26
64
|
const optionsConfig = RED.nodes.getNode( config.options )
|
|
27
|
-
const options = ( optionsConfig ) ? optionsConfig.json :
|
|
65
|
+
const options = msg?.payload?.options || ( optionsConfig ) ? JSON.parse( optionsConfig.json ) : null
|
|
28
66
|
|
|
29
67
|
const response = await ollama.embed( {
|
|
30
68
|
model,
|
|
@@ -6,7 +6,23 @@
|
|
|
6
6
|
name: { value: 'Ollama Generate' },
|
|
7
7
|
server: { value: '', type: 'ollama-config-server', required: false },
|
|
8
8
|
format: { value: '', type: 'ollama-config-format', required: false },
|
|
9
|
-
model: { value: '',
|
|
9
|
+
model: { value: '', required: false },
|
|
10
|
+
modelType: { value: 'str', required: false },
|
|
11
|
+
prompt: { value: '', required: true },
|
|
12
|
+
promptType: { value: 'str', required: false },
|
|
13
|
+
suffix: { value: '', required: false },
|
|
14
|
+
suffixType: { value: 'str', required: false },
|
|
15
|
+
system: { value: '', required: false },
|
|
16
|
+
systemType: { value: 'str', required: false },
|
|
17
|
+
template: { value: '', required: false },
|
|
18
|
+
templateType: { value: 'str', required: false },
|
|
19
|
+
raw: { value: false },
|
|
20
|
+
images: { value: '', required: false },
|
|
21
|
+
imagesType: { value: 'json', required: false },
|
|
22
|
+
stream: { value: false },
|
|
23
|
+
think: { value: false },
|
|
24
|
+
keepAlive: { value: '5m', required: false },
|
|
25
|
+
keepAliveType: { value: 'str', required: false },
|
|
10
26
|
options: { value: '', type: 'ollama-config-options', required: false },
|
|
11
27
|
},
|
|
12
28
|
inputs: 1,
|
|
@@ -15,6 +31,77 @@
|
|
|
15
31
|
label: function() {
|
|
16
32
|
return this.name || 'ollama-generate';
|
|
17
33
|
},
|
|
34
|
+
oneditprepare: function() {
|
|
35
|
+
if( !this.modelType ) {
|
|
36
|
+
this.modelType = 'str'
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
$( '#node-input-model' ).typedInput( {
|
|
40
|
+
type: 'str',
|
|
41
|
+
types: [ 'str', 'msg', 'flow', 'global' ],
|
|
42
|
+
typeField: '#node-input-modelType'
|
|
43
|
+
} )
|
|
44
|
+
|
|
45
|
+
if( !this.promptType ) {
|
|
46
|
+
this.promptType = 'str'
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
$( '#node-input-prompt' ).typedInput( {
|
|
50
|
+
type: 'str',
|
|
51
|
+
types: [ 'str', 'msg', 'flow', 'global' ],
|
|
52
|
+
typeField: '#node-input-promptType'
|
|
53
|
+
} )
|
|
54
|
+
|
|
55
|
+
if( !this.suffixType ) {
|
|
56
|
+
this.suffixType = 'str'
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
$( '#node-input-suffix' ).typedInput( {
|
|
60
|
+
type: 'str',
|
|
61
|
+
types: [ 'str', 'msg', 'flow', 'global' ],
|
|
62
|
+
typeField: '#node-input-suffixType'
|
|
63
|
+
} )
|
|
64
|
+
|
|
65
|
+
if( !this.systemType ) {
|
|
66
|
+
this.systemType = 'str'
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
$( '#node-input-system' ).typedInput( {
|
|
70
|
+
type: 'str',
|
|
71
|
+
types: [ 'str', 'msg', 'flow', 'global' ],
|
|
72
|
+
typeField: '#node-input-systemType'
|
|
73
|
+
} )
|
|
74
|
+
|
|
75
|
+
if( !this.templateType ) {
|
|
76
|
+
this.templateType = 'str'
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
$( '#node-input-template' ).typedInput( {
|
|
80
|
+
type: 'str',
|
|
81
|
+
types: [ 'str', 'msg', 'flow', 'global' ],
|
|
82
|
+
typeField: '#node-input-templateType'
|
|
83
|
+
} )
|
|
84
|
+
|
|
85
|
+
if( !this.imagesType ) {
|
|
86
|
+
this.imagesType = 'json'
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
$( '#node-input-images' ).typedInput( {
|
|
90
|
+
type: 'json',
|
|
91
|
+
types: [ 'json', 'msg', 'flow', 'global' ],
|
|
92
|
+
typeField: '#node-input-imagesType'
|
|
93
|
+
} )
|
|
94
|
+
|
|
95
|
+
if( !this.keepAliveType ) {
|
|
96
|
+
this.keepAliveType = 'str'
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
$( '#node-input-keepAlive' ).typedInput( {
|
|
100
|
+
type: 'str',
|
|
101
|
+
types: [ 'str', 'num' ],
|
|
102
|
+
typeField: '#node-input-keepAliveType'
|
|
103
|
+
} )
|
|
104
|
+
}
|
|
18
105
|
} )
|
|
19
106
|
</script>
|
|
20
107
|
|
|
@@ -35,8 +122,60 @@
|
|
|
35
122
|
</div>
|
|
36
123
|
|
|
37
124
|
<div class="form-row">
|
|
38
|
-
<label for="node-input-model"><i class="fa fa-
|
|
125
|
+
<label for="node-input-model"><i class="fa fa-comment"></i> Model</label>
|
|
39
126
|
<input type="text" id="node-input-model" />
|
|
127
|
+
<input type="hidden" id="node-input-modelType" />
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<div class="form-row">
|
|
131
|
+
<label for="node-input-prompt"><i class="fa fa-comment"></i> Prompt</label>
|
|
132
|
+
<input type="text" id="node-input-prompt" />
|
|
133
|
+
<input type="hidden" id="node-input-promptType" />
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
<div class="form-row">
|
|
137
|
+
<label for="node-input-suffix"><i class="fa fa-comment"></i> Suffix</label>
|
|
138
|
+
<input type="text" id="node-input-suffix" />
|
|
139
|
+
<input type="hidden" id="node-input-suffixType" />
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
<div class="form-row">
|
|
143
|
+
<label for="node-input-system"><i class="fa fa-cog"></i> System</label>
|
|
144
|
+
<input type="text" id="node-input-system" />
|
|
145
|
+
<input type="hidden" id="node-input-systemType" />
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<div class="form-row">
|
|
149
|
+
<label for="node-input-template"><i class="fa fa-cog"></i> Template</label>
|
|
150
|
+
<input type="text" id="node-input-template" />
|
|
151
|
+
<input type="hidden" id="node-input-templateType" />
|
|
152
|
+
</div>
|
|
153
|
+
|
|
154
|
+
<div class="form-row">
|
|
155
|
+
<label for="node-input-raw"><i class="fa fa-cog"></i> Raw</label>
|
|
156
|
+
<input type="checkbox" id="node-input-raw" />
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
<div class="form-row">
|
|
160
|
+
<label for="node-input-images"><i class="fa fa-cog"></i> Images</label>
|
|
161
|
+
<input type="text" id="node-input-images" />
|
|
162
|
+
<input type="hidden" id="node-input-imagesType" />
|
|
163
|
+
</div>
|
|
164
|
+
|
|
165
|
+
<div class="form-row">
|
|
166
|
+
<label for="node-input-stream"><i class="fa fa-cog"></i> Stream</label>
|
|
167
|
+
<input type="checkbox" id="node-input-stream" />
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
<div class="form-row">
|
|
171
|
+
<label for="node-input-think"><i class="fa fa-cog"></i> Think</label>
|
|
172
|
+
<input type="checkbox" id="node-input-think" />
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
<div class="form-row">
|
|
176
|
+
<label for="node-input-keepAlive"><i class="fa fa-cog"></i> Keep Alive</label>
|
|
177
|
+
<input type="text" id="node-input-keepAlive" />
|
|
178
|
+
<input type="hidden" id="node-input-keepAliveType" />
|
|
40
179
|
</div>
|
|
41
180
|
|
|
42
181
|
<div class="form-row">
|
|
@@ -56,31 +195,26 @@
|
|
|
56
195
|
</dt>
|
|
57
196
|
|
|
58
197
|
<dd>
|
|
59
|
-
The payload object
|
|
198
|
+
The payload object is an alternative way to configure the node.<br />
|
|
199
|
+
Any properties in the payload object will override the node configuration.
|
|
60
200
|
|
|
61
201
|
<dl class="message-properties">
|
|
62
202
|
<dt class="optional">
|
|
63
203
|
payload.host <span class="property-type">string</span>
|
|
64
204
|
</dt>
|
|
65
|
-
<dd>
|
|
66
|
-
The host of the Ollama instance.<br />
|
|
67
|
-
<em>Alternative to the <code>Server</code> field.</em>
|
|
68
|
-
</dd>
|
|
205
|
+
<dd>The host of the Ollama instance.</dd>
|
|
69
206
|
|
|
70
207
|
<dt class="optional">
|
|
71
208
|
payload.model <span class="property-type">string</span>
|
|
72
209
|
</dt>
|
|
73
|
-
<dd>
|
|
74
|
-
The model to use for generating the next message.<br />
|
|
75
|
-
<em>Alternative to the <code>Model</code> field.</em>
|
|
76
|
-
</dd>
|
|
210
|
+
<dd>The model to use for generating the next message.</dd>
|
|
77
211
|
|
|
78
|
-
<dt>
|
|
212
|
+
<dt class="optional">
|
|
79
213
|
payload.prompt <span class="property-type">string</span>
|
|
80
214
|
</dt>
|
|
81
215
|
<dd>The prompt to generate a response for.</dd>
|
|
82
216
|
|
|
83
|
-
<dt>
|
|
217
|
+
<dt class="optional">
|
|
84
218
|
payload.suffix <span class="property-type">string</span>
|
|
85
219
|
</dt>
|
|
86
220
|
<dd>The text after the model response.</dd>
|
|
@@ -93,18 +227,12 @@
|
|
|
93
227
|
<dt class="optional">
|
|
94
228
|
payload.format <span class="property-type">string</span>
|
|
95
229
|
</dt>
|
|
96
|
-
<dd>
|
|
97
|
-
The format to return a response in. Currently the only accepted value is <code>json</code><br />
|
|
98
|
-
<em>Alternative to the <code>Format</code> field.</em>
|
|
99
|
-
</dd>
|
|
230
|
+
<dd>The format to return a response in. Currently the only accepted value is <code>json</code></dd>
|
|
100
231
|
|
|
101
232
|
<dt class="optional">
|
|
102
233
|
payload.options <span class="property-type">object</span>
|
|
103
234
|
</dt>
|
|
104
|
-
<dd>
|
|
105
|
-
Additional model parameters listed in the documentation for the <a href="https://github.com/ollama/ollama/blob/main/docs/modelfile.md#valid-parameters-and-values">Modelfile</a>.<br />
|
|
106
|
-
<em>Alternative to the <code>Options</code> field.</em>
|
|
107
|
-
</dd>
|
|
235
|
+
<dd>Additional model parameters listed in the documentation for the <a href="https://github.com/ollama/ollama/blob/main/docs/modelfile.md#valid-parameters-and-values">Modelfile</a>.</dd>
|
|
108
236
|
|
|
109
237
|
<dt class="optional">
|
|
110
238
|
payload.system <span class="property-type">string</span>
|
|
@@ -121,6 +249,13 @@
|
|
|
121
249
|
</dt>
|
|
122
250
|
<dd>If <code>false</code> the response will be returned as a single response object, rather than a stream of objects.</dd>
|
|
123
251
|
|
|
252
|
+
<dt class="optional">
|
|
253
|
+
payload.think <span class="property-type">boolean</span>
|
|
254
|
+
</dt>
|
|
255
|
+
<dd>
|
|
256
|
+
When <code>true</code>, the model will think about the response before responding. Requires thinking support from the model.
|
|
257
|
+
</dd>
|
|
258
|
+
|
|
124
259
|
<dt class="optional">
|
|
125
260
|
payload.raw <span class="property-type">boolean</span>
|
|
126
261
|
</dt>
|