ninegrid2 6.505.0 → 6.507.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/dist/ai/aiContainer.js +21 -13
- package/dist/bundle.cjs.js +21 -13
- package/dist/bundle.esm.js +21 -13
- package/package.json +1 -1
- package/src/ai/aiContainer.js +21 -13
package/dist/ai/aiContainer.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import ninegrid from "../index.js";
|
|
2
|
+
import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
|
|
3
|
+
import { Ollama } from "@langchain/ollama";
|
|
4
|
+
import { ChatOpenAI } from '@langchain/openai';
|
|
2
5
|
|
|
3
6
|
class aiContainer extends HTMLElement
|
|
4
7
|
{
|
|
@@ -7,6 +10,9 @@ class aiContainer extends HTMLElement
|
|
|
7
10
|
#model;
|
|
8
11
|
//#elChat;
|
|
9
12
|
|
|
13
|
+
#geminiApiKey = "";
|
|
14
|
+
#openaiApiKey = "";
|
|
15
|
+
|
|
10
16
|
constructor() {
|
|
11
17
|
super();
|
|
12
18
|
this.attachShadow({ mode: 'open' });
|
|
@@ -51,26 +57,28 @@ class aiContainer extends HTMLElement
|
|
|
51
57
|
});
|
|
52
58
|
};
|
|
53
59
|
|
|
54
|
-
get target() {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
get target() { return this.#target; };
|
|
61
|
+
set target(v) { this.#target = v; };
|
|
62
|
+
|
|
63
|
+
get geminiApiKey() { return this.#geminiApiKey; };
|
|
64
|
+
set geminiApiKey(v) { this.#geminiApiKey = v; };
|
|
65
|
+
|
|
66
|
+
get openaiApiKey() { return this.#openaiApiKey; };
|
|
67
|
+
set openaiApiKey(v) { this.#openaiApiKey = v; };
|
|
60
68
|
|
|
61
69
|
#createModel = () => {
|
|
62
|
-
const
|
|
63
|
-
if (!
|
|
70
|
+
const elSettings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
71
|
+
if (!elSettings) return;
|
|
64
72
|
|
|
65
|
-
switch (
|
|
73
|
+
switch (elSettings.server) {
|
|
66
74
|
case "gemini":
|
|
67
|
-
this.#model = new ChatGoogleGenerativeAI({ model:
|
|
75
|
+
this.#model = new ChatGoogleGenerativeAI({ model: elSettings.model, apiKey: this.geminiApiKey, temperature: 0,});
|
|
68
76
|
break;
|
|
69
77
|
case "openai":
|
|
70
|
-
this.#model = new ChatOpenAI({ model:
|
|
78
|
+
this.#model = new ChatOpenAI({ model: elSettings.model, apiKey: this.openaiApiKey });
|
|
71
79
|
break;
|
|
72
80
|
case "ollama":
|
|
73
|
-
this.#model = new Ollama({ model:
|
|
81
|
+
this.#model = new Ollama({ model: elSettings.model });
|
|
74
82
|
break;
|
|
75
83
|
}
|
|
76
84
|
};
|
|
@@ -221,7 +229,7 @@ this.#generateQdrantFilter();
|
|
|
221
229
|
this.#q3();
|
|
222
230
|
}
|
|
223
231
|
} catch (error) {
|
|
224
|
-
console.error("Error generating Qdrant filter
|
|
232
|
+
console.error("Error generating Qdrant filter:", error);
|
|
225
233
|
return null;
|
|
226
234
|
}
|
|
227
235
|
|
package/dist/bundle.cjs.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var ExcelJS$1 = require('exceljs');
|
|
4
|
+
var googleGenai = require('@langchain/google-genai');
|
|
5
|
+
var ollama = require('@langchain/ollama');
|
|
6
|
+
var openai = require('@langchain/openai');
|
|
4
7
|
|
|
5
8
|
function getDefaultExportFromCjs (x) {
|
|
6
9
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -27861,6 +27864,9 @@ class aiContainer extends HTMLElement
|
|
|
27861
27864
|
#model;
|
|
27862
27865
|
//#elChat;
|
|
27863
27866
|
|
|
27867
|
+
#geminiApiKey = "";
|
|
27868
|
+
#openaiApiKey = "";
|
|
27869
|
+
|
|
27864
27870
|
constructor() {
|
|
27865
27871
|
super();
|
|
27866
27872
|
this.attachShadow({ mode: 'open' });
|
|
@@ -27905,26 +27911,28 @@ class aiContainer extends HTMLElement
|
|
|
27905
27911
|
});
|
|
27906
27912
|
};
|
|
27907
27913
|
|
|
27908
|
-
get target() {
|
|
27909
|
-
|
|
27910
|
-
|
|
27911
|
-
|
|
27912
|
-
|
|
27913
|
-
|
|
27914
|
+
get target() { return this.#target; };
|
|
27915
|
+
set target(v) { this.#target = v; };
|
|
27916
|
+
|
|
27917
|
+
get geminiApiKey() { return this.#geminiApiKey; };
|
|
27918
|
+
set geminiApiKey(v) { this.#geminiApiKey = v; };
|
|
27919
|
+
|
|
27920
|
+
get openaiApiKey() { return this.#openaiApiKey; };
|
|
27921
|
+
set openaiApiKey(v) { this.#openaiApiKey = v; };
|
|
27914
27922
|
|
|
27915
27923
|
#createModel = () => {
|
|
27916
|
-
const
|
|
27917
|
-
if (!
|
|
27924
|
+
const elSettings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
27925
|
+
if (!elSettings) return;
|
|
27918
27926
|
|
|
27919
|
-
switch (
|
|
27927
|
+
switch (elSettings.server) {
|
|
27920
27928
|
case "gemini":
|
|
27921
|
-
this.#model = new ChatGoogleGenerativeAI({ model:
|
|
27929
|
+
this.#model = new googleGenai.ChatGoogleGenerativeAI({ model: elSettings.model, apiKey: this.geminiApiKey, temperature: 0,});
|
|
27922
27930
|
break;
|
|
27923
27931
|
case "openai":
|
|
27924
|
-
this.#model = new ChatOpenAI({ model:
|
|
27932
|
+
this.#model = new openai.ChatOpenAI({ model: elSettings.model, apiKey: this.openaiApiKey });
|
|
27925
27933
|
break;
|
|
27926
27934
|
case "ollama":
|
|
27927
|
-
this.#model = new Ollama({ model:
|
|
27935
|
+
this.#model = new ollama.Ollama({ model: elSettings.model });
|
|
27928
27936
|
break;
|
|
27929
27937
|
}
|
|
27930
27938
|
};
|
|
@@ -28074,7 +28082,7 @@ this.#generateQdrantFilter();
|
|
|
28074
28082
|
this.#q3();
|
|
28075
28083
|
}
|
|
28076
28084
|
} catch (error) {
|
|
28077
|
-
console.error("Error generating Qdrant filter
|
|
28085
|
+
console.error("Error generating Qdrant filter:", error);
|
|
28078
28086
|
return null;
|
|
28079
28087
|
}
|
|
28080
28088
|
|
package/dist/bundle.esm.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import ExcelJS$1 from 'exceljs';
|
|
2
|
+
import { ChatGoogleGenerativeAI } from '@langchain/google-genai';
|
|
3
|
+
import { Ollama } from '@langchain/ollama';
|
|
4
|
+
import { ChatOpenAI } from '@langchain/openai';
|
|
2
5
|
|
|
3
6
|
function getDefaultExportFromCjs (x) {
|
|
4
7
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -27859,6 +27862,9 @@ class aiContainer extends HTMLElement
|
|
|
27859
27862
|
#model;
|
|
27860
27863
|
//#elChat;
|
|
27861
27864
|
|
|
27865
|
+
#geminiApiKey = "";
|
|
27866
|
+
#openaiApiKey = "";
|
|
27867
|
+
|
|
27862
27868
|
constructor() {
|
|
27863
27869
|
super();
|
|
27864
27870
|
this.attachShadow({ mode: 'open' });
|
|
@@ -27903,26 +27909,28 @@ class aiContainer extends HTMLElement
|
|
|
27903
27909
|
});
|
|
27904
27910
|
};
|
|
27905
27911
|
|
|
27906
|
-
get target() {
|
|
27907
|
-
|
|
27908
|
-
|
|
27909
|
-
|
|
27910
|
-
|
|
27911
|
-
|
|
27912
|
+
get target() { return this.#target; };
|
|
27913
|
+
set target(v) { this.#target = v; };
|
|
27914
|
+
|
|
27915
|
+
get geminiApiKey() { return this.#geminiApiKey; };
|
|
27916
|
+
set geminiApiKey(v) { this.#geminiApiKey = v; };
|
|
27917
|
+
|
|
27918
|
+
get openaiApiKey() { return this.#openaiApiKey; };
|
|
27919
|
+
set openaiApiKey(v) { this.#openaiApiKey = v; };
|
|
27912
27920
|
|
|
27913
27921
|
#createModel = () => {
|
|
27914
|
-
const
|
|
27915
|
-
if (!
|
|
27922
|
+
const elSettings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
27923
|
+
if (!elSettings) return;
|
|
27916
27924
|
|
|
27917
|
-
switch (
|
|
27925
|
+
switch (elSettings.server) {
|
|
27918
27926
|
case "gemini":
|
|
27919
|
-
this.#model = new ChatGoogleGenerativeAI({ model:
|
|
27927
|
+
this.#model = new ChatGoogleGenerativeAI({ model: elSettings.model, apiKey: this.geminiApiKey, temperature: 0,});
|
|
27920
27928
|
break;
|
|
27921
27929
|
case "openai":
|
|
27922
|
-
this.#model = new ChatOpenAI({ model:
|
|
27930
|
+
this.#model = new ChatOpenAI({ model: elSettings.model, apiKey: this.openaiApiKey });
|
|
27923
27931
|
break;
|
|
27924
27932
|
case "ollama":
|
|
27925
|
-
this.#model = new Ollama({ model:
|
|
27933
|
+
this.#model = new Ollama({ model: elSettings.model });
|
|
27926
27934
|
break;
|
|
27927
27935
|
}
|
|
27928
27936
|
};
|
|
@@ -28072,7 +28080,7 @@ this.#generateQdrantFilter();
|
|
|
28072
28080
|
this.#q3();
|
|
28073
28081
|
}
|
|
28074
28082
|
} catch (error) {
|
|
28075
|
-
console.error("Error generating Qdrant filter
|
|
28083
|
+
console.error("Error generating Qdrant filter:", error);
|
|
28076
28084
|
return null;
|
|
28077
28085
|
}
|
|
28078
28086
|
|
package/package.json
CHANGED
package/src/ai/aiContainer.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import ninegrid from "../index.js";
|
|
2
|
+
import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
|
|
3
|
+
import { Ollama } from "@langchain/ollama";
|
|
4
|
+
import { ChatOpenAI } from '@langchain/openai';
|
|
2
5
|
|
|
3
6
|
class aiContainer extends HTMLElement
|
|
4
7
|
{
|
|
@@ -7,6 +10,9 @@ class aiContainer extends HTMLElement
|
|
|
7
10
|
#model;
|
|
8
11
|
//#elChat;
|
|
9
12
|
|
|
13
|
+
#geminiApiKey = "";
|
|
14
|
+
#openaiApiKey = "";
|
|
15
|
+
|
|
10
16
|
constructor() {
|
|
11
17
|
super();
|
|
12
18
|
this.attachShadow({ mode: 'open' });
|
|
@@ -51,26 +57,28 @@ class aiContainer extends HTMLElement
|
|
|
51
57
|
});
|
|
52
58
|
};
|
|
53
59
|
|
|
54
|
-
get target() {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
get target() { return this.#target; };
|
|
61
|
+
set target(v) { this.#target = v; };
|
|
62
|
+
|
|
63
|
+
get geminiApiKey() { return this.#geminiApiKey; };
|
|
64
|
+
set geminiApiKey(v) { this.#geminiApiKey = v; };
|
|
65
|
+
|
|
66
|
+
get openaiApiKey() { return this.#openaiApiKey; };
|
|
67
|
+
set openaiApiKey(v) { this.#openaiApiKey = v; };
|
|
60
68
|
|
|
61
69
|
#createModel = () => {
|
|
62
|
-
const
|
|
63
|
-
if (!
|
|
70
|
+
const elSettings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
71
|
+
if (!elSettings) return;
|
|
64
72
|
|
|
65
|
-
switch (
|
|
73
|
+
switch (elSettings.server) {
|
|
66
74
|
case "gemini":
|
|
67
|
-
this.#model = new ChatGoogleGenerativeAI({ model:
|
|
75
|
+
this.#model = new ChatGoogleGenerativeAI({ model: elSettings.model, apiKey: this.geminiApiKey, temperature: 0,});
|
|
68
76
|
break;
|
|
69
77
|
case "openai":
|
|
70
|
-
this.#model = new ChatOpenAI({ model:
|
|
78
|
+
this.#model = new ChatOpenAI({ model: elSettings.model, apiKey: this.openaiApiKey });
|
|
71
79
|
break;
|
|
72
80
|
case "ollama":
|
|
73
|
-
this.#model = new Ollama({ model:
|
|
81
|
+
this.#model = new Ollama({ model: elSettings.model });
|
|
74
82
|
break;
|
|
75
83
|
}
|
|
76
84
|
};
|
|
@@ -221,7 +229,7 @@ this.#generateQdrantFilter();
|
|
|
221
229
|
this.#q3();
|
|
222
230
|
}
|
|
223
231
|
} catch (error) {
|
|
224
|
-
console.error("Error generating Qdrant filter
|
|
232
|
+
console.error("Error generating Qdrant filter:", error);
|
|
225
233
|
return null;
|
|
226
234
|
}
|
|
227
235
|
|