node-red-contrib-ollama 0.5.1 → 0.5.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.
- package/CHANGELOG.md +7 -0
- package/nodes/ollama-abort.js +2 -5
- package/nodes/ollama-chat.js +5 -4
- package/nodes/ollama-copy.js +5 -4
- package/nodes/ollama-delete.js +5 -4
- package/nodes/ollama-embed.js +6 -5
- package/nodes/ollama-generate.js +5 -4
- package/nodes/ollama-list.js +5 -4
- package/nodes/ollama-ps.js +5 -4
- package/nodes/ollama-pull.js +5 -4
- package/nodes/ollama-push.js +5 -4
- package/nodes/ollama-show.js +5 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
6
6
|
|
|
7
|
+
## [0.5.2] - 2026-09-13
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- `ollama-embed` node ignoring the "Truncate" setting due to a config property name typo.
|
|
12
|
+
- All nodes emitting an output message with an empty payload after a failed Ollama call, instead of only reporting the error.
|
|
13
|
+
|
|
7
14
|
## [0.5.1] - 2026-09-13
|
|
8
15
|
|
|
9
16
|
### Fixed
|
package/nodes/ollama-abort.js
CHANGED
|
@@ -44,16 +44,13 @@ module.exports = function( RED ) {
|
|
|
44
44
|
|
|
45
45
|
// Unlike the other client methods, abort() is synchronous and
|
|
46
46
|
// returns nothing - it just cancels ongoing streamed requests.
|
|
47
|
-
let response = null
|
|
48
47
|
try {
|
|
49
48
|
ollama.abort()
|
|
50
|
-
|
|
49
|
+
msg.payload = { status: 'success' }
|
|
50
|
+
node.send( msg )
|
|
51
51
|
} catch ( error ) {
|
|
52
52
|
node.error( error )
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
msg.payload = response
|
|
56
|
-
node.send( msg )
|
|
57
54
|
} )
|
|
58
55
|
}
|
|
59
56
|
|
package/nodes/ollama-chat.js
CHANGED
|
@@ -104,7 +104,7 @@ module.exports = function( RED ) {
|
|
|
104
104
|
const optionsConfig = RED.nodes.getNode( config.options )
|
|
105
105
|
const options = msg?.payload?.options || ( optionsConfig ) ? JSON.parse( optionsConfig.json ) : null
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
ollama.chat( {
|
|
108
108
|
model,
|
|
109
109
|
messages,
|
|
110
110
|
format,
|
|
@@ -114,12 +114,13 @@ module.exports = function( RED ) {
|
|
|
114
114
|
tools,
|
|
115
115
|
options
|
|
116
116
|
} )
|
|
117
|
+
.then( response => {
|
|
118
|
+
msg.payload = response
|
|
119
|
+
node.send( msg )
|
|
120
|
+
} )
|
|
117
121
|
.catch( error => {
|
|
118
122
|
node.error( error )
|
|
119
123
|
} )
|
|
120
|
-
|
|
121
|
-
msg.payload = response
|
|
122
|
-
node.send( msg )
|
|
123
124
|
} )
|
|
124
125
|
}
|
|
125
126
|
|
package/nodes/ollama-copy.js
CHANGED
|
@@ -75,16 +75,17 @@ module.exports = function( RED ) {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
ollama.copy( {
|
|
79
79
|
source,
|
|
80
80
|
destination
|
|
81
81
|
} )
|
|
82
|
+
.then( response => {
|
|
83
|
+
msg.payload = response
|
|
84
|
+
node.send( msg )
|
|
85
|
+
} )
|
|
82
86
|
.catch( error => {
|
|
83
87
|
node.error( error )
|
|
84
88
|
} )
|
|
85
|
-
|
|
86
|
-
msg.payload = response
|
|
87
|
-
node.send( msg )
|
|
88
89
|
} )
|
|
89
90
|
}
|
|
90
91
|
|
package/nodes/ollama-delete.js
CHANGED
|
@@ -59,13 +59,14 @@ module.exports = function( RED ) {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
ollama.delete( { model } )
|
|
63
|
+
.then( response => {
|
|
64
|
+
msg.payload = response
|
|
65
|
+
node.send( msg )
|
|
66
|
+
} )
|
|
63
67
|
.catch( error => {
|
|
64
68
|
node.error( error )
|
|
65
69
|
} )
|
|
66
|
-
|
|
67
|
-
msg.payload = response
|
|
68
|
-
node.send( msg )
|
|
69
70
|
} )
|
|
70
71
|
}
|
|
71
72
|
|
package/nodes/ollama-embed.js
CHANGED
|
@@ -6,7 +6,7 @@ module.exports = function( RED ) {
|
|
|
6
6
|
|
|
7
7
|
this.modelType = config.modelType || 'str'
|
|
8
8
|
this.inputType = config.inputType || 'str'
|
|
9
|
-
this.
|
|
9
|
+
this.truncate = config.truncate || false
|
|
10
10
|
this.keepAliveType = config.keepAliveType || 'str'
|
|
11
11
|
|
|
12
12
|
const node = this
|
|
@@ -95,19 +95,20 @@ module.exports = function( RED ) {
|
|
|
95
95
|
const optionsConfig = RED.nodes.getNode( config.options )
|
|
96
96
|
const options = msg?.payload?.options || ( optionsConfig ) ? JSON.parse( optionsConfig.json ) : null
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
ollama.embed( {
|
|
99
99
|
model,
|
|
100
100
|
input,
|
|
101
101
|
truncate,
|
|
102
102
|
keep_alive,
|
|
103
103
|
options
|
|
104
104
|
} )
|
|
105
|
+
.then( response => {
|
|
106
|
+
msg.payload = response
|
|
107
|
+
node.send( msg )
|
|
108
|
+
} )
|
|
105
109
|
.catch( error => {
|
|
106
110
|
node.error( error )
|
|
107
111
|
} )
|
|
108
|
-
|
|
109
|
-
msg.payload = response
|
|
110
|
-
node.send( msg )
|
|
111
112
|
} )
|
|
112
113
|
}
|
|
113
114
|
|
package/nodes/ollama-generate.js
CHANGED
|
@@ -169,7 +169,7 @@ module.exports = function( RED ) {
|
|
|
169
169
|
const optionsConfig = RED.nodes.getNode( config.options )
|
|
170
170
|
const options = msg?.payload?.options || ( optionsConfig ) ? JSON.parse( optionsConfig.json ) : null
|
|
171
171
|
|
|
172
|
-
|
|
172
|
+
ollama.generate( {
|
|
173
173
|
model,
|
|
174
174
|
prompt,
|
|
175
175
|
suffix,
|
|
@@ -183,12 +183,13 @@ module.exports = function( RED ) {
|
|
|
183
183
|
keep_alive,
|
|
184
184
|
options
|
|
185
185
|
} )
|
|
186
|
+
.then( response => {
|
|
187
|
+
msg.payload = response
|
|
188
|
+
node.send( msg )
|
|
189
|
+
} )
|
|
186
190
|
.catch( error => {
|
|
187
191
|
node.error( error )
|
|
188
192
|
} )
|
|
189
|
-
|
|
190
|
-
msg.payload = response
|
|
191
|
-
node.send( msg )
|
|
192
193
|
} )
|
|
193
194
|
}
|
|
194
195
|
|
package/nodes/ollama-list.js
CHANGED
|
@@ -42,13 +42,14 @@ module.exports = function( RED ) {
|
|
|
42
42
|
|
|
43
43
|
const ollama = new Ollama( ollamaConfig )
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
ollama.list()
|
|
46
|
+
.then( response => {
|
|
47
|
+
msg.payload = response
|
|
48
|
+
node.send( msg )
|
|
49
|
+
} )
|
|
46
50
|
.catch( error => {
|
|
47
51
|
node.error( error )
|
|
48
52
|
} )
|
|
49
|
-
|
|
50
|
-
msg.payload = response
|
|
51
|
-
node.send( msg )
|
|
52
53
|
} )
|
|
53
54
|
}
|
|
54
55
|
|
package/nodes/ollama-ps.js
CHANGED
|
@@ -42,13 +42,14 @@ module.exports = function( RED ) {
|
|
|
42
42
|
|
|
43
43
|
const ollama = new Ollama( ollamaConfig )
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
ollama.ps()
|
|
46
|
+
.then( response => {
|
|
47
|
+
msg.payload = response
|
|
48
|
+
node.send( msg )
|
|
49
|
+
} )
|
|
46
50
|
.catch( error => {
|
|
47
51
|
node.error( error )
|
|
48
52
|
} )
|
|
49
|
-
|
|
50
|
-
msg.payload = response
|
|
51
|
-
node.send( msg )
|
|
52
53
|
} )
|
|
53
54
|
}
|
|
54
55
|
|
package/nodes/ollama-pull.js
CHANGED
|
@@ -65,17 +65,18 @@ module.exports = function( RED ) {
|
|
|
65
65
|
|
|
66
66
|
const stream = ( msg?.payload?.stream !== undefined ) ? msg?.payload?.stream : node.stream
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
ollama.pull( {
|
|
69
69
|
model,
|
|
70
70
|
insecure,
|
|
71
71
|
stream
|
|
72
72
|
} )
|
|
73
|
+
.then( response => {
|
|
74
|
+
msg.payload = response
|
|
75
|
+
node.send( msg )
|
|
76
|
+
} )
|
|
73
77
|
.catch( error => {
|
|
74
78
|
node.error( error )
|
|
75
79
|
} )
|
|
76
|
-
|
|
77
|
-
msg.payload = response
|
|
78
|
-
node.send( msg )
|
|
79
80
|
} )
|
|
80
81
|
}
|
|
81
82
|
|
package/nodes/ollama-push.js
CHANGED
|
@@ -65,17 +65,18 @@ module.exports = function( RED ) {
|
|
|
65
65
|
|
|
66
66
|
const stream = ( msg?.payload?.stream !== undefined ) ? msg?.payload?.stream : node.stream
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
ollama.push( {
|
|
69
69
|
model,
|
|
70
70
|
insecure,
|
|
71
71
|
stream
|
|
72
72
|
} )
|
|
73
|
+
.then( response => {
|
|
74
|
+
msg.payload = response
|
|
75
|
+
node.send( msg )
|
|
76
|
+
} )
|
|
73
77
|
.catch( error => {
|
|
74
78
|
node.error( error )
|
|
75
79
|
} )
|
|
76
|
-
|
|
77
|
-
msg.payload = response
|
|
78
|
-
node.send( msg )
|
|
79
80
|
} )
|
|
80
81
|
}
|
|
81
82
|
|
package/nodes/ollama-show.js
CHANGED
|
@@ -94,18 +94,19 @@ module.exports = function( RED ) {
|
|
|
94
94
|
const optionsConfig = RED.nodes.getNode( config.options )
|
|
95
95
|
const options = msg?.payload?.options || ( optionsConfig ) ? JSON.parse( optionsConfig.json ) : null
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
ollama.show( {
|
|
98
98
|
model,
|
|
99
99
|
system,
|
|
100
100
|
template,
|
|
101
101
|
options
|
|
102
102
|
} )
|
|
103
|
+
.then( response => {
|
|
104
|
+
msg.payload = response
|
|
105
|
+
node.send( msg )
|
|
106
|
+
} )
|
|
103
107
|
.catch( error => {
|
|
104
108
|
node.error( error )
|
|
105
109
|
} )
|
|
106
|
-
|
|
107
|
-
msg.payload = response
|
|
108
|
-
node.send( msg )
|
|
109
110
|
} )
|
|
110
111
|
}
|
|
111
112
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-ollama",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Add AI functionality to your flows! This module includes a set of nodes that enable easy communication with Ollama, enriching your projects with intelligent solutions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|