ninegrid2 6.566.0 → 6.567.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 +11 -27
- package/dist/ai/aiSettings.js +12 -0
- package/dist/bundle.cjs.js +23 -27
- package/dist/bundle.esm.js +23 -27
- package/package.json +1 -1
- package/src/ai/aiContainer.js +11 -27
- package/src/ai/aiSettings.js +12 -0
package/dist/ai/aiContainer.js
CHANGED
|
@@ -16,8 +16,7 @@ class aiContainer extends HTMLElement
|
|
|
16
16
|
#qdrantClient;
|
|
17
17
|
//#elChat;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
#openaiApiKey = "";
|
|
19
|
+
settings; /** nx-ai-settings element */
|
|
21
20
|
|
|
22
21
|
constructor() {
|
|
23
22
|
super();
|
|
@@ -65,38 +64,24 @@ class aiContainer extends HTMLElement
|
|
|
65
64
|
get target() { return this.#target; };
|
|
66
65
|
set target(v) { this.#target = v; };
|
|
67
66
|
|
|
68
|
-
get geminiApiKey() { return this.#geminiApiKey; };
|
|
69
|
-
set geminiApiKey(v) { this.#geminiApiKey = v; };
|
|
70
|
-
|
|
71
|
-
get openaiApiKey() { return this.#openaiApiKey; };
|
|
72
|
-
set openaiApiKey(v) { this.#openaiApiKey = v; };
|
|
73
|
-
|
|
74
|
-
get ollamaUrl() { return this.shadowRoot.querySelector("nx-ai-settings").shadowRoot.querySelector("#ollamaUrl").value; };
|
|
75
|
-
set ollamaUrl(v) { this.shadowRoot.querySelector("nx-ai-settings").shadowRoot.querySelector("#ollamaUrl").value = v; };
|
|
76
|
-
|
|
77
|
-
get qdrantUrl() { return this.shadowRoot.querySelector("nx-ai-settings").shadowRoot.querySelector("#qdrantUrl").value; };
|
|
78
|
-
set qdrantUrl(v) { this.shadowRoot.querySelector("nx-ai-settings").shadowRoot.querySelector("#qdrantUrl").value = v; };
|
|
79
|
-
|
|
80
67
|
#createModel = () => {
|
|
81
|
-
const elSettings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
82
|
-
if (!elSettings) return;
|
|
83
68
|
|
|
84
|
-
switch (
|
|
69
|
+
switch (this.settings.server) {
|
|
85
70
|
case "gemini":
|
|
86
|
-
this.#model = new ChatGoogleGenerativeAI({ model:
|
|
71
|
+
this.#model = new ChatGoogleGenerativeAI({ model: this.settings.model, apiKey: this.settings.geminiApiKey, temperature: 0,});
|
|
87
72
|
break;
|
|
88
73
|
case "openai":
|
|
89
|
-
this.#model = new ChatOpenAI({ model:
|
|
74
|
+
this.#model = new ChatOpenAI({ model: this.settings.model, apiKey: this.settings.openaiApiKey, temperature: 0, });
|
|
90
75
|
break;
|
|
91
76
|
case "ollama":
|
|
92
77
|
this.#model = new Ollama({
|
|
93
|
-
model:
|
|
94
|
-
host:
|
|
78
|
+
model: this.settings.model,
|
|
79
|
+
host: this.settings.ollamaUrl,
|
|
95
80
|
});
|
|
96
81
|
break;
|
|
97
82
|
}
|
|
98
83
|
|
|
99
|
-
this.#qdrantClient = new QdrantClient({ url:
|
|
84
|
+
this.#qdrantClient = new QdrantClient({ url: this.settings.qdrantUrl });
|
|
100
85
|
};
|
|
101
86
|
|
|
102
87
|
#getColumnInfo = () => {
|
|
@@ -178,13 +163,10 @@ class aiContainer extends HTMLElement
|
|
|
178
163
|
new HumanMessage(prompt),
|
|
179
164
|
]);
|
|
180
165
|
|
|
181
|
-
const elSettings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
182
|
-
if (!elSettings) throw new Error("nx-ai-settings missing !!!");
|
|
183
|
-
|
|
184
166
|
console.log(response);
|
|
185
167
|
|
|
186
168
|
let filterString;
|
|
187
|
-
switch (
|
|
169
|
+
switch (this.settings.server) {
|
|
188
170
|
case "openai":
|
|
189
171
|
filterString = this.#extractJsonSnippet(response.content.trim());
|
|
190
172
|
break;
|
|
@@ -331,6 +313,8 @@ class aiContainer extends HTMLElement
|
|
|
331
313
|
|
|
332
314
|
#init = (info) => {
|
|
333
315
|
|
|
316
|
+
this.settings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
317
|
+
|
|
334
318
|
//this.#elChat = this.shadowRoot.querySelector("nx-ai-chat");
|
|
335
319
|
|
|
336
320
|
this.shadowRoot.querySelector("textarea").addEventListener("keydown", this.#keydownHandler);
|
|
@@ -403,7 +387,7 @@ class aiContainer extends HTMLElement
|
|
|
403
387
|
if (clickedIcon) clickedIcon.classList.add("active");
|
|
404
388
|
|
|
405
389
|
// `.menu-setting`이 클릭되었는지 확인 후 `nx-ai-settings` 토글
|
|
406
|
-
this.
|
|
390
|
+
this.settings.classList.toggle("expand", !!e.target.closest(".menu-setting"));
|
|
407
391
|
};
|
|
408
392
|
}
|
|
409
393
|
|
package/dist/ai/aiSettings.js
CHANGED
|
@@ -9,6 +9,18 @@ class aiSettings extends HTMLElement
|
|
|
9
9
|
this.attachShadow({ mode: 'open' });
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
get geminiApiKey() { return this.shadowRoot.querySelector("#geminiApiKey").value; };
|
|
13
|
+
set geminiApiKey(v) { this.shadowRoot.querySelector("#geminiApiKey").value = v; };
|
|
14
|
+
|
|
15
|
+
get openaiApiKey() { this.shadowRoot.querySelector("#openaiApiKey").value };
|
|
16
|
+
set openaiApiKey(v) { this.shadowRoot.querySelector("#openaiApiKey").value = v; };
|
|
17
|
+
|
|
18
|
+
get ollamaUrl() { return this.shadowRoot.querySelector("#ollamaUrl").value; };
|
|
19
|
+
set ollamaUrl(v) { this.shadowRoot.querySelector("#ollamaUrl").value = v; };
|
|
20
|
+
|
|
21
|
+
get qdrantUrl() { return this.shadowRoot.querySelector("#qdrantUrl").value; };
|
|
22
|
+
set qdrantUrl(v) { this.shadowRoot.querySelector("#qdrantUrl").value = v; };
|
|
23
|
+
|
|
12
24
|
get server() {
|
|
13
25
|
return this.shadowRoot.querySelector('input[name="server"]:checked')?.value;
|
|
14
26
|
};
|
package/dist/bundle.cjs.js
CHANGED
|
@@ -27525,6 +27525,18 @@ class aiSettings extends HTMLElement
|
|
|
27525
27525
|
this.attachShadow({ mode: 'open' });
|
|
27526
27526
|
}
|
|
27527
27527
|
|
|
27528
|
+
get geminiApiKey() { return this.shadowRoot.querySelector("#geminiApiKey").value; };
|
|
27529
|
+
set geminiApiKey(v) { this.shadowRoot.querySelector("#geminiApiKey").value = v; };
|
|
27530
|
+
|
|
27531
|
+
get openaiApiKey() { this.shadowRoot.querySelector("#openaiApiKey").value; };
|
|
27532
|
+
set openaiApiKey(v) { this.shadowRoot.querySelector("#openaiApiKey").value = v; };
|
|
27533
|
+
|
|
27534
|
+
get ollamaUrl() { return this.shadowRoot.querySelector("#ollamaUrl").value; };
|
|
27535
|
+
set ollamaUrl(v) { this.shadowRoot.querySelector("#ollamaUrl").value = v; };
|
|
27536
|
+
|
|
27537
|
+
get qdrantUrl() { return this.shadowRoot.querySelector("#qdrantUrl").value; };
|
|
27538
|
+
set qdrantUrl(v) { this.shadowRoot.querySelector("#qdrantUrl").value = v; };
|
|
27539
|
+
|
|
27528
27540
|
get server() {
|
|
27529
27541
|
return this.shadowRoot.querySelector('input[name="server"]:checked')?.value;
|
|
27530
27542
|
};
|
|
@@ -54178,8 +54190,7 @@ class aiContainer extends HTMLElement
|
|
|
54178
54190
|
#qdrantClient;
|
|
54179
54191
|
//#elChat;
|
|
54180
54192
|
|
|
54181
|
-
|
|
54182
|
-
#openaiApiKey = "";
|
|
54193
|
+
settings; /** nx-ai-settings element */
|
|
54183
54194
|
|
|
54184
54195
|
constructor() {
|
|
54185
54196
|
super();
|
|
@@ -54227,38 +54238,24 @@ class aiContainer extends HTMLElement
|
|
|
54227
54238
|
get target() { return this.#target; };
|
|
54228
54239
|
set target(v) { this.#target = v; };
|
|
54229
54240
|
|
|
54230
|
-
get geminiApiKey() { return this.#geminiApiKey; };
|
|
54231
|
-
set geminiApiKey(v) { this.#geminiApiKey = v; };
|
|
54232
|
-
|
|
54233
|
-
get openaiApiKey() { return this.#openaiApiKey; };
|
|
54234
|
-
set openaiApiKey(v) { this.#openaiApiKey = v; };
|
|
54235
|
-
|
|
54236
|
-
get ollamaUrl() { return this.shadowRoot.querySelector("nx-ai-settings").shadowRoot.querySelector("#ollamaUrl").value; };
|
|
54237
|
-
set ollamaUrl(v) { this.shadowRoot.querySelector("nx-ai-settings").shadowRoot.querySelector("#ollamaUrl").value = v; };
|
|
54238
|
-
|
|
54239
|
-
get qdrantUrl() { return this.shadowRoot.querySelector("nx-ai-settings").shadowRoot.querySelector("#qdrantUrl").value; };
|
|
54240
|
-
set qdrantUrl(v) { this.shadowRoot.querySelector("nx-ai-settings").shadowRoot.querySelector("#qdrantUrl").value = v; };
|
|
54241
|
-
|
|
54242
54241
|
#createModel = () => {
|
|
54243
|
-
const elSettings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
54244
|
-
if (!elSettings) return;
|
|
54245
54242
|
|
|
54246
|
-
switch (
|
|
54243
|
+
switch (this.settings.server) {
|
|
54247
54244
|
case "gemini":
|
|
54248
|
-
this.#model = new googleGenai.ChatGoogleGenerativeAI({ model:
|
|
54245
|
+
this.#model = new googleGenai.ChatGoogleGenerativeAI({ model: this.settings.model, apiKey: this.settings.geminiApiKey, temperature: 0,});
|
|
54249
54246
|
break;
|
|
54250
54247
|
case "openai":
|
|
54251
|
-
this.#model = new openai.ChatOpenAI({ model:
|
|
54248
|
+
this.#model = new openai.ChatOpenAI({ model: this.settings.model, apiKey: this.settings.openaiApiKey, temperature: 0, });
|
|
54252
54249
|
break;
|
|
54253
54250
|
case "ollama":
|
|
54254
54251
|
this.#model = new ollama.Ollama({
|
|
54255
|
-
model:
|
|
54256
|
-
host:
|
|
54252
|
+
model: this.settings.model,
|
|
54253
|
+
host: this.settings.ollamaUrl,
|
|
54257
54254
|
});
|
|
54258
54255
|
break;
|
|
54259
54256
|
}
|
|
54260
54257
|
|
|
54261
|
-
this.#qdrantClient = new QdrantClient({ url:
|
|
54258
|
+
this.#qdrantClient = new QdrantClient({ url: this.settings.qdrantUrl });
|
|
54262
54259
|
};
|
|
54263
54260
|
|
|
54264
54261
|
#getColumnInfo = () => {
|
|
@@ -54340,13 +54337,10 @@ class aiContainer extends HTMLElement
|
|
|
54340
54337
|
new messages.HumanMessage(prompt),
|
|
54341
54338
|
]);
|
|
54342
54339
|
|
|
54343
|
-
const elSettings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
54344
|
-
if (!elSettings) throw new Error("nx-ai-settings missing !!!");
|
|
54345
|
-
|
|
54346
54340
|
console.log(response);
|
|
54347
54341
|
|
|
54348
54342
|
let filterString;
|
|
54349
|
-
switch (
|
|
54343
|
+
switch (this.settings.server) {
|
|
54350
54344
|
case "openai":
|
|
54351
54345
|
filterString = this.#extractJsonSnippet(response.content.trim());
|
|
54352
54346
|
break;
|
|
@@ -54467,6 +54461,8 @@ class aiContainer extends HTMLElement
|
|
|
54467
54461
|
|
|
54468
54462
|
#init = (info) => {
|
|
54469
54463
|
|
|
54464
|
+
this.settings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
54465
|
+
|
|
54470
54466
|
//this.#elChat = this.shadowRoot.querySelector("nx-ai-chat");
|
|
54471
54467
|
|
|
54472
54468
|
this.shadowRoot.querySelector("textarea").addEventListener("keydown", this.#keydownHandler);
|
|
@@ -54538,7 +54534,7 @@ class aiContainer extends HTMLElement
|
|
|
54538
54534
|
if (clickedIcon) clickedIcon.classList.add("active");
|
|
54539
54535
|
|
|
54540
54536
|
// `.menu-setting`이 클릭되었는지 확인 후 `nx-ai-settings` 토글
|
|
54541
|
-
this.
|
|
54537
|
+
this.settings.classList.toggle("expand", !!e.target.closest(".menu-setting"));
|
|
54542
54538
|
};
|
|
54543
54539
|
}
|
|
54544
54540
|
|
package/dist/bundle.esm.js
CHANGED
|
@@ -27523,6 +27523,18 @@ class aiSettings extends HTMLElement
|
|
|
27523
27523
|
this.attachShadow({ mode: 'open' });
|
|
27524
27524
|
}
|
|
27525
27525
|
|
|
27526
|
+
get geminiApiKey() { return this.shadowRoot.querySelector("#geminiApiKey").value; };
|
|
27527
|
+
set geminiApiKey(v) { this.shadowRoot.querySelector("#geminiApiKey").value = v; };
|
|
27528
|
+
|
|
27529
|
+
get openaiApiKey() { this.shadowRoot.querySelector("#openaiApiKey").value; };
|
|
27530
|
+
set openaiApiKey(v) { this.shadowRoot.querySelector("#openaiApiKey").value = v; };
|
|
27531
|
+
|
|
27532
|
+
get ollamaUrl() { return this.shadowRoot.querySelector("#ollamaUrl").value; };
|
|
27533
|
+
set ollamaUrl(v) { this.shadowRoot.querySelector("#ollamaUrl").value = v; };
|
|
27534
|
+
|
|
27535
|
+
get qdrantUrl() { return this.shadowRoot.querySelector("#qdrantUrl").value; };
|
|
27536
|
+
set qdrantUrl(v) { this.shadowRoot.querySelector("#qdrantUrl").value = v; };
|
|
27537
|
+
|
|
27526
27538
|
get server() {
|
|
27527
27539
|
return this.shadowRoot.querySelector('input[name="server"]:checked')?.value;
|
|
27528
27540
|
};
|
|
@@ -54176,8 +54188,7 @@ class aiContainer extends HTMLElement
|
|
|
54176
54188
|
#qdrantClient;
|
|
54177
54189
|
//#elChat;
|
|
54178
54190
|
|
|
54179
|
-
|
|
54180
|
-
#openaiApiKey = "";
|
|
54191
|
+
settings; /** nx-ai-settings element */
|
|
54181
54192
|
|
|
54182
54193
|
constructor() {
|
|
54183
54194
|
super();
|
|
@@ -54225,38 +54236,24 @@ class aiContainer extends HTMLElement
|
|
|
54225
54236
|
get target() { return this.#target; };
|
|
54226
54237
|
set target(v) { this.#target = v; };
|
|
54227
54238
|
|
|
54228
|
-
get geminiApiKey() { return this.#geminiApiKey; };
|
|
54229
|
-
set geminiApiKey(v) { this.#geminiApiKey = v; };
|
|
54230
|
-
|
|
54231
|
-
get openaiApiKey() { return this.#openaiApiKey; };
|
|
54232
|
-
set openaiApiKey(v) { this.#openaiApiKey = v; };
|
|
54233
|
-
|
|
54234
|
-
get ollamaUrl() { return this.shadowRoot.querySelector("nx-ai-settings").shadowRoot.querySelector("#ollamaUrl").value; };
|
|
54235
|
-
set ollamaUrl(v) { this.shadowRoot.querySelector("nx-ai-settings").shadowRoot.querySelector("#ollamaUrl").value = v; };
|
|
54236
|
-
|
|
54237
|
-
get qdrantUrl() { return this.shadowRoot.querySelector("nx-ai-settings").shadowRoot.querySelector("#qdrantUrl").value; };
|
|
54238
|
-
set qdrantUrl(v) { this.shadowRoot.querySelector("nx-ai-settings").shadowRoot.querySelector("#qdrantUrl").value = v; };
|
|
54239
|
-
|
|
54240
54239
|
#createModel = () => {
|
|
54241
|
-
const elSettings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
54242
|
-
if (!elSettings) return;
|
|
54243
54240
|
|
|
54244
|
-
switch (
|
|
54241
|
+
switch (this.settings.server) {
|
|
54245
54242
|
case "gemini":
|
|
54246
|
-
this.#model = new ChatGoogleGenerativeAI({ model:
|
|
54243
|
+
this.#model = new ChatGoogleGenerativeAI({ model: this.settings.model, apiKey: this.settings.geminiApiKey, temperature: 0,});
|
|
54247
54244
|
break;
|
|
54248
54245
|
case "openai":
|
|
54249
|
-
this.#model = new ChatOpenAI({ model:
|
|
54246
|
+
this.#model = new ChatOpenAI({ model: this.settings.model, apiKey: this.settings.openaiApiKey, temperature: 0, });
|
|
54250
54247
|
break;
|
|
54251
54248
|
case "ollama":
|
|
54252
54249
|
this.#model = new Ollama({
|
|
54253
|
-
model:
|
|
54254
|
-
host:
|
|
54250
|
+
model: this.settings.model,
|
|
54251
|
+
host: this.settings.ollamaUrl,
|
|
54255
54252
|
});
|
|
54256
54253
|
break;
|
|
54257
54254
|
}
|
|
54258
54255
|
|
|
54259
|
-
this.#qdrantClient = new QdrantClient({ url:
|
|
54256
|
+
this.#qdrantClient = new QdrantClient({ url: this.settings.qdrantUrl });
|
|
54260
54257
|
};
|
|
54261
54258
|
|
|
54262
54259
|
#getColumnInfo = () => {
|
|
@@ -54338,13 +54335,10 @@ class aiContainer extends HTMLElement
|
|
|
54338
54335
|
new HumanMessage(prompt),
|
|
54339
54336
|
]);
|
|
54340
54337
|
|
|
54341
|
-
const elSettings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
54342
|
-
if (!elSettings) throw new Error("nx-ai-settings missing !!!");
|
|
54343
|
-
|
|
54344
54338
|
console.log(response);
|
|
54345
54339
|
|
|
54346
54340
|
let filterString;
|
|
54347
|
-
switch (
|
|
54341
|
+
switch (this.settings.server) {
|
|
54348
54342
|
case "openai":
|
|
54349
54343
|
filterString = this.#extractJsonSnippet(response.content.trim());
|
|
54350
54344
|
break;
|
|
@@ -54465,6 +54459,8 @@ class aiContainer extends HTMLElement
|
|
|
54465
54459
|
|
|
54466
54460
|
#init = (info) => {
|
|
54467
54461
|
|
|
54462
|
+
this.settings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
54463
|
+
|
|
54468
54464
|
//this.#elChat = this.shadowRoot.querySelector("nx-ai-chat");
|
|
54469
54465
|
|
|
54470
54466
|
this.shadowRoot.querySelector("textarea").addEventListener("keydown", this.#keydownHandler);
|
|
@@ -54536,7 +54532,7 @@ class aiContainer extends HTMLElement
|
|
|
54536
54532
|
if (clickedIcon) clickedIcon.classList.add("active");
|
|
54537
54533
|
|
|
54538
54534
|
// `.menu-setting`이 클릭되었는지 확인 후 `nx-ai-settings` 토글
|
|
54539
|
-
this.
|
|
54535
|
+
this.settings.classList.toggle("expand", !!e.target.closest(".menu-setting"));
|
|
54540
54536
|
};
|
|
54541
54537
|
}
|
|
54542
54538
|
|
package/package.json
CHANGED
package/src/ai/aiContainer.js
CHANGED
|
@@ -16,8 +16,7 @@ class aiContainer extends HTMLElement
|
|
|
16
16
|
#qdrantClient;
|
|
17
17
|
//#elChat;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
#openaiApiKey = "";
|
|
19
|
+
settings; /** nx-ai-settings element */
|
|
21
20
|
|
|
22
21
|
constructor() {
|
|
23
22
|
super();
|
|
@@ -65,38 +64,24 @@ class aiContainer extends HTMLElement
|
|
|
65
64
|
get target() { return this.#target; };
|
|
66
65
|
set target(v) { this.#target = v; };
|
|
67
66
|
|
|
68
|
-
get geminiApiKey() { return this.#geminiApiKey; };
|
|
69
|
-
set geminiApiKey(v) { this.#geminiApiKey = v; };
|
|
70
|
-
|
|
71
|
-
get openaiApiKey() { return this.#openaiApiKey; };
|
|
72
|
-
set openaiApiKey(v) { this.#openaiApiKey = v; };
|
|
73
|
-
|
|
74
|
-
get ollamaUrl() { return this.shadowRoot.querySelector("nx-ai-settings").shadowRoot.querySelector("#ollamaUrl").value; };
|
|
75
|
-
set ollamaUrl(v) { this.shadowRoot.querySelector("nx-ai-settings").shadowRoot.querySelector("#ollamaUrl").value = v; };
|
|
76
|
-
|
|
77
|
-
get qdrantUrl() { return this.shadowRoot.querySelector("nx-ai-settings").shadowRoot.querySelector("#qdrantUrl").value; };
|
|
78
|
-
set qdrantUrl(v) { this.shadowRoot.querySelector("nx-ai-settings").shadowRoot.querySelector("#qdrantUrl").value = v; };
|
|
79
|
-
|
|
80
67
|
#createModel = () => {
|
|
81
|
-
const elSettings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
82
|
-
if (!elSettings) return;
|
|
83
68
|
|
|
84
|
-
switch (
|
|
69
|
+
switch (this.settings.server) {
|
|
85
70
|
case "gemini":
|
|
86
|
-
this.#model = new ChatGoogleGenerativeAI({ model:
|
|
71
|
+
this.#model = new ChatGoogleGenerativeAI({ model: this.settings.model, apiKey: this.settings.geminiApiKey, temperature: 0,});
|
|
87
72
|
break;
|
|
88
73
|
case "openai":
|
|
89
|
-
this.#model = new ChatOpenAI({ model:
|
|
74
|
+
this.#model = new ChatOpenAI({ model: this.settings.model, apiKey: this.settings.openaiApiKey, temperature: 0, });
|
|
90
75
|
break;
|
|
91
76
|
case "ollama":
|
|
92
77
|
this.#model = new Ollama({
|
|
93
|
-
model:
|
|
94
|
-
host:
|
|
78
|
+
model: this.settings.model,
|
|
79
|
+
host: this.settings.ollamaUrl,
|
|
95
80
|
});
|
|
96
81
|
break;
|
|
97
82
|
}
|
|
98
83
|
|
|
99
|
-
this.#qdrantClient = new QdrantClient({ url:
|
|
84
|
+
this.#qdrantClient = new QdrantClient({ url: this.settings.qdrantUrl });
|
|
100
85
|
};
|
|
101
86
|
|
|
102
87
|
#getColumnInfo = () => {
|
|
@@ -178,13 +163,10 @@ class aiContainer extends HTMLElement
|
|
|
178
163
|
new HumanMessage(prompt),
|
|
179
164
|
]);
|
|
180
165
|
|
|
181
|
-
const elSettings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
182
|
-
if (!elSettings) throw new Error("nx-ai-settings missing !!!");
|
|
183
|
-
|
|
184
166
|
console.log(response);
|
|
185
167
|
|
|
186
168
|
let filterString;
|
|
187
|
-
switch (
|
|
169
|
+
switch (this.settings.server) {
|
|
188
170
|
case "openai":
|
|
189
171
|
filterString = this.#extractJsonSnippet(response.content.trim());
|
|
190
172
|
break;
|
|
@@ -331,6 +313,8 @@ class aiContainer extends HTMLElement
|
|
|
331
313
|
|
|
332
314
|
#init = (info) => {
|
|
333
315
|
|
|
316
|
+
this.settings = this.shadowRoot.querySelector("nx-ai-settings");
|
|
317
|
+
|
|
334
318
|
//this.#elChat = this.shadowRoot.querySelector("nx-ai-chat");
|
|
335
319
|
|
|
336
320
|
this.shadowRoot.querySelector("textarea").addEventListener("keydown", this.#keydownHandler);
|
|
@@ -403,7 +387,7 @@ class aiContainer extends HTMLElement
|
|
|
403
387
|
if (clickedIcon) clickedIcon.classList.add("active");
|
|
404
388
|
|
|
405
389
|
// `.menu-setting`이 클릭되었는지 확인 후 `nx-ai-settings` 토글
|
|
406
|
-
this.
|
|
390
|
+
this.settings.classList.toggle("expand", !!e.target.closest(".menu-setting"));
|
|
407
391
|
};
|
|
408
392
|
}
|
|
409
393
|
|
package/src/ai/aiSettings.js
CHANGED
|
@@ -9,6 +9,18 @@ class aiSettings extends HTMLElement
|
|
|
9
9
|
this.attachShadow({ mode: 'open' });
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
get geminiApiKey() { return this.shadowRoot.querySelector("#geminiApiKey").value; };
|
|
13
|
+
set geminiApiKey(v) { this.shadowRoot.querySelector("#geminiApiKey").value = v; };
|
|
14
|
+
|
|
15
|
+
get openaiApiKey() { this.shadowRoot.querySelector("#openaiApiKey").value };
|
|
16
|
+
set openaiApiKey(v) { this.shadowRoot.querySelector("#openaiApiKey").value = v; };
|
|
17
|
+
|
|
18
|
+
get ollamaUrl() { return this.shadowRoot.querySelector("#ollamaUrl").value; };
|
|
19
|
+
set ollamaUrl(v) { this.shadowRoot.querySelector("#ollamaUrl").value = v; };
|
|
20
|
+
|
|
21
|
+
get qdrantUrl() { return this.shadowRoot.querySelector("#qdrantUrl").value; };
|
|
22
|
+
set qdrantUrl(v) { this.shadowRoot.querySelector("#qdrantUrl").value = v; };
|
|
23
|
+
|
|
12
24
|
get server() {
|
|
13
25
|
return this.shadowRoot.querySelector('input[name="server"]:checked')?.value;
|
|
14
26
|
};
|