ide-assi 0.78.0 → 0.80.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.
@@ -29,7 +29,6 @@ var require$$4$2 = require('async_hooks');
29
29
  var require$$1$3 = require('console');
30
30
  var require$$1$4 = require('url');
31
31
  var require$$0$e = require('diagnostics_channel');
32
- require('fs/promises');
33
32
 
34
33
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
35
34
 
@@ -193263,18 +193262,26 @@ class IdeAiPrompt
193263
193262
  constructor() {
193264
193263
  }
193265
193264
 
193266
- static getDevelopActionClassification = async (userPrompt) => {
193265
+ static generatePrompt = async (path, params) => {
193267
193266
 
193268
- const response = await fetch('/prompts/meta/개발액션분류.txt').then(res => res.text());
193269
- //const response = await fetch('/prompts/meta/aaa.txt');
193270
- console.log(response);
193267
+ const template = await fetch(path).then(res => res.text());
193271
193268
 
193272
- //return await response.text();
193273
- //console.log(result);
193269
+ return await new PromptTemplate({
193270
+ template,
193271
+ inputVariables: Object.keys(params),
193272
+ }).format(params);
193273
+ };
193274
193274
 
193275
+ static getDevelopActionClassification = async (userPrompt) => {
193275
193276
 
193276
- return response;
193277
+ const template = await fetch('/prompts/meta/개발액션분류.txt').then(res => res.text());
193277
193278
 
193279
+ return await new PromptTemplate({
193280
+ template,
193281
+ inputVariables: ['userPrompt'],
193282
+ }).format({
193283
+ userPrompt: userPrompt,
193284
+ });
193278
193285
  };
193279
193286
  }
193280
193287
 
@@ -193426,13 +193433,12 @@ class IdeAi
193426
193433
 
193427
193434
  generateSourceClient = async (userPrompt) => {
193428
193435
 
193429
- const prompt = await IdeAiPrompt.getDevelopActionClassification(userPrompt);
193430
-
193431
- console.log(prompt);
193432
-
193433
193436
  const systemMessage = "You are a helpful assistant.";
193437
+ const prompt = await IdeAiPrompt.generatePrompt('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
193434
193438
 
193439
+ //const prompt = await IdeAiPrompt.getDevelopActionClassification(userPrompt);
193435
193440
 
193441
+ console.log(prompt);
193436
193442
 
193437
193443
  const response = await this.#model.invoke([
193438
193444
  new SystemMessage(systemMessage),
@@ -193514,6 +193520,7 @@ class IdeAssi extends HTMLElement
193514
193520
 
193515
193521
  switch (this.settings.server) {
193516
193522
  case "gemini":
193523
+ console.log(this.settings);
193517
193524
  console.log(this.settings.geminiApiKey);
193518
193525
  this.#model = new ChatGoogleGenerativeAI({ model: this.settings.model, apiKey: this.settings.geminiApiKey, temperature: 0,});
193519
193526
  break;
@@ -25,7 +25,6 @@ import require$$4$2 from 'async_hooks';
25
25
  import require$$1$3 from 'console';
26
26
  import require$$1$4 from 'url';
27
27
  import require$$0$e from 'diagnostics_channel';
28
- import 'fs/promises';
29
28
 
30
29
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
31
30
 
@@ -193259,18 +193258,26 @@ class IdeAiPrompt
193259
193258
  constructor() {
193260
193259
  }
193261
193260
 
193262
- static getDevelopActionClassification = async (userPrompt) => {
193261
+ static generatePrompt = async (path, params) => {
193263
193262
 
193264
- const response = await fetch('/prompts/meta/개발액션분류.txt').then(res => res.text());
193265
- //const response = await fetch('/prompts/meta/aaa.txt');
193266
- console.log(response);
193263
+ const template = await fetch(path).then(res => res.text());
193267
193264
 
193268
- //return await response.text();
193269
- //console.log(result);
193265
+ return await new PromptTemplate({
193266
+ template,
193267
+ inputVariables: Object.keys(params),
193268
+ }).format(params);
193269
+ };
193270
193270
 
193271
+ static getDevelopActionClassification = async (userPrompt) => {
193271
193272
 
193272
- return response;
193273
+ const template = await fetch('/prompts/meta/개발액션분류.txt').then(res => res.text());
193273
193274
 
193275
+ return await new PromptTemplate({
193276
+ template,
193277
+ inputVariables: ['userPrompt'],
193278
+ }).format({
193279
+ userPrompt: userPrompt,
193280
+ });
193274
193281
  };
193275
193282
  }
193276
193283
 
@@ -193422,13 +193429,12 @@ class IdeAi
193422
193429
 
193423
193430
  generateSourceClient = async (userPrompt) => {
193424
193431
 
193425
- const prompt = await IdeAiPrompt.getDevelopActionClassification(userPrompt);
193426
-
193427
- console.log(prompt);
193428
-
193429
193432
  const systemMessage = "You are a helpful assistant.";
193433
+ const prompt = await IdeAiPrompt.generatePrompt('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
193430
193434
 
193435
+ //const prompt = await IdeAiPrompt.getDevelopActionClassification(userPrompt);
193431
193436
 
193437
+ console.log(prompt);
193432
193438
 
193433
193439
  const response = await this.#model.invoke([
193434
193440
  new SystemMessage(systemMessage),
@@ -193510,6 +193516,7 @@ class IdeAssi extends HTMLElement
193510
193516
 
193511
193517
  switch (this.settings.server) {
193512
193518
  case "gemini":
193519
+ console.log(this.settings);
193513
193520
  console.log(this.settings.geminiApiKey);
193514
193521
  this.#model = new ChatGoogleGenerativeAI({ model: this.settings.model, apiKey: this.settings.geminiApiKey, temperature: 0,});
193515
193522
  break;
@@ -150,13 +150,12 @@ export class IdeAi
150
150
 
151
151
  generateSourceClient = async (userPrompt) => {
152
152
 
153
- const prompt = await IdeAiPrompt.getDevelopActionClassification(userPrompt);
154
-
155
- console.log(prompt);
156
-
157
153
  const systemMessage = "You are a helpful assistant.";
154
+ const prompt = await IdeAiPrompt.generatePrompt('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
158
155
 
156
+ //const prompt = await IdeAiPrompt.getDevelopActionClassification(userPrompt);
159
157
 
158
+ console.log(prompt);
160
159
 
161
160
  const response = await this.#model.invoke([
162
161
  new SystemMessage(systemMessage),
@@ -1,4 +1,3 @@
1
- import fs from 'fs/promises';
2
1
  import { PromptTemplate } from '@langchain/core/prompts';
3
2
 
4
3
  export class IdeAiPrompt
@@ -6,33 +5,26 @@ export class IdeAiPrompt
6
5
  constructor() {
7
6
  }
8
7
 
9
- static getDevelopActionClassification = async (userPrompt) => {
10
-
11
- const response = await fetch('/prompts/meta/개발액션분류.txt').then(res => res.text());
12
- //const response = await fetch('/prompts/meta/aaa.txt');
13
- console.log(response);
8
+ static generatePrompt = async (path, params) => {
14
9
 
15
- //return await response.text();
16
- //console.log(result);
10
+ const template = await fetch(path).then(res => res.text());
17
11
 
12
+ return await new PromptTemplate({
13
+ template,
14
+ inputVariables: Object.keys(params),
15
+ }).format(params);
16
+ };
18
17
 
19
- return response;
18
+ static getDevelopActionClassification = async (userPrompt) => {
20
19
 
21
- const template = await fs.readFile('prompts/meta/개발액션분류.txt', 'utf-8');
20
+ const template = await fetch('/prompts/meta/개발액션분류.txt').then(res => res.text());
22
21
 
23
- const prompt = new PromptTemplate({
22
+ return await new PromptTemplate({
24
23
  template,
25
24
  inputVariables: ['userPrompt'],
26
- });
27
-
28
- console.log(prompt);
29
-
30
- const formattedPrompt = await prompt.format({
25
+ }).format({
31
26
  userPrompt: userPrompt,
32
27
  });
33
-
34
- return formattedPrompt;
35
-
36
28
  };
37
29
  }
38
30
 
@@ -74,6 +74,7 @@ export class IdeAssi extends HTMLElement
74
74
 
75
75
  switch (this.settings.server) {
76
76
  case "gemini":
77
+ console.log(this.settings);
77
78
  console.log(this.settings.geminiApiKey);
78
79
  this.#model = new ChatGoogleGenerativeAI({ model: this.settings.model, apiKey: this.settings.geminiApiKey, temperature: 0,});
79
80
  break;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.78.0",
4
+ "version": "0.80.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -150,13 +150,12 @@ export class IdeAi
150
150
 
151
151
  generateSourceClient = async (userPrompt) => {
152
152
 
153
- const prompt = await IdeAiPrompt.getDevelopActionClassification(userPrompt);
154
-
155
- console.log(prompt);
156
-
157
153
  const systemMessage = "You are a helpful assistant.";
154
+ const prompt = await IdeAiPrompt.generatePrompt('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
158
155
 
156
+ //const prompt = await IdeAiPrompt.getDevelopActionClassification(userPrompt);
159
157
 
158
+ console.log(prompt);
160
159
 
161
160
  const response = await this.#model.invoke([
162
161
  new SystemMessage(systemMessage),
@@ -1,4 +1,3 @@
1
- import fs from 'fs/promises';
2
1
  import { PromptTemplate } from '@langchain/core/prompts';
3
2
 
4
3
  export class IdeAiPrompt
@@ -6,33 +5,26 @@ export class IdeAiPrompt
6
5
  constructor() {
7
6
  }
8
7
 
9
- static getDevelopActionClassification = async (userPrompt) => {
10
-
11
- const response = await fetch('/prompts/meta/개발액션분류.txt').then(res => res.text());
12
- //const response = await fetch('/prompts/meta/aaa.txt');
13
- console.log(response);
8
+ static generatePrompt = async (path, params) => {
14
9
 
15
- //return await response.text();
16
- //console.log(result);
10
+ const template = await fetch(path).then(res => res.text());
17
11
 
12
+ return await new PromptTemplate({
13
+ template,
14
+ inputVariables: Object.keys(params),
15
+ }).format(params);
16
+ };
18
17
 
19
- return response;
18
+ static getDevelopActionClassification = async (userPrompt) => {
20
19
 
21
- const template = await fs.readFile('prompts/meta/개발액션분류.txt', 'utf-8');
20
+ const template = await fetch('/prompts/meta/개발액션분류.txt').then(res => res.text());
22
21
 
23
- const prompt = new PromptTemplate({
22
+ return await new PromptTemplate({
24
23
  template,
25
24
  inputVariables: ['userPrompt'],
26
- });
27
-
28
- console.log(prompt);
29
-
30
- const formattedPrompt = await prompt.format({
25
+ }).format({
31
26
  userPrompt: userPrompt,
32
27
  });
33
-
34
- return formattedPrompt;
35
-
36
28
  };
37
29
  }
38
30
 
@@ -74,6 +74,7 @@ export class IdeAssi extends HTMLElement
74
74
 
75
75
  switch (this.settings.server) {
76
76
  case "gemini":
77
+ console.log(this.settings);
77
78
  console.log(this.settings.geminiApiKey);
78
79
  this.#model = new ChatGoogleGenerativeAI({ model: this.settings.model, apiKey: this.settings.geminiApiKey, temperature: 0,});
79
80
  break;