ide-assi 0.665.0 → 0.666.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.
@@ -203805,7 +203805,35 @@ console.log(el, href, title);
203805
203805
  }
203806
203806
  }
203807
203807
 
203808
+ generateWhereCause2 = async (xmlPath, queryId, userPrompt, apiKey) => {
203808
203809
 
203810
+ const res = await api.post("/api/source/query", {
203811
+ xmlPath: xmlPath,
203812
+ queryId: queryId
203813
+ });
203814
+
203815
+ console.log(res.query);
203816
+
203817
+ if (res.query) {
203818
+ const o = await this.#invoke('/prompts/user/generateWhereCause.txt', {
203819
+ "query": res.query,
203820
+ "userPrompt": userPrompt
203821
+ });
203822
+
203823
+ console.log(o);
203824
+
203825
+ if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
203826
+ if (o.result !== true) throw new Error(o.condition);
203827
+ }
203828
+ else {
203829
+ throw new Error(o);
203830
+ }
203831
+
203832
+ return o.condition;
203833
+ }
203834
+
203835
+
203836
+ };
203809
203837
 
203810
203838
 
203811
203839
  static generateWhereCause = async (xmlPath, queryId, userPrompt, apiKey) => {
@@ -237555,9 +237583,12 @@ class aiNatualInput extends HTMLElement
237555
237583
  #queryId;
237556
237584
  #selectFunc;
237557
237585
  #target;
237586
+ #ai;
237558
237587
 
237559
237588
  constructor() {
237560
237589
  super();
237590
+
237591
+ this.#ai = new IdeAi(this);
237561
237592
  }
237562
237593
 
237563
237594
  connectedCallback() {
@@ -237581,7 +237612,7 @@ class aiNatualInput extends HTMLElement
237581
237612
 
237582
237613
  let params = {};
237583
237614
  if (this.#target.value) {
237584
- params = { "_whereClause": await IdeAi.generateWhereCause(this.#xmlPath, this.#queryId, this.#target.value, this.#apiKey) };
237615
+ params = { "_whereClause": await ai.generateWhereCause2(this.#xmlPath, this.#queryId, this.#target.value, this.#apiKey) };
237585
237616
  }
237586
237617
 
237587
237618
  this.#selectFunc.call(this, params);
@@ -203801,7 +203801,35 @@ console.log(el, href, title);
203801
203801
  }
203802
203802
  }
203803
203803
 
203804
+ generateWhereCause2 = async (xmlPath, queryId, userPrompt, apiKey) => {
203804
203805
 
203806
+ const res = await api.post("/api/source/query", {
203807
+ xmlPath: xmlPath,
203808
+ queryId: queryId
203809
+ });
203810
+
203811
+ console.log(res.query);
203812
+
203813
+ if (res.query) {
203814
+ const o = await this.#invoke('/prompts/user/generateWhereCause.txt', {
203815
+ "query": res.query,
203816
+ "userPrompt": userPrompt
203817
+ });
203818
+
203819
+ console.log(o);
203820
+
203821
+ if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
203822
+ if (o.result !== true) throw new Error(o.condition);
203823
+ }
203824
+ else {
203825
+ throw new Error(o);
203826
+ }
203827
+
203828
+ return o.condition;
203829
+ }
203830
+
203831
+
203832
+ };
203805
203833
 
203806
203834
 
203807
203835
  static generateWhereCause = async (xmlPath, queryId, userPrompt, apiKey) => {
@@ -237551,9 +237579,12 @@ class aiNatualInput extends HTMLElement
237551
237579
  #queryId;
237552
237580
  #selectFunc;
237553
237581
  #target;
237582
+ #ai;
237554
237583
 
237555
237584
  constructor() {
237556
237585
  super();
237586
+
237587
+ this.#ai = new IdeAi(this);
237557
237588
  }
237558
237589
 
237559
237590
  connectedCallback() {
@@ -237577,7 +237608,7 @@ class aiNatualInput extends HTMLElement
237577
237608
 
237578
237609
  let params = {};
237579
237610
  if (this.#target.value) {
237580
- params = { "_whereClause": await IdeAi.generateWhereCause(this.#xmlPath, this.#queryId, this.#target.value, this.#apiKey) };
237611
+ params = { "_whereClause": await ai.generateWhereCause2(this.#xmlPath, this.#queryId, this.#target.value, this.#apiKey) };
237581
237612
  }
237582
237613
 
237583
237614
  this.#selectFunc.call(this, params);
@@ -8,9 +8,12 @@ class aiNatualInput extends HTMLElement
8
8
  #queryId;
9
9
  #selectFunc;
10
10
  #target;
11
+ #ai;
11
12
 
12
13
  constructor() {
13
14
  super();
15
+
16
+ this.#ai = new IdeAi(this);
14
17
  }
15
18
 
16
19
  connectedCallback() {
@@ -34,7 +37,7 @@ class aiNatualInput extends HTMLElement
34
37
 
35
38
  let params = {};
36
39
  if (this.#target.value) {
37
- params = { "_whereClause": await IdeAi.generateWhereCause(this.#xmlPath, this.#queryId, this.#target.value, this.#apiKey) };
40
+ params = { "_whereClause": await ai.generateWhereCause2(this.#xmlPath, this.#queryId, this.#target.value, this.#apiKey) };
38
41
  }
39
42
 
40
43
  this.#selectFunc.call(this, params);
@@ -1260,7 +1260,35 @@ console.log(el, href, title);
1260
1260
  }
1261
1261
  }
1262
1262
 
1263
+ generateWhereCause2 = async (xmlPath, queryId, userPrompt, apiKey) => {
1263
1264
 
1265
+ const res = await api.post("/api/source/query", {
1266
+ xmlPath: xmlPath,
1267
+ queryId: queryId
1268
+ });
1269
+
1270
+ console.log(res.query);
1271
+
1272
+ if (res.query) {
1273
+ const o = await this.#invoke('/prompts/user/generateWhereCause.txt', {
1274
+ "query": res.query,
1275
+ "userPrompt": userPrompt
1276
+ });
1277
+
1278
+ console.log(o);
1279
+
1280
+ if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
1281
+ if (o.result !== true) throw new Error(o.condition);
1282
+ }
1283
+ else {
1284
+ throw new Error(o);
1285
+ }
1286
+
1287
+ return o.condition;
1288
+ }
1289
+
1290
+
1291
+ };
1264
1292
 
1265
1293
 
1266
1294
  static generateWhereCause = async (xmlPath, queryId, userPrompt, apiKey) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.665.0",
4
+ "version": "0.666.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -8,9 +8,12 @@ class aiNatualInput extends HTMLElement
8
8
  #queryId;
9
9
  #selectFunc;
10
10
  #target;
11
+ #ai;
11
12
 
12
13
  constructor() {
13
14
  super();
15
+
16
+ this.#ai = new IdeAi(this);
14
17
  }
15
18
 
16
19
  connectedCallback() {
@@ -34,7 +37,7 @@ class aiNatualInput extends HTMLElement
34
37
 
35
38
  let params = {};
36
39
  if (this.#target.value) {
37
- params = { "_whereClause": await IdeAi.generateWhereCause(this.#xmlPath, this.#queryId, this.#target.value, this.#apiKey) };
40
+ params = { "_whereClause": await ai.generateWhereCause2(this.#xmlPath, this.#queryId, this.#target.value, this.#apiKey) };
38
41
  }
39
42
 
40
43
  this.#selectFunc.call(this, params);
@@ -1260,7 +1260,35 @@ console.log(el, href, title);
1260
1260
  }
1261
1261
  }
1262
1262
 
1263
+ generateWhereCause2 = async (xmlPath, queryId, userPrompt, apiKey) => {
1263
1264
 
1265
+ const res = await api.post("/api/source/query", {
1266
+ xmlPath: xmlPath,
1267
+ queryId: queryId
1268
+ });
1269
+
1270
+ console.log(res.query);
1271
+
1272
+ if (res.query) {
1273
+ const o = await this.#invoke('/prompts/user/generateWhereCause.txt', {
1274
+ "query": res.query,
1275
+ "userPrompt": userPrompt
1276
+ });
1277
+
1278
+ console.log(o);
1279
+
1280
+ if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
1281
+ if (o.result !== true) throw new Error(o.condition);
1282
+ }
1283
+ else {
1284
+ throw new Error(o);
1285
+ }
1286
+
1287
+ return o.condition;
1288
+ }
1289
+
1290
+
1291
+ };
1264
1292
 
1265
1293
 
1266
1294
  static generateWhereCause = async (xmlPath, queryId, userPrompt, apiKey) => {