ide-assi 0.81.0 → 0.82.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/bundle.cjs.js +29 -28
- package/dist/bundle.esm.js +29 -28
- package/dist/components/ideAi.js +29 -3
- package/dist/components/ideAssi.js +2 -27
- package/dist/components/ideAssiSettings.js +1 -1
- package/package.json +1 -1
- package/src/components/ideAi.js +29 -3
- package/src/components/ideAssi.js +2 -27
- package/src/components/ideAssiSettings.js +1 -1
package/dist/bundle.cjs.js
CHANGED
|
@@ -193290,10 +193290,32 @@ class IdeAi
|
|
|
193290
193290
|
#API_URL = "http://localhost:8091";
|
|
193291
193291
|
#SCHEMA = "booxtory_250131";
|
|
193292
193292
|
#model;
|
|
193293
|
+
#parent;
|
|
193293
193294
|
|
|
193294
|
-
constructor() {
|
|
193295
|
+
constructor(parent) {
|
|
193296
|
+
this.#parent = parent;
|
|
193295
193297
|
}
|
|
193296
193298
|
|
|
193299
|
+
#createModel = () => {
|
|
193300
|
+
|
|
193301
|
+
switch (this.#parent.settings.server) {
|
|
193302
|
+
case "gemini":
|
|
193303
|
+
this.#model = new ChatGoogleGenerativeAI({ model: this.#parent.settings.model, apiKey: this.#parent.settings.geminiApiKey, temperature: 0,});
|
|
193304
|
+
break;
|
|
193305
|
+
case "openai":
|
|
193306
|
+
this.#model = new ChatOpenAI({ model: this.#parent.settings.model, apiKey: this.#parent.settings.openaiApiKey, temperature: 0, });
|
|
193307
|
+
break;
|
|
193308
|
+
case "ollama":
|
|
193309
|
+
this.#model = new Ollama({
|
|
193310
|
+
model: this.#parent.settings.model,
|
|
193311
|
+
host: this.#parent.settings.ollamaUrl,
|
|
193312
|
+
});
|
|
193313
|
+
break;
|
|
193314
|
+
}
|
|
193315
|
+
|
|
193316
|
+
//this.#qdrantClient = new QdrantClient({ url: this.settings.qdrantUrl });
|
|
193317
|
+
};
|
|
193318
|
+
|
|
193297
193319
|
#getMenuInfo = () => {
|
|
193298
193320
|
let arr = [];
|
|
193299
193321
|
|
|
@@ -193433,12 +193455,13 @@ class IdeAi
|
|
|
193433
193455
|
|
|
193434
193456
|
generateSourceClient = async (userPrompt) => {
|
|
193435
193457
|
|
|
193458
|
+
this.#createModel();
|
|
193459
|
+
|
|
193436
193460
|
const systemMessage = "You are a helpful assistant.";
|
|
193437
193461
|
const prompt = await IdeAiPrompt.generatePrompt('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
|
|
193438
193462
|
|
|
193439
193463
|
//const prompt = await IdeAiPrompt.getDevelopActionClassification(userPrompt);
|
|
193440
|
-
|
|
193441
|
-
console.log(prompt);
|
|
193464
|
+
//console.log(prompt);
|
|
193442
193465
|
|
|
193443
193466
|
const response = await this.#model.invoke([
|
|
193444
193467
|
new SystemMessage(systemMessage),
|
|
@@ -193454,7 +193477,6 @@ class IdeAssi extends HTMLElement
|
|
|
193454
193477
|
{
|
|
193455
193478
|
#ing = false;
|
|
193456
193479
|
#ai;
|
|
193457
|
-
#model;
|
|
193458
193480
|
|
|
193459
193481
|
settings;
|
|
193460
193482
|
|
|
@@ -193462,7 +193484,7 @@ class IdeAssi extends HTMLElement
|
|
|
193462
193484
|
super();
|
|
193463
193485
|
this.attachShadow({ mode: 'open' });
|
|
193464
193486
|
|
|
193465
|
-
this.#ai = new IdeAi();
|
|
193487
|
+
this.#ai = new IdeAi(this);
|
|
193466
193488
|
}
|
|
193467
193489
|
|
|
193468
193490
|
connectedCallback() {
|
|
@@ -193516,28 +193538,7 @@ class IdeAssi extends HTMLElement
|
|
|
193516
193538
|
};
|
|
193517
193539
|
|
|
193518
193540
|
|
|
193519
|
-
#createModel = () => {
|
|
193520
193541
|
|
|
193521
|
-
switch (this.settings.server) {
|
|
193522
|
-
case "gemini":
|
|
193523
|
-
console.log(this.settings);
|
|
193524
|
-
console.log(this.settings.geminiApiKey);
|
|
193525
|
-
this.#model = new ChatGoogleGenerativeAI({ model: this.settings.model, apiKey: this.settings.geminiApiKey, temperature: 0,});
|
|
193526
|
-
break;
|
|
193527
|
-
case "openai":
|
|
193528
|
-
console.log(this.settings.openaiApiKey);
|
|
193529
|
-
this.#model = new ChatOpenAI({ model: this.settings.model, apiKey: this.settings.openaiApiKey, temperature: 0, });
|
|
193530
|
-
break;
|
|
193531
|
-
case "ollama":
|
|
193532
|
-
this.#model = new Ollama({
|
|
193533
|
-
model: this.settings.model,
|
|
193534
|
-
host: this.settings.ollamaUrl,
|
|
193535
|
-
});
|
|
193536
|
-
break;
|
|
193537
|
-
}
|
|
193538
|
-
|
|
193539
|
-
//this.#qdrantClient = new QdrantClient({ url: this.settings.qdrantUrl });
|
|
193540
|
-
};
|
|
193541
193542
|
|
|
193542
193543
|
#keydownHandler = async (e) => {
|
|
193543
193544
|
if (e.key !== "Enter") return;
|
|
@@ -193564,7 +193565,7 @@ class IdeAssi extends HTMLElement
|
|
|
193564
193565
|
elAiChat.add("ing", "...");
|
|
193565
193566
|
|
|
193566
193567
|
try {
|
|
193567
|
-
this.#createModel();
|
|
193568
|
+
//this.#createModel();
|
|
193568
193569
|
|
|
193569
193570
|
const r = await this.#ai.generateSourceClient(userPrompt);
|
|
193570
193571
|
|
|
@@ -193660,7 +193661,7 @@ class ideAssiSettings extends HTMLElement
|
|
|
193660
193661
|
}
|
|
193661
193662
|
|
|
193662
193663
|
get geminiApiKey() { return this.shadowRoot.querySelector("#geminiApiKey").value; };
|
|
193663
|
-
set geminiApiKey(v) {
|
|
193664
|
+
set geminiApiKey(v) { this.shadowRoot.querySelector("#geminiApiKey").value = v; };
|
|
193664
193665
|
|
|
193665
193666
|
get openaiApiKey() { return this.shadowRoot.querySelector("#openaiApiKey").value };
|
|
193666
193667
|
set openaiApiKey(v) { this.shadowRoot.querySelector("#openaiApiKey").value = v; };
|
package/dist/bundle.esm.js
CHANGED
|
@@ -193286,10 +193286,32 @@ class IdeAi
|
|
|
193286
193286
|
#API_URL = "http://localhost:8091";
|
|
193287
193287
|
#SCHEMA = "booxtory_250131";
|
|
193288
193288
|
#model;
|
|
193289
|
+
#parent;
|
|
193289
193290
|
|
|
193290
|
-
constructor() {
|
|
193291
|
+
constructor(parent) {
|
|
193292
|
+
this.#parent = parent;
|
|
193291
193293
|
}
|
|
193292
193294
|
|
|
193295
|
+
#createModel = () => {
|
|
193296
|
+
|
|
193297
|
+
switch (this.#parent.settings.server) {
|
|
193298
|
+
case "gemini":
|
|
193299
|
+
this.#model = new ChatGoogleGenerativeAI({ model: this.#parent.settings.model, apiKey: this.#parent.settings.geminiApiKey, temperature: 0,});
|
|
193300
|
+
break;
|
|
193301
|
+
case "openai":
|
|
193302
|
+
this.#model = new ChatOpenAI({ model: this.#parent.settings.model, apiKey: this.#parent.settings.openaiApiKey, temperature: 0, });
|
|
193303
|
+
break;
|
|
193304
|
+
case "ollama":
|
|
193305
|
+
this.#model = new Ollama({
|
|
193306
|
+
model: this.#parent.settings.model,
|
|
193307
|
+
host: this.#parent.settings.ollamaUrl,
|
|
193308
|
+
});
|
|
193309
|
+
break;
|
|
193310
|
+
}
|
|
193311
|
+
|
|
193312
|
+
//this.#qdrantClient = new QdrantClient({ url: this.settings.qdrantUrl });
|
|
193313
|
+
};
|
|
193314
|
+
|
|
193293
193315
|
#getMenuInfo = () => {
|
|
193294
193316
|
let arr = [];
|
|
193295
193317
|
|
|
@@ -193429,12 +193451,13 @@ class IdeAi
|
|
|
193429
193451
|
|
|
193430
193452
|
generateSourceClient = async (userPrompt) => {
|
|
193431
193453
|
|
|
193454
|
+
this.#createModel();
|
|
193455
|
+
|
|
193432
193456
|
const systemMessage = "You are a helpful assistant.";
|
|
193433
193457
|
const prompt = await IdeAiPrompt.generatePrompt('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
|
|
193434
193458
|
|
|
193435
193459
|
//const prompt = await IdeAiPrompt.getDevelopActionClassification(userPrompt);
|
|
193436
|
-
|
|
193437
|
-
console.log(prompt);
|
|
193460
|
+
//console.log(prompt);
|
|
193438
193461
|
|
|
193439
193462
|
const response = await this.#model.invoke([
|
|
193440
193463
|
new SystemMessage(systemMessage),
|
|
@@ -193450,7 +193473,6 @@ class IdeAssi extends HTMLElement
|
|
|
193450
193473
|
{
|
|
193451
193474
|
#ing = false;
|
|
193452
193475
|
#ai;
|
|
193453
|
-
#model;
|
|
193454
193476
|
|
|
193455
193477
|
settings;
|
|
193456
193478
|
|
|
@@ -193458,7 +193480,7 @@ class IdeAssi extends HTMLElement
|
|
|
193458
193480
|
super();
|
|
193459
193481
|
this.attachShadow({ mode: 'open' });
|
|
193460
193482
|
|
|
193461
|
-
this.#ai = new IdeAi();
|
|
193483
|
+
this.#ai = new IdeAi(this);
|
|
193462
193484
|
}
|
|
193463
193485
|
|
|
193464
193486
|
connectedCallback() {
|
|
@@ -193512,28 +193534,7 @@ class IdeAssi extends HTMLElement
|
|
|
193512
193534
|
};
|
|
193513
193535
|
|
|
193514
193536
|
|
|
193515
|
-
#createModel = () => {
|
|
193516
193537
|
|
|
193517
|
-
switch (this.settings.server) {
|
|
193518
|
-
case "gemini":
|
|
193519
|
-
console.log(this.settings);
|
|
193520
|
-
console.log(this.settings.geminiApiKey);
|
|
193521
|
-
this.#model = new ChatGoogleGenerativeAI({ model: this.settings.model, apiKey: this.settings.geminiApiKey, temperature: 0,});
|
|
193522
|
-
break;
|
|
193523
|
-
case "openai":
|
|
193524
|
-
console.log(this.settings.openaiApiKey);
|
|
193525
|
-
this.#model = new ChatOpenAI({ model: this.settings.model, apiKey: this.settings.openaiApiKey, temperature: 0, });
|
|
193526
|
-
break;
|
|
193527
|
-
case "ollama":
|
|
193528
|
-
this.#model = new Ollama({
|
|
193529
|
-
model: this.settings.model,
|
|
193530
|
-
host: this.settings.ollamaUrl,
|
|
193531
|
-
});
|
|
193532
|
-
break;
|
|
193533
|
-
}
|
|
193534
|
-
|
|
193535
|
-
//this.#qdrantClient = new QdrantClient({ url: this.settings.qdrantUrl });
|
|
193536
|
-
};
|
|
193537
193538
|
|
|
193538
193539
|
#keydownHandler = async (e) => {
|
|
193539
193540
|
if (e.key !== "Enter") return;
|
|
@@ -193560,7 +193561,7 @@ class IdeAssi extends HTMLElement
|
|
|
193560
193561
|
elAiChat.add("ing", "...");
|
|
193561
193562
|
|
|
193562
193563
|
try {
|
|
193563
|
-
this.#createModel();
|
|
193564
|
+
//this.#createModel();
|
|
193564
193565
|
|
|
193565
193566
|
const r = await this.#ai.generateSourceClient(userPrompt);
|
|
193566
193567
|
|
|
@@ -193656,7 +193657,7 @@ class ideAssiSettings extends HTMLElement
|
|
|
193656
193657
|
}
|
|
193657
193658
|
|
|
193658
193659
|
get geminiApiKey() { return this.shadowRoot.querySelector("#geminiApiKey").value; };
|
|
193659
|
-
set geminiApiKey(v) {
|
|
193660
|
+
set geminiApiKey(v) { this.shadowRoot.querySelector("#geminiApiKey").value = v; };
|
|
193660
193661
|
|
|
193661
193662
|
get openaiApiKey() { return this.shadowRoot.querySelector("#openaiApiKey").value };
|
|
193662
193663
|
set openaiApiKey(v) { this.shadowRoot.querySelector("#openaiApiKey").value = v; };
|
package/dist/components/ideAi.js
CHANGED
|
@@ -1,16 +1,41 @@
|
|
|
1
1
|
import ninegrid from "ninegrid2";
|
|
2
2
|
import {IdeAiPrompt} from "./ideAiPrompt.js";
|
|
3
3
|
import { HumanMessage, SystemMessage } from '@langchain/core/messages';
|
|
4
|
+
import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
|
|
5
|
+
import { Ollama } from "@langchain/ollama";
|
|
6
|
+
import { ChatOpenAI } from '@langchain/openai';
|
|
4
7
|
|
|
5
8
|
export class IdeAi
|
|
6
9
|
{
|
|
7
10
|
#API_URL = "http://localhost:8091";
|
|
8
11
|
#SCHEMA = "booxtory_250131";
|
|
9
12
|
#model;
|
|
13
|
+
#parent;
|
|
10
14
|
|
|
11
|
-
constructor() {
|
|
15
|
+
constructor(parent) {
|
|
16
|
+
this.#parent = parent;
|
|
12
17
|
}
|
|
13
18
|
|
|
19
|
+
#createModel = () => {
|
|
20
|
+
|
|
21
|
+
switch (this.#parent.settings.server) {
|
|
22
|
+
case "gemini":
|
|
23
|
+
this.#model = new ChatGoogleGenerativeAI({ model: this.#parent.settings.model, apiKey: this.#parent.settings.geminiApiKey, temperature: 0,});
|
|
24
|
+
break;
|
|
25
|
+
case "openai":
|
|
26
|
+
this.#model = new ChatOpenAI({ model: this.#parent.settings.model, apiKey: this.#parent.settings.openaiApiKey, temperature: 0, });
|
|
27
|
+
break;
|
|
28
|
+
case "ollama":
|
|
29
|
+
this.#model = new Ollama({
|
|
30
|
+
model: this.#parent.settings.model,
|
|
31
|
+
host: this.#parent.settings.ollamaUrl,
|
|
32
|
+
});
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//this.#qdrantClient = new QdrantClient({ url: this.settings.qdrantUrl });
|
|
37
|
+
};
|
|
38
|
+
|
|
14
39
|
#getMenuInfo = () => {
|
|
15
40
|
let arr = [];
|
|
16
41
|
|
|
@@ -150,12 +175,13 @@ export class IdeAi
|
|
|
150
175
|
|
|
151
176
|
generateSourceClient = async (userPrompt) => {
|
|
152
177
|
|
|
178
|
+
this.#createModel();
|
|
179
|
+
|
|
153
180
|
const systemMessage = "You are a helpful assistant.";
|
|
154
181
|
const prompt = await IdeAiPrompt.generatePrompt('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
|
|
155
182
|
|
|
156
183
|
//const prompt = await IdeAiPrompt.getDevelopActionClassification(userPrompt);
|
|
157
|
-
|
|
158
|
-
console.log(prompt);
|
|
184
|
+
//console.log(prompt);
|
|
159
185
|
|
|
160
186
|
const response = await this.#model.invoke([
|
|
161
187
|
new SystemMessage(systemMessage),
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import ninegrid from "ninegrid2";
|
|
2
2
|
import { IdeAi } from "./ideAi.js";
|
|
3
|
-
import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
|
|
4
|
-
import { Ollama } from "@langchain/ollama";
|
|
5
|
-
import { ChatOpenAI } from '@langchain/openai';
|
|
6
3
|
|
|
7
4
|
export class IdeAssi extends HTMLElement
|
|
8
5
|
{
|
|
9
6
|
#ing = false;
|
|
10
7
|
#ai;
|
|
11
|
-
#model;
|
|
12
8
|
|
|
13
9
|
settings;
|
|
14
10
|
|
|
@@ -16,7 +12,7 @@ export class IdeAssi extends HTMLElement
|
|
|
16
12
|
super();
|
|
17
13
|
this.attachShadow({ mode: 'open' });
|
|
18
14
|
|
|
19
|
-
this.#ai = new IdeAi();
|
|
15
|
+
this.#ai = new IdeAi(this);
|
|
20
16
|
}
|
|
21
17
|
|
|
22
18
|
connectedCallback() {
|
|
@@ -70,28 +66,7 @@ export class IdeAssi extends HTMLElement
|
|
|
70
66
|
};
|
|
71
67
|
|
|
72
68
|
|
|
73
|
-
#createModel = () => {
|
|
74
|
-
|
|
75
|
-
switch (this.settings.server) {
|
|
76
|
-
case "gemini":
|
|
77
|
-
console.log(this.settings);
|
|
78
|
-
console.log(this.settings.geminiApiKey);
|
|
79
|
-
this.#model = new ChatGoogleGenerativeAI({ model: this.settings.model, apiKey: this.settings.geminiApiKey, temperature: 0,});
|
|
80
|
-
break;
|
|
81
|
-
case "openai":
|
|
82
|
-
console.log(this.settings.openaiApiKey);
|
|
83
|
-
this.#model = new ChatOpenAI({ model: this.settings.model, apiKey: this.settings.openaiApiKey, temperature: 0, });
|
|
84
|
-
break;
|
|
85
|
-
case "ollama":
|
|
86
|
-
this.#model = new Ollama({
|
|
87
|
-
model: this.settings.model,
|
|
88
|
-
host: this.settings.ollamaUrl,
|
|
89
|
-
});
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
69
|
|
|
93
|
-
//this.#qdrantClient = new QdrantClient({ url: this.settings.qdrantUrl });
|
|
94
|
-
};
|
|
95
70
|
|
|
96
71
|
#keydownHandler = async (e) => {
|
|
97
72
|
if (e.key !== "Enter") return;
|
|
@@ -118,7 +93,7 @@ export class IdeAssi extends HTMLElement
|
|
|
118
93
|
elAiChat.add("ing", "...");
|
|
119
94
|
|
|
120
95
|
try {
|
|
121
|
-
this.#createModel();
|
|
96
|
+
//this.#createModel();
|
|
122
97
|
|
|
123
98
|
const r = await this.#ai.generateSourceClient(userPrompt);
|
|
124
99
|
|
|
@@ -10,7 +10,7 @@ class ideAssiSettings extends HTMLElement
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
get geminiApiKey() { return this.shadowRoot.querySelector("#geminiApiKey").value; };
|
|
13
|
-
set geminiApiKey(v) {
|
|
13
|
+
set geminiApiKey(v) { this.shadowRoot.querySelector("#geminiApiKey").value = v; };
|
|
14
14
|
|
|
15
15
|
get openaiApiKey() { return this.shadowRoot.querySelector("#openaiApiKey").value };
|
|
16
16
|
set openaiApiKey(v) { this.shadowRoot.querySelector("#openaiApiKey").value = v; };
|
package/package.json
CHANGED
package/src/components/ideAi.js
CHANGED
|
@@ -1,16 +1,41 @@
|
|
|
1
1
|
import ninegrid from "ninegrid2";
|
|
2
2
|
import {IdeAiPrompt} from "./ideAiPrompt.js";
|
|
3
3
|
import { HumanMessage, SystemMessage } from '@langchain/core/messages';
|
|
4
|
+
import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
|
|
5
|
+
import { Ollama } from "@langchain/ollama";
|
|
6
|
+
import { ChatOpenAI } from '@langchain/openai';
|
|
4
7
|
|
|
5
8
|
export class IdeAi
|
|
6
9
|
{
|
|
7
10
|
#API_URL = "http://localhost:8091";
|
|
8
11
|
#SCHEMA = "booxtory_250131";
|
|
9
12
|
#model;
|
|
13
|
+
#parent;
|
|
10
14
|
|
|
11
|
-
constructor() {
|
|
15
|
+
constructor(parent) {
|
|
16
|
+
this.#parent = parent;
|
|
12
17
|
}
|
|
13
18
|
|
|
19
|
+
#createModel = () => {
|
|
20
|
+
|
|
21
|
+
switch (this.#parent.settings.server) {
|
|
22
|
+
case "gemini":
|
|
23
|
+
this.#model = new ChatGoogleGenerativeAI({ model: this.#parent.settings.model, apiKey: this.#parent.settings.geminiApiKey, temperature: 0,});
|
|
24
|
+
break;
|
|
25
|
+
case "openai":
|
|
26
|
+
this.#model = new ChatOpenAI({ model: this.#parent.settings.model, apiKey: this.#parent.settings.openaiApiKey, temperature: 0, });
|
|
27
|
+
break;
|
|
28
|
+
case "ollama":
|
|
29
|
+
this.#model = new Ollama({
|
|
30
|
+
model: this.#parent.settings.model,
|
|
31
|
+
host: this.#parent.settings.ollamaUrl,
|
|
32
|
+
});
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//this.#qdrantClient = new QdrantClient({ url: this.settings.qdrantUrl });
|
|
37
|
+
};
|
|
38
|
+
|
|
14
39
|
#getMenuInfo = () => {
|
|
15
40
|
let arr = [];
|
|
16
41
|
|
|
@@ -150,12 +175,13 @@ export class IdeAi
|
|
|
150
175
|
|
|
151
176
|
generateSourceClient = async (userPrompt) => {
|
|
152
177
|
|
|
178
|
+
this.#createModel();
|
|
179
|
+
|
|
153
180
|
const systemMessage = "You are a helpful assistant.";
|
|
154
181
|
const prompt = await IdeAiPrompt.generatePrompt('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
|
|
155
182
|
|
|
156
183
|
//const prompt = await IdeAiPrompt.getDevelopActionClassification(userPrompt);
|
|
157
|
-
|
|
158
|
-
console.log(prompt);
|
|
184
|
+
//console.log(prompt);
|
|
159
185
|
|
|
160
186
|
const response = await this.#model.invoke([
|
|
161
187
|
new SystemMessage(systemMessage),
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import ninegrid from "ninegrid2";
|
|
2
2
|
import { IdeAi } from "./ideAi.js";
|
|
3
|
-
import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
|
|
4
|
-
import { Ollama } from "@langchain/ollama";
|
|
5
|
-
import { ChatOpenAI } from '@langchain/openai';
|
|
6
3
|
|
|
7
4
|
export class IdeAssi extends HTMLElement
|
|
8
5
|
{
|
|
9
6
|
#ing = false;
|
|
10
7
|
#ai;
|
|
11
|
-
#model;
|
|
12
8
|
|
|
13
9
|
settings;
|
|
14
10
|
|
|
@@ -16,7 +12,7 @@ export class IdeAssi extends HTMLElement
|
|
|
16
12
|
super();
|
|
17
13
|
this.attachShadow({ mode: 'open' });
|
|
18
14
|
|
|
19
|
-
this.#ai = new IdeAi();
|
|
15
|
+
this.#ai = new IdeAi(this);
|
|
20
16
|
}
|
|
21
17
|
|
|
22
18
|
connectedCallback() {
|
|
@@ -70,28 +66,7 @@ export class IdeAssi extends HTMLElement
|
|
|
70
66
|
};
|
|
71
67
|
|
|
72
68
|
|
|
73
|
-
#createModel = () => {
|
|
74
|
-
|
|
75
|
-
switch (this.settings.server) {
|
|
76
|
-
case "gemini":
|
|
77
|
-
console.log(this.settings);
|
|
78
|
-
console.log(this.settings.geminiApiKey);
|
|
79
|
-
this.#model = new ChatGoogleGenerativeAI({ model: this.settings.model, apiKey: this.settings.geminiApiKey, temperature: 0,});
|
|
80
|
-
break;
|
|
81
|
-
case "openai":
|
|
82
|
-
console.log(this.settings.openaiApiKey);
|
|
83
|
-
this.#model = new ChatOpenAI({ model: this.settings.model, apiKey: this.settings.openaiApiKey, temperature: 0, });
|
|
84
|
-
break;
|
|
85
|
-
case "ollama":
|
|
86
|
-
this.#model = new Ollama({
|
|
87
|
-
model: this.settings.model,
|
|
88
|
-
host: this.settings.ollamaUrl,
|
|
89
|
-
});
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
69
|
|
|
93
|
-
//this.#qdrantClient = new QdrantClient({ url: this.settings.qdrantUrl });
|
|
94
|
-
};
|
|
95
70
|
|
|
96
71
|
#keydownHandler = async (e) => {
|
|
97
72
|
if (e.key !== "Enter") return;
|
|
@@ -118,7 +93,7 @@ export class IdeAssi extends HTMLElement
|
|
|
118
93
|
elAiChat.add("ing", "...");
|
|
119
94
|
|
|
120
95
|
try {
|
|
121
|
-
this.#createModel();
|
|
96
|
+
//this.#createModel();
|
|
122
97
|
|
|
123
98
|
const r = await this.#ai.generateSourceClient(userPrompt);
|
|
124
99
|
|
|
@@ -10,7 +10,7 @@ class ideAssiSettings extends HTMLElement
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
get geminiApiKey() { return this.shadowRoot.querySelector("#geminiApiKey").value; };
|
|
13
|
-
set geminiApiKey(v) {
|
|
13
|
+
set geminiApiKey(v) { this.shadowRoot.querySelector("#geminiApiKey").value = v; };
|
|
14
14
|
|
|
15
15
|
get openaiApiKey() { return this.shadowRoot.querySelector("#openaiApiKey").value };
|
|
16
16
|
set openaiApiKey(v) { this.shadowRoot.querySelector("#openaiApiKey").value = v; };
|