ninegrid2 6.506.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 +18 -13
- package/dist/bundle.cjs.js +18 -13
- package/dist/bundle.esm.js +18 -13
- package/package.json +1 -1
- package/src/ai/aiContainer.js +18 -13
package/dist/ai/aiContainer.js
CHANGED
|
@@ -10,6 +10,9 @@ class aiContainer extends HTMLElement
|
|
|
10
10
|
#model;
|
|
11
11
|
//#elChat;
|
|
12
12
|
|
|
13
|
+
#geminiApiKey = "";
|
|
14
|
+
#openaiApiKey = "";
|
|
15
|
+
|
|
13
16
|
constructor() {
|
|
14
17
|
super();
|
|
15
18
|
this.attachShadow({ mode: 'open' });
|
|
@@ -54,26 +57,28 @@ class aiContainer extends HTMLElement
|
|
|
54
57
|
});
|
|
55
58
|
};
|
|
56
59
|
|
|
57
|
-
get target() {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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; };
|
|
63
68
|
|
|
64
69
|
#createModel = () => {
|
|
65
|
-
const
|
|
66
|
-
if (!
|
|
70
|
+
const elSettings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
71
|
+
if (!elSettings) return;
|
|
67
72
|
|
|
68
|
-
switch (
|
|
73
|
+
switch (elSettings.server) {
|
|
69
74
|
case "gemini":
|
|
70
|
-
this.#model = new ChatGoogleGenerativeAI({ model:
|
|
75
|
+
this.#model = new ChatGoogleGenerativeAI({ model: elSettings.model, apiKey: this.geminiApiKey, temperature: 0,});
|
|
71
76
|
break;
|
|
72
77
|
case "openai":
|
|
73
|
-
this.#model = new ChatOpenAI({ model:
|
|
78
|
+
this.#model = new ChatOpenAI({ model: elSettings.model, apiKey: this.openaiApiKey });
|
|
74
79
|
break;
|
|
75
80
|
case "ollama":
|
|
76
|
-
this.#model = new Ollama({ model:
|
|
81
|
+
this.#model = new Ollama({ model: elSettings.model });
|
|
77
82
|
break;
|
|
78
83
|
}
|
|
79
84
|
};
|
|
@@ -224,7 +229,7 @@ this.#generateQdrantFilter();
|
|
|
224
229
|
this.#q3();
|
|
225
230
|
}
|
|
226
231
|
} catch (error) {
|
|
227
|
-
console.error("Error generating Qdrant filter
|
|
232
|
+
console.error("Error generating Qdrant filter:", error);
|
|
228
233
|
return null;
|
|
229
234
|
}
|
|
230
235
|
|
package/dist/bundle.cjs.js
CHANGED
|
@@ -27864,6 +27864,9 @@ class aiContainer extends HTMLElement
|
|
|
27864
27864
|
#model;
|
|
27865
27865
|
//#elChat;
|
|
27866
27866
|
|
|
27867
|
+
#geminiApiKey = "";
|
|
27868
|
+
#openaiApiKey = "";
|
|
27869
|
+
|
|
27867
27870
|
constructor() {
|
|
27868
27871
|
super();
|
|
27869
27872
|
this.attachShadow({ mode: 'open' });
|
|
@@ -27908,26 +27911,28 @@ class aiContainer extends HTMLElement
|
|
|
27908
27911
|
});
|
|
27909
27912
|
};
|
|
27910
27913
|
|
|
27911
|
-
get target() {
|
|
27912
|
-
|
|
27913
|
-
|
|
27914
|
-
|
|
27915
|
-
|
|
27916
|
-
|
|
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; };
|
|
27917
27922
|
|
|
27918
27923
|
#createModel = () => {
|
|
27919
|
-
const
|
|
27920
|
-
if (!
|
|
27924
|
+
const elSettings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
27925
|
+
if (!elSettings) return;
|
|
27921
27926
|
|
|
27922
|
-
switch (
|
|
27927
|
+
switch (elSettings.server) {
|
|
27923
27928
|
case "gemini":
|
|
27924
|
-
this.#model = new googleGenai.ChatGoogleGenerativeAI({ model:
|
|
27929
|
+
this.#model = new googleGenai.ChatGoogleGenerativeAI({ model: elSettings.model, apiKey: this.geminiApiKey, temperature: 0,});
|
|
27925
27930
|
break;
|
|
27926
27931
|
case "openai":
|
|
27927
|
-
this.#model = new openai.ChatOpenAI({ model:
|
|
27932
|
+
this.#model = new openai.ChatOpenAI({ model: elSettings.model, apiKey: this.openaiApiKey });
|
|
27928
27933
|
break;
|
|
27929
27934
|
case "ollama":
|
|
27930
|
-
this.#model = new ollama.Ollama({ model:
|
|
27935
|
+
this.#model = new ollama.Ollama({ model: elSettings.model });
|
|
27931
27936
|
break;
|
|
27932
27937
|
}
|
|
27933
27938
|
};
|
|
@@ -28077,7 +28082,7 @@ this.#generateQdrantFilter();
|
|
|
28077
28082
|
this.#q3();
|
|
28078
28083
|
}
|
|
28079
28084
|
} catch (error) {
|
|
28080
|
-
console.error("Error generating Qdrant filter
|
|
28085
|
+
console.error("Error generating Qdrant filter:", error);
|
|
28081
28086
|
return null;
|
|
28082
28087
|
}
|
|
28083
28088
|
|
package/dist/bundle.esm.js
CHANGED
|
@@ -27862,6 +27862,9 @@ class aiContainer extends HTMLElement
|
|
|
27862
27862
|
#model;
|
|
27863
27863
|
//#elChat;
|
|
27864
27864
|
|
|
27865
|
+
#geminiApiKey = "";
|
|
27866
|
+
#openaiApiKey = "";
|
|
27867
|
+
|
|
27865
27868
|
constructor() {
|
|
27866
27869
|
super();
|
|
27867
27870
|
this.attachShadow({ mode: 'open' });
|
|
@@ -27906,26 +27909,28 @@ class aiContainer extends HTMLElement
|
|
|
27906
27909
|
});
|
|
27907
27910
|
};
|
|
27908
27911
|
|
|
27909
|
-
get target() {
|
|
27910
|
-
|
|
27911
|
-
|
|
27912
|
-
|
|
27913
|
-
|
|
27914
|
-
|
|
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; };
|
|
27915
27920
|
|
|
27916
27921
|
#createModel = () => {
|
|
27917
|
-
const
|
|
27918
|
-
if (!
|
|
27922
|
+
const elSettings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
27923
|
+
if (!elSettings) return;
|
|
27919
27924
|
|
|
27920
|
-
switch (
|
|
27925
|
+
switch (elSettings.server) {
|
|
27921
27926
|
case "gemini":
|
|
27922
|
-
this.#model = new ChatGoogleGenerativeAI({ model:
|
|
27927
|
+
this.#model = new ChatGoogleGenerativeAI({ model: elSettings.model, apiKey: this.geminiApiKey, temperature: 0,});
|
|
27923
27928
|
break;
|
|
27924
27929
|
case "openai":
|
|
27925
|
-
this.#model = new ChatOpenAI({ model:
|
|
27930
|
+
this.#model = new ChatOpenAI({ model: elSettings.model, apiKey: this.openaiApiKey });
|
|
27926
27931
|
break;
|
|
27927
27932
|
case "ollama":
|
|
27928
|
-
this.#model = new Ollama({ model:
|
|
27933
|
+
this.#model = new Ollama({ model: elSettings.model });
|
|
27929
27934
|
break;
|
|
27930
27935
|
}
|
|
27931
27936
|
};
|
|
@@ -28075,7 +28080,7 @@ this.#generateQdrantFilter();
|
|
|
28075
28080
|
this.#q3();
|
|
28076
28081
|
}
|
|
28077
28082
|
} catch (error) {
|
|
28078
|
-
console.error("Error generating Qdrant filter
|
|
28083
|
+
console.error("Error generating Qdrant filter:", error);
|
|
28079
28084
|
return null;
|
|
28080
28085
|
}
|
|
28081
28086
|
|
package/package.json
CHANGED
package/src/ai/aiContainer.js
CHANGED
|
@@ -10,6 +10,9 @@ class aiContainer extends HTMLElement
|
|
|
10
10
|
#model;
|
|
11
11
|
//#elChat;
|
|
12
12
|
|
|
13
|
+
#geminiApiKey = "";
|
|
14
|
+
#openaiApiKey = "";
|
|
15
|
+
|
|
13
16
|
constructor() {
|
|
14
17
|
super();
|
|
15
18
|
this.attachShadow({ mode: 'open' });
|
|
@@ -54,26 +57,28 @@ class aiContainer extends HTMLElement
|
|
|
54
57
|
});
|
|
55
58
|
};
|
|
56
59
|
|
|
57
|
-
get target() {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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; };
|
|
63
68
|
|
|
64
69
|
#createModel = () => {
|
|
65
|
-
const
|
|
66
|
-
if (!
|
|
70
|
+
const elSettings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
71
|
+
if (!elSettings) return;
|
|
67
72
|
|
|
68
|
-
switch (
|
|
73
|
+
switch (elSettings.server) {
|
|
69
74
|
case "gemini":
|
|
70
|
-
this.#model = new ChatGoogleGenerativeAI({ model:
|
|
75
|
+
this.#model = new ChatGoogleGenerativeAI({ model: elSettings.model, apiKey: this.geminiApiKey, temperature: 0,});
|
|
71
76
|
break;
|
|
72
77
|
case "openai":
|
|
73
|
-
this.#model = new ChatOpenAI({ model:
|
|
78
|
+
this.#model = new ChatOpenAI({ model: elSettings.model, apiKey: this.openaiApiKey });
|
|
74
79
|
break;
|
|
75
80
|
case "ollama":
|
|
76
|
-
this.#model = new Ollama({ model:
|
|
81
|
+
this.#model = new Ollama({ model: elSettings.model });
|
|
77
82
|
break;
|
|
78
83
|
}
|
|
79
84
|
};
|
|
@@ -224,7 +229,7 @@ this.#generateQdrantFilter();
|
|
|
224
229
|
this.#q3();
|
|
225
230
|
}
|
|
226
231
|
} catch (error) {
|
|
227
|
-
console.error("Error generating Qdrant filter
|
|
232
|
+
console.error("Error generating Qdrant filter:", error);
|
|
228
233
|
return null;
|
|
229
234
|
}
|
|
230
235
|
|