ide-assi 0.18.0 → 0.20.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 +15 -12
- package/dist/bundle.esm.js +15 -12
- package/dist/components/ideAi.js +11 -10
- package/dist/components/ideAssi.js +4 -2
- package/package.json +1 -1
- package/src/components/ideAi.js +11 -10
- package/src/components/ideAssi.js +4 -2
package/dist/bundle.cjs.js
CHANGED
|
@@ -193262,8 +193262,6 @@ class IdeAi
|
|
|
193262
193262
|
#API_URL = "http://localhost:8091";
|
|
193263
193263
|
#SCHEMA = "booxtory_250131";
|
|
193264
193264
|
|
|
193265
|
-
#ing = false;
|
|
193266
|
-
|
|
193267
193265
|
constructor() {
|
|
193268
193266
|
}
|
|
193269
193267
|
|
|
@@ -193311,17 +193309,13 @@ class IdeAi
|
|
|
193311
193309
|
*/
|
|
193312
193310
|
generateSource = async (userPrompt) => {
|
|
193313
193311
|
|
|
193314
|
-
if (this.#ing) return;
|
|
193315
|
-
|
|
193316
|
-
this.#ing = true;
|
|
193317
|
-
|
|
193318
193312
|
const menus = this.#getMenuInfo();
|
|
193319
193313
|
const tables = await this.#getTableInfo();
|
|
193320
193314
|
|
|
193321
193315
|
console.log(menus);
|
|
193322
193316
|
console.log(tables);
|
|
193323
193317
|
|
|
193324
|
-
|
|
193318
|
+
await fetch(`${this.#API_URL}/ai/inferSourceMeta`, {
|
|
193325
193319
|
method: "POST",
|
|
193326
193320
|
headers: { "Content-Type": "application/json" },
|
|
193327
193321
|
body: JSON.stringify({
|
|
@@ -193331,10 +193325,17 @@ class IdeAi
|
|
|
193331
193325
|
})
|
|
193332
193326
|
});
|
|
193333
193327
|
|
|
193334
|
-
|
|
193335
|
-
|
|
193328
|
+
const response2 = await fetch(`${this.#API_URL}/ai/generateSource`, {
|
|
193329
|
+
method: "POST",
|
|
193330
|
+
headers: { "Content-Type": "application/json" },
|
|
193331
|
+
body: JSON.stringify({
|
|
193332
|
+
userPrompt: userPrompt,
|
|
193333
|
+
menus: menus,
|
|
193334
|
+
tables: tables.list,
|
|
193335
|
+
})
|
|
193336
|
+
});
|
|
193336
193337
|
|
|
193337
|
-
return await
|
|
193338
|
+
return await response2.json();
|
|
193338
193339
|
};
|
|
193339
193340
|
}
|
|
193340
193341
|
|
|
@@ -193422,10 +193423,12 @@ class IdeAssi extends HTMLElement
|
|
|
193422
193423
|
const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
|
|
193423
193424
|
|
|
193424
193425
|
elAiChat.add("me", question);
|
|
193425
|
-
elAiChat.add("ing",
|
|
193426
|
+
elAiChat.add("ing", "...");
|
|
193426
193427
|
|
|
193427
193428
|
try {
|
|
193428
|
-
this.#ai.generateSource(question);
|
|
193429
|
+
const r = await this.#ai.generateSource(question);
|
|
193430
|
+
console.log(r);
|
|
193431
|
+
elAiChat.add("ai", r);
|
|
193429
193432
|
} catch (error) {
|
|
193430
193433
|
console.error(error);
|
|
193431
193434
|
elAiChat.add("ai", error);
|
package/dist/bundle.esm.js
CHANGED
|
@@ -193258,8 +193258,6 @@ class IdeAi
|
|
|
193258
193258
|
#API_URL = "http://localhost:8091";
|
|
193259
193259
|
#SCHEMA = "booxtory_250131";
|
|
193260
193260
|
|
|
193261
|
-
#ing = false;
|
|
193262
|
-
|
|
193263
193261
|
constructor() {
|
|
193264
193262
|
}
|
|
193265
193263
|
|
|
@@ -193307,17 +193305,13 @@ class IdeAi
|
|
|
193307
193305
|
*/
|
|
193308
193306
|
generateSource = async (userPrompt) => {
|
|
193309
193307
|
|
|
193310
|
-
if (this.#ing) return;
|
|
193311
|
-
|
|
193312
|
-
this.#ing = true;
|
|
193313
|
-
|
|
193314
193308
|
const menus = this.#getMenuInfo();
|
|
193315
193309
|
const tables = await this.#getTableInfo();
|
|
193316
193310
|
|
|
193317
193311
|
console.log(menus);
|
|
193318
193312
|
console.log(tables);
|
|
193319
193313
|
|
|
193320
|
-
|
|
193314
|
+
await fetch(`${this.#API_URL}/ai/inferSourceMeta`, {
|
|
193321
193315
|
method: "POST",
|
|
193322
193316
|
headers: { "Content-Type": "application/json" },
|
|
193323
193317
|
body: JSON.stringify({
|
|
@@ -193327,10 +193321,17 @@ class IdeAi
|
|
|
193327
193321
|
})
|
|
193328
193322
|
});
|
|
193329
193323
|
|
|
193330
|
-
|
|
193331
|
-
|
|
193324
|
+
const response2 = await fetch(`${this.#API_URL}/ai/generateSource`, {
|
|
193325
|
+
method: "POST",
|
|
193326
|
+
headers: { "Content-Type": "application/json" },
|
|
193327
|
+
body: JSON.stringify({
|
|
193328
|
+
userPrompt: userPrompt,
|
|
193329
|
+
menus: menus,
|
|
193330
|
+
tables: tables.list,
|
|
193331
|
+
})
|
|
193332
|
+
});
|
|
193332
193333
|
|
|
193333
|
-
return await
|
|
193334
|
+
return await response2.json();
|
|
193334
193335
|
};
|
|
193335
193336
|
}
|
|
193336
193337
|
|
|
@@ -193418,10 +193419,12 @@ class IdeAssi extends HTMLElement
|
|
|
193418
193419
|
const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
|
|
193419
193420
|
|
|
193420
193421
|
elAiChat.add("me", question);
|
|
193421
|
-
elAiChat.add("ing",
|
|
193422
|
+
elAiChat.add("ing", "...");
|
|
193422
193423
|
|
|
193423
193424
|
try {
|
|
193424
|
-
this.#ai.generateSource(question);
|
|
193425
|
+
const r = await this.#ai.generateSource(question);
|
|
193426
|
+
console.log(r);
|
|
193427
|
+
elAiChat.add("ai", r);
|
|
193425
193428
|
} catch (error) {
|
|
193426
193429
|
console.error(error);
|
|
193427
193430
|
elAiChat.add("ai", error);
|
package/dist/components/ideAi.js
CHANGED
|
@@ -5,8 +5,6 @@ export class IdeAi
|
|
|
5
5
|
#API_URL = "http://localhost:8091";
|
|
6
6
|
#SCHEMA = "booxtory_250131";
|
|
7
7
|
|
|
8
|
-
#ing = false;
|
|
9
|
-
|
|
10
8
|
constructor() {
|
|
11
9
|
}
|
|
12
10
|
|
|
@@ -54,17 +52,13 @@ export class IdeAi
|
|
|
54
52
|
*/
|
|
55
53
|
generateSource = async (userPrompt) => {
|
|
56
54
|
|
|
57
|
-
if (this.#ing) return;
|
|
58
|
-
|
|
59
|
-
this.#ing = true;
|
|
60
|
-
|
|
61
55
|
const menus = this.#getMenuInfo();
|
|
62
56
|
const tables = await this.#getTableInfo();
|
|
63
57
|
|
|
64
58
|
console.log(menus);
|
|
65
59
|
console.log(tables);
|
|
66
60
|
|
|
67
|
-
const response = await fetch(`${this.#API_URL}/ai/
|
|
61
|
+
const response = await fetch(`${this.#API_URL}/ai/inferSourceMeta`, {
|
|
68
62
|
method: "POST",
|
|
69
63
|
headers: { "Content-Type": "application/json" },
|
|
70
64
|
body: JSON.stringify({
|
|
@@ -74,10 +68,17 @@ export class IdeAi
|
|
|
74
68
|
})
|
|
75
69
|
});
|
|
76
70
|
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
const response2 = await fetch(`${this.#API_URL}/ai/generateSource`, {
|
|
72
|
+
method: "POST",
|
|
73
|
+
headers: { "Content-Type": "application/json" },
|
|
74
|
+
body: JSON.stringify({
|
|
75
|
+
userPrompt: userPrompt,
|
|
76
|
+
menus: menus,
|
|
77
|
+
tables: tables.list,
|
|
78
|
+
})
|
|
79
|
+
});
|
|
79
80
|
|
|
80
|
-
return await
|
|
81
|
+
return await response2.json();
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
84
|
|
|
@@ -85,10 +85,12 @@ export class IdeAssi extends HTMLElement
|
|
|
85
85
|
const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
|
|
86
86
|
|
|
87
87
|
elAiChat.add("me", question);
|
|
88
|
-
elAiChat.add("ing",
|
|
88
|
+
elAiChat.add("ing", "...");
|
|
89
89
|
|
|
90
90
|
try {
|
|
91
|
-
this.#ai.generateSource(question);
|
|
91
|
+
const r = await this.#ai.generateSource(question);
|
|
92
|
+
console.log(r);
|
|
93
|
+
elAiChat.add("ai", r);
|
|
92
94
|
} catch (error) {
|
|
93
95
|
console.error(error);
|
|
94
96
|
elAiChat.add("ai", error);
|
package/package.json
CHANGED
package/src/components/ideAi.js
CHANGED
|
@@ -5,8 +5,6 @@ export class IdeAi
|
|
|
5
5
|
#API_URL = "http://localhost:8091";
|
|
6
6
|
#SCHEMA = "booxtory_250131";
|
|
7
7
|
|
|
8
|
-
#ing = false;
|
|
9
|
-
|
|
10
8
|
constructor() {
|
|
11
9
|
}
|
|
12
10
|
|
|
@@ -54,17 +52,13 @@ export class IdeAi
|
|
|
54
52
|
*/
|
|
55
53
|
generateSource = async (userPrompt) => {
|
|
56
54
|
|
|
57
|
-
if (this.#ing) return;
|
|
58
|
-
|
|
59
|
-
this.#ing = true;
|
|
60
|
-
|
|
61
55
|
const menus = this.#getMenuInfo();
|
|
62
56
|
const tables = await this.#getTableInfo();
|
|
63
57
|
|
|
64
58
|
console.log(menus);
|
|
65
59
|
console.log(tables);
|
|
66
60
|
|
|
67
|
-
const response = await fetch(`${this.#API_URL}/ai/
|
|
61
|
+
const response = await fetch(`${this.#API_URL}/ai/inferSourceMeta`, {
|
|
68
62
|
method: "POST",
|
|
69
63
|
headers: { "Content-Type": "application/json" },
|
|
70
64
|
body: JSON.stringify({
|
|
@@ -74,10 +68,17 @@ export class IdeAi
|
|
|
74
68
|
})
|
|
75
69
|
});
|
|
76
70
|
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
const response2 = await fetch(`${this.#API_URL}/ai/generateSource`, {
|
|
72
|
+
method: "POST",
|
|
73
|
+
headers: { "Content-Type": "application/json" },
|
|
74
|
+
body: JSON.stringify({
|
|
75
|
+
userPrompt: userPrompt,
|
|
76
|
+
menus: menus,
|
|
77
|
+
tables: tables.list,
|
|
78
|
+
})
|
|
79
|
+
});
|
|
79
80
|
|
|
80
|
-
return await
|
|
81
|
+
return await response2.json();
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
84
|
|
|
@@ -85,10 +85,12 @@ export class IdeAssi extends HTMLElement
|
|
|
85
85
|
const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
|
|
86
86
|
|
|
87
87
|
elAiChat.add("me", question);
|
|
88
|
-
elAiChat.add("ing",
|
|
88
|
+
elAiChat.add("ing", "...");
|
|
89
89
|
|
|
90
90
|
try {
|
|
91
|
-
this.#ai.generateSource(question);
|
|
91
|
+
const r = await this.#ai.generateSource(question);
|
|
92
|
+
console.log(r);
|
|
93
|
+
elAiChat.add("ai", r);
|
|
92
94
|
} catch (error) {
|
|
93
95
|
console.error(error);
|
|
94
96
|
elAiChat.add("ai", error);
|