node-red-contrib-ollama 0.4.0 → 0.4.1
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-chat.html
CHANGED
|
@@ -172,13 +172,6 @@
|
|
|
172
172
|
</dt>
|
|
173
173
|
<dd>The format of the response (only <code>json</code> for now).</dd>
|
|
174
174
|
|
|
175
|
-
<dt class="optional">
|
|
176
|
-
payload.stream <span class="property-type">boolean</span>
|
|
177
|
-
</dt>
|
|
178
|
-
<dd>
|
|
179
|
-
When true an <code>AsyncGenerator</code> is returned.
|
|
180
|
-
</dd>
|
|
181
|
-
|
|
182
175
|
<dt class="optional">
|
|
183
176
|
payload.think <span class="property-type">boolean</span>
|
|
184
177
|
</dt>
|
package/nodes/ollama-chat.js
CHANGED
|
@@ -47,7 +47,10 @@ module.exports = function( RED ) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
const formatConfig = RED.nodes.getNode( config.format )
|
|
50
|
-
const format = msg?.payload?.format
|
|
50
|
+
const format = msg?.payload?.format
|
|
51
|
+
? JSON.parse( msg?.payload?.format )
|
|
52
|
+
: ( formatConfig ) ? JSON.parse( formatConfig.json )
|
|
53
|
+
: null
|
|
51
54
|
|
|
52
55
|
const stream = ( msg?.payload?.stream !== undefined ) ? msg?.payload?.stream : node.stream
|
|
53
56
|
|
package/nodes/ollama-generate.js
CHANGED
|
@@ -115,7 +115,10 @@ module.exports = function( RED ) {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
const formatConfig = RED.nodes.getNode( config.format )
|
|
118
|
-
const format = msg?.payload?.format
|
|
118
|
+
const format = msg?.payload?.format
|
|
119
|
+
? JSON.parse( msg?.payload?.format )
|
|
120
|
+
: ( formatConfig ) ? JSON.parse( formatConfig.json )
|
|
121
|
+
: null
|
|
119
122
|
|
|
120
123
|
const stream = ( msg?.payload?.stream !== undefined ) ? msg?.payload?.stream : node.stream
|
|
121
124
|
|
package/nodes/ollama-pull.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module.exports = function( RED ) {
|
|
2
2
|
const { Ollama } = require( 'ollama' )
|
|
3
3
|
|
|
4
|
-
function
|
|
4
|
+
function OllamaPulltNode( config ) {
|
|
5
5
|
RED.nodes.createNode( this, config )
|
|
6
6
|
|
|
7
7
|
this.modelType = config.modelType || 'str'
|
|
@@ -48,5 +48,5 @@ module.exports = function( RED ) {
|
|
|
48
48
|
} )
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
RED.nodes.registerType( 'ollama-pull',
|
|
51
|
+
RED.nodes.registerType( 'ollama-pull', OllamaPulltNode )
|
|
52
52
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-ollama",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
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",
|