node-red-contrib-ollama 0.1.6 → 0.1.7

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Jakub Burkiewicz
3
+ Copyright (c) 2024 Jakub Burkiewicz
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
@@ -27,6 +27,13 @@
27
27
  <h3>Inputs</h3>
28
28
 
29
29
  <dl class="message-properties">
30
+ <dt>
31
+ payload.host
32
+
33
+ <span class="property-type">string</span>
34
+ </dt>
35
+ <dd>The host of the Ollama instance.</dd>
36
+
30
37
  <dt>
31
38
  payload.model
32
39
 
@@ -41,7 +48,7 @@
41
48
  </dt>
42
49
  <dd>
43
50
  The chat history to use for generating the next message.<br />
44
-
51
+
45
52
  <h4>Message</h4>
46
53
  <dl class="message-properties">
47
54
  <dt>
@@ -95,7 +102,7 @@
95
102
  </dt>
96
103
  <dd>
97
104
  Options to configure the runtime.<br />
98
-
105
+
99
106
  <h4>Options</h4>
100
107
  <dl class="message-properties">
101
108
  <dt>
@@ -6,8 +6,9 @@ module.exports = function( RED ) {
6
6
  const node = this
7
7
 
8
8
  node.on( 'input', async function( msg ) {
9
- const ollama = new Ollama()
10
- const { model, messages, format, stream, keep_alive, options } = msg.payload
9
+ const { host, model, messages, format, stream, keep_alive, options } = msg.payload
10
+
11
+ const ollama = new Ollama( { host } )
11
12
 
12
13
  const response = await ollama.chat( { model, messages, format, stream, keep_alive, options } )
13
14
  .catch( error => {
@@ -27,6 +27,13 @@
27
27
  <h3>Inputs</h3>
28
28
 
29
29
  <dl class="message-properties">
30
+ <dt>
31
+ payload.host
32
+
33
+ <span class="property-type">string</span>
34
+ </dt>
35
+ <dd>The host of the Ollama instance.</dd>
36
+
30
37
  <dt>
31
38
  payload.source
32
39
 
@@ -6,8 +6,9 @@ module.exports = function( RED ) {
6
6
  const node = this
7
7
 
8
8
  node.on( 'input', async function( msg ) {
9
- const ollama = new Ollama()
10
- const { source, destination } = msg.payload
9
+ const { host, source, destination } = msg.payload
10
+
11
+ const ollama = new Ollama( { host } )
11
12
 
12
13
  const response = await ollama.copy( { source, destination } )
13
14
  .catch( error => {
@@ -27,6 +27,13 @@
27
27
  <h3>Inputs</h3>
28
28
 
29
29
  <dl class="message-properties">
30
+ <dt>
31
+ payload.host
32
+
33
+ <span class="property-type">string</span>
34
+ </dt>
35
+ <dd>The host of the Ollama instance.</dd>
36
+
30
37
  <dt>
31
38
  payload.model
32
39
 
@@ -6,8 +6,9 @@ module.exports = function( RED ) {
6
6
  const node = this
7
7
 
8
8
  node.on( 'input', async function( msg ) {
9
- const ollama = new Ollama()
10
- const { model, path, modelfile, stream } = msg.payload
9
+ const { host, model, path, modelfile, stream } = msg.payload
10
+
11
+ const ollama = new Ollama( { host } )
11
12
 
12
13
  const response = await ollama.create( { model, path, modelfile, stream } )
13
14
  .catch( error => {
@@ -27,6 +27,13 @@
27
27
  <h3>Inputs</h3>
28
28
 
29
29
  <dl class="message-properties">
30
+ <dt>
31
+ payload.host
32
+
33
+ <span class="property-type">string</span>
34
+ </dt>
35
+ <dd>The host of the Ollama instance.</dd>
36
+
30
37
  <dt>
31
38
  payload.model
32
39
 
@@ -6,8 +6,9 @@ module.exports = function( RED ) {
6
6
  const node = this
7
7
 
8
8
  node.on( 'input', async function( msg ) {
9
- const ollama = new Ollama()
10
- const { model } = msg.payload
9
+ const { host, model } = msg.payload
10
+
11
+ const ollama = new Ollama( { host } )
11
12
 
12
13
  const response = await ollama.delete( { model } )
13
14
  .catch( error => {
@@ -27,6 +27,13 @@
27
27
  <h3>Inputs</h3>
28
28
 
29
29
  <dl class="message-properties">
30
+ <dt>
31
+ payload.host
32
+
33
+ <span class="property-type">string</span>
34
+ </dt>
35
+ <dd>The host of the Ollama instance.</dd>
36
+
30
37
  <dt>
31
38
  payload.model
32
39
 
@@ -55,7 +62,7 @@
55
62
  </dt>
56
63
  <dd>
57
64
  Options to configure the runtime.<br />
58
-
65
+
59
66
  <h4>Options</h4>
60
67
  <dl class="message-properties">
61
68
  <dt>
@@ -6,8 +6,9 @@ module.exports = function( RED ) {
6
6
  const node = this
7
7
 
8
8
  node.on( 'input', async function( msg ) {
9
- const ollama = new Ollama()
10
- const { model, prompt, options, keep_alive } = msg.payload
9
+ const { host, model, prompt, options, keep_alive } = msg.payload
10
+
11
+ const ollama = new Ollama( { host } )
11
12
 
12
13
  const response = await ollama.embeddings( { model, prompt, options, keep_alive } )
13
14
  .catch( error => {
@@ -27,6 +27,13 @@
27
27
  <h3>Inputs</h3>
28
28
 
29
29
  <dl class="message-properties">
30
+ <dt>
31
+ payload.host
32
+
33
+ <span class="property-type">string</span>
34
+ </dt>
35
+ <dd>The host of the Ollama instance.</dd>
36
+
30
37
  <dt>
31
38
  payload.model
32
39
 
@@ -97,7 +104,7 @@
97
104
  </dt>
98
105
  <dd>
99
106
  Options to configure the runtime.<br />
100
-
107
+
101
108
  <h4>Options</h4>
102
109
  <dl class="message-properties">
103
110
  <dt>
@@ -6,8 +6,9 @@ module.exports = function( RED ) {
6
6
  const node = this
7
7
 
8
8
  node.on( 'input', async function( msg ) {
9
- const ollama = new Ollama()
10
- const { model, prompt, images, format, options, system, template, context, stream, raw, keep_alive } = msg.payload
9
+ const { host, model, prompt, images, format, options, system, template, context, stream, raw, keep_alive } = msg.payload
10
+
11
+ const ollama = new Ollama( { host } )
11
12
 
12
13
  const response = await ollama.generate( { model, prompt, images, format, options, system, template, context, stream, raw, keep_alive } )
13
14
  .catch( error => {
@@ -24,6 +24,17 @@
24
24
  <script type="text/html" data-help-name="ollama-list">
25
25
  <p>List models that are available locally.</p>
26
26
 
27
+ <h3>Inputs</h3>
28
+
29
+ <dl class="message-properties">
30
+ <dt>
31
+ payload.host
32
+
33
+ <span class="property-type">string</span>
34
+ </dt>
35
+ <dd>The host of the Ollama instance.</dd>
36
+ </dl>
37
+
27
38
  <h3>Outputs</h3>
28
39
 
29
40
  <dl class="message-properties">
@@ -6,7 +6,9 @@ module.exports = function( RED ) {
6
6
  const node = this
7
7
 
8
8
  node.on( 'input', async function( msg ) {
9
- const ollama = new Ollama()
9
+ const { host } = msg.payload
10
+
11
+ const ollama = new Ollama( { host } )
10
12
 
11
13
  const response = await ollama.list()
12
14
  .catch( error => {
@@ -27,6 +27,13 @@
27
27
  <h3>Inputs</h3>
28
28
 
29
29
  <dl class="message-properties">
30
+ <dt>
31
+ payload.host
32
+
33
+ <span class="property-type">string</span>
34
+ </dt>
35
+ <dd>The host of the Ollama instance.</dd>
36
+
30
37
  <dt>
31
38
  payload.model
32
39
 
@@ -6,8 +6,9 @@ module.exports = function( RED ) {
6
6
  const node = this
7
7
 
8
8
  node.on( 'input', async function( msg ) {
9
- const ollama = new Ollama()
10
- const { model, insecure, stream } = msg.payload
9
+ const { host, model, insecure, stream } = msg.payload
10
+
11
+ const ollama = new Ollama( { host } )
11
12
 
12
13
  const response = await ollama.pull( { model, insecure, stream } )
13
14
  .catch( error => {
@@ -27,6 +27,13 @@
27
27
  <h3>Inputs</h3>
28
28
 
29
29
  <dl class="message-properties">
30
+ <dt>
31
+ payload.host
32
+
33
+ <span class="property-type">string</span>
34
+ </dt>
35
+ <dd>The host of the Ollama instance.</dd>
36
+
30
37
  <dt>
31
38
  payload.model
32
39
 
@@ -6,8 +6,9 @@ module.exports = function( RED ) {
6
6
  const node = this
7
7
 
8
8
  node.on( 'input', async function( msg ) {
9
- const ollama = new Ollama()
10
- const { model, insecure, stream } = msg.payload
9
+ const { host, model, insecure, stream } = msg.payload
10
+
11
+ const ollama = new Ollama( { host } )
11
12
 
12
13
  const response = await ollama.push( { model, insecure, stream } )
13
14
  .catch( error => {
@@ -23,10 +23,17 @@
23
23
 
24
24
  <script type="text/html" data-help-name="ollama-show">
25
25
  <p>Show information about a model including details, modelfile, template, parameters, license, and system prompt.</p>
26
-
26
+
27
27
  <h3>Inputs</h3>
28
28
 
29
29
  <dl class="message-properties">
30
+ <dt>
31
+ payload.host
32
+
33
+ <span class="property-type">string</span>
34
+ </dt>
35
+ <dd>The host of the Ollama instance.</dd>
36
+
30
37
  <dt>
31
38
  payload.model
32
39
 
@@ -6,8 +6,9 @@ module.exports = function( RED ) {
6
6
  const node = this
7
7
 
8
8
  node.on( 'input', async function( msg ) {
9
- const ollama = new Ollama()
10
- const { name } = msg.payload
9
+ const { host, name } = msg.payload
10
+
11
+ const ollama = new Ollama( { host } )
11
12
 
12
13
  const response = await ollama.show( { name } )
13
14
  .catch( error => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-ollama",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "A Node-RED module that wraps the ollama.js library, offering its functionalities as configurable nodes for easy integration into flows.",
5
5
  "keywords": [
6
6
  "ai",
@@ -33,11 +33,10 @@
33
33
  "node": ">=14.0.0"
34
34
  },
35
35
  "dependencies": {
36
- "ollama": "^0.5.0"
36
+ "ollama": "^0.5.1"
37
37
  },
38
38
  "bugs": {
39
- "url": "https://github.com/jakubburkiewicz/node-red-contrib-ollama/issues",
40
- "email": "node-red-contrib-ollama@conx.eu"
39
+ "url": "https://github.com/jakubburkiewicz/node-red-contrib-ollama/issues"
41
40
  },
42
41
  "repository": {
43
42
  "type": "git",