ide-assi 0.62.0 → 0.64.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 +13 -35
- package/dist/bundle.esm.js +13 -35
- package/dist/components/ideAi.js +4 -54
- package/dist/components/ideAiPrompt.js +4 -0
- package/package.json +1 -1
- package/src/components/ideAi.js +4 -54
- package/src/components/ideAiPrompt.js +4 -0
package/dist/bundle.cjs.js
CHANGED
|
@@ -29,7 +29,7 @@ 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
|
-
|
|
32
|
+
require('fs/promises');
|
|
33
33
|
|
|
34
34
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
35
35
|
|
|
@@ -193265,20 +193265,9 @@ class IdeAiPrompt
|
|
|
193265
193265
|
|
|
193266
193266
|
static getDevelopActionClassification = async (userPrompt) => {
|
|
193267
193267
|
|
|
193268
|
-
const
|
|
193268
|
+
const t = await fetch('prompts/meta/개발액션분류.txt').then(res => res.text());
|
|
193269
193269
|
|
|
193270
|
-
|
|
193271
|
-
template,
|
|
193272
|
-
inputVariables: ['userPrompt'],
|
|
193273
|
-
});
|
|
193274
|
-
|
|
193275
|
-
console.log(prompt);
|
|
193276
|
-
|
|
193277
|
-
const formattedPrompt = await prompt.format({
|
|
193278
|
-
userPrompt: userPrompt,
|
|
193279
|
-
});
|
|
193280
|
-
|
|
193281
|
-
return formattedPrompt;
|
|
193270
|
+
return t;
|
|
193282
193271
|
|
|
193283
193272
|
};
|
|
193284
193273
|
}
|
|
@@ -193431,32 +193420,21 @@ class IdeAi
|
|
|
193431
193420
|
|
|
193432
193421
|
generateSourceClient = async (userPrompt) => {
|
|
193433
193422
|
|
|
193434
|
-
const
|
|
193423
|
+
const prompt = await IdeAiPrompt.getDevelopActionClassification(userPrompt);
|
|
193435
193424
|
|
|
193436
|
-
console.log(
|
|
193425
|
+
console.log(prompt);
|
|
193437
193426
|
|
|
193438
|
-
|
|
193427
|
+
const systemMessage = "You are a helpful assistant.";
|
|
193439
193428
|
|
|
193440
|
-
/**
|
|
193441
|
-
let filterString;
|
|
193442
|
-
switch (this.settings.server) {
|
|
193443
|
-
case "openai":
|
|
193444
|
-
filterString = this.#extractJsonSnippet(response.content.trim());
|
|
193445
|
-
break;
|
|
193446
|
-
case "gemini":
|
|
193447
|
-
filterString = this.#extractJsonSnippet(response.content.trim());
|
|
193448
|
-
break;
|
|
193449
|
-
case "ollama":
|
|
193450
|
-
filterString = this.#extractJsonSnippet(response);
|
|
193451
|
-
break;
|
|
193452
|
-
default:
|
|
193453
|
-
break;
|
|
193454
|
-
}
|
|
193455
193429
|
|
|
193456
|
-
//console.log(filterString);
|
|
193457
193430
|
|
|
193458
|
-
|
|
193459
|
-
|
|
193431
|
+
const response = await this.#model.invoke([
|
|
193432
|
+
new SystemMessage(systemMessage),
|
|
193433
|
+
new HumanMessage(prompt),
|
|
193434
|
+
]);
|
|
193435
|
+
|
|
193436
|
+
console.log(response);
|
|
193437
|
+
|
|
193460
193438
|
}
|
|
193461
193439
|
}
|
|
193462
193440
|
|
package/dist/bundle.esm.js
CHANGED
|
@@ -25,7 +25,7 @@ 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
|
|
28
|
+
import 'fs/promises';
|
|
29
29
|
|
|
30
30
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
31
31
|
|
|
@@ -193261,20 +193261,9 @@ class IdeAiPrompt
|
|
|
193261
193261
|
|
|
193262
193262
|
static getDevelopActionClassification = async (userPrompt) => {
|
|
193263
193263
|
|
|
193264
|
-
const
|
|
193264
|
+
const t = await fetch('prompts/meta/개발액션분류.txt').then(res => res.text());
|
|
193265
193265
|
|
|
193266
|
-
|
|
193267
|
-
template,
|
|
193268
|
-
inputVariables: ['userPrompt'],
|
|
193269
|
-
});
|
|
193270
|
-
|
|
193271
|
-
console.log(prompt);
|
|
193272
|
-
|
|
193273
|
-
const formattedPrompt = await prompt.format({
|
|
193274
|
-
userPrompt: userPrompt,
|
|
193275
|
-
});
|
|
193276
|
-
|
|
193277
|
-
return formattedPrompt;
|
|
193266
|
+
return t;
|
|
193278
193267
|
|
|
193279
193268
|
};
|
|
193280
193269
|
}
|
|
@@ -193427,32 +193416,21 @@ class IdeAi
|
|
|
193427
193416
|
|
|
193428
193417
|
generateSourceClient = async (userPrompt) => {
|
|
193429
193418
|
|
|
193430
|
-
const
|
|
193419
|
+
const prompt = await IdeAiPrompt.getDevelopActionClassification(userPrompt);
|
|
193431
193420
|
|
|
193432
|
-
console.log(
|
|
193421
|
+
console.log(prompt);
|
|
193433
193422
|
|
|
193434
|
-
|
|
193423
|
+
const systemMessage = "You are a helpful assistant.";
|
|
193435
193424
|
|
|
193436
|
-
/**
|
|
193437
|
-
let filterString;
|
|
193438
|
-
switch (this.settings.server) {
|
|
193439
|
-
case "openai":
|
|
193440
|
-
filterString = this.#extractJsonSnippet(response.content.trim());
|
|
193441
|
-
break;
|
|
193442
|
-
case "gemini":
|
|
193443
|
-
filterString = this.#extractJsonSnippet(response.content.trim());
|
|
193444
|
-
break;
|
|
193445
|
-
case "ollama":
|
|
193446
|
-
filterString = this.#extractJsonSnippet(response);
|
|
193447
|
-
break;
|
|
193448
|
-
default:
|
|
193449
|
-
break;
|
|
193450
|
-
}
|
|
193451
193425
|
|
|
193452
|
-
//console.log(filterString);
|
|
193453
193426
|
|
|
193454
|
-
|
|
193455
|
-
|
|
193427
|
+
const response = await this.#model.invoke([
|
|
193428
|
+
new SystemMessage(systemMessage),
|
|
193429
|
+
new HumanMessage(prompt),
|
|
193430
|
+
]);
|
|
193431
|
+
|
|
193432
|
+
console.log(response);
|
|
193433
|
+
|
|
193456
193434
|
}
|
|
193457
193435
|
}
|
|
193458
193436
|
|
package/dist/components/ideAi.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import ninegrid from "ninegrid2";
|
|
2
2
|
import {IdeAiPrompt} from "./ideAiPrompt.js";
|
|
3
|
+
import { HumanMessage, SystemMessage } from '@langchain/core/messages';
|
|
3
4
|
|
|
4
5
|
export class IdeAi
|
|
5
6
|
{
|
|
@@ -149,43 +150,12 @@ export class IdeAi
|
|
|
149
150
|
|
|
150
151
|
generateSourceClient = async (userPrompt) => {
|
|
151
152
|
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
console.log(a);
|
|
155
|
-
|
|
156
|
-
return;
|
|
153
|
+
const prompt = await IdeAiPrompt.getDevelopActionClassification(userPrompt);
|
|
157
154
|
|
|
155
|
+
console.log(prompt);
|
|
158
156
|
|
|
159
157
|
const systemMessage = "You are a helpful assistant.";
|
|
160
|
-
|
|
161
|
-
자연어 쿼리를 Qdrant 필터 JSON 객체로 변환하는 AI 비서입니다.
|
|
162
|
-
|
|
163
|
-
Qdrant 컬렉션에서 사용 가능한 메타데이터 필드와 유형은 다음과 같습니다.:
|
|
164
|
-
${this.#getColumnInfoString()}
|
|
165
|
-
|
|
166
|
-
필터 생성 규칙:
|
|
167
|
-
1. 위에 제공된 필드만 사용하십시오. 새로운 필드를 만들지 마십시오.
|
|
168
|
-
2. 조건이 명확하게 지정되지 않았거나 모호한 경우 필터에 포함하지 마십시오.
|
|
169
|
-
3. AND 조건에는 'must', OR 조건에는 'should', NOT 조건에는 'must_not'을 사용하십시오.
|
|
170
|
-
4. 문자열 일치에는 'match.text'를 사용하십시오.
|
|
171
|
-
5. 날짜 조건은 'YYYY-MM-DD' 형식으로 변형해서 사용하십시요. 오늘날짜는 ${this.#getToday()} 입니다.
|
|
172
|
-
6. 숫자 범위에는 'range.gte', 'range.lte', 'range.gt', 'range.lt'를 사용하십시오.
|
|
173
|
-
7. 특정 값을 포함하는 배열에는 'contains', 'match.any' 또는 'match.all'을 사용하십시오.
|
|
174
|
-
8. 출력은 Qdrant 필터를 나타내는 유효한 JSON 객체여야 합니다.
|
|
175
|
-
9. 적용 가능한 필터가 없는 경우 빈 JSON 객체인 {}를 반환합니다.
|
|
176
|
-
|
|
177
|
-
예:
|
|
178
|
-
- "500달러 미만의 전자제품 찾기" -> {"must": [{"key": "category", "match": {"text": "electronics"}}, {"key": "price", "range": {"lt": 500}}]}
|
|
179
|
-
- "John Doe 또는 Jane Smith의 책 보기" -> {"should": [{"key": "author", "match": {"text": "John Doe"}}, {"key": "author", "match": {"text": "Jane Smith"}}]}
|
|
180
|
-
- "재고 있는 품목(의류 제외)" -> {"must": [{"key": "in_stock", "match": {"text": true}}], "must_not": [{"key": "category", "match": {"text": "clothing"}}]}
|
|
181
|
-
- "다음이 포함된 제품 'new_arrival' 태그" -> {"must": [{"key": "tags", "match": {"text": "new_arrival"}}]}
|
|
182
|
-
- "2020년 이후 출판된 도서" -> {"must": [{"key": "published_year", "range": {"gt": 2020}}]}
|
|
183
|
-
|
|
184
|
-
이제 다음 사용자 쿼리를 변환해 보겠습니다.
|
|
185
|
-
사용자 쿼리: "${userInput}"
|
|
186
|
-
|
|
187
|
-
Qdrant 필터 JSON:
|
|
188
|
-
`;
|
|
158
|
+
|
|
189
159
|
|
|
190
160
|
|
|
191
161
|
const response = await this.#model.invoke([
|
|
@@ -195,26 +165,6 @@ export class IdeAi
|
|
|
195
165
|
|
|
196
166
|
console.log(response);
|
|
197
167
|
|
|
198
|
-
/**
|
|
199
|
-
let filterString;
|
|
200
|
-
switch (this.settings.server) {
|
|
201
|
-
case "openai":
|
|
202
|
-
filterString = this.#extractJsonSnippet(response.content.trim());
|
|
203
|
-
break;
|
|
204
|
-
case "gemini":
|
|
205
|
-
filterString = this.#extractJsonSnippet(response.content.trim());
|
|
206
|
-
break;
|
|
207
|
-
case "ollama":
|
|
208
|
-
filterString = this.#extractJsonSnippet(response);
|
|
209
|
-
break;
|
|
210
|
-
default:
|
|
211
|
-
break;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
//console.log(filterString);
|
|
215
|
-
|
|
216
|
-
return JSON.parse(filterString);
|
|
217
|
-
*/
|
|
218
168
|
}
|
|
219
169
|
}
|
|
220
170
|
|
|
@@ -8,6 +8,10 @@ export class IdeAiPrompt
|
|
|
8
8
|
|
|
9
9
|
static getDevelopActionClassification = async (userPrompt) => {
|
|
10
10
|
|
|
11
|
+
const t = await fetch('prompts/meta/개발액션분류.txt').then(res => res.text());
|
|
12
|
+
|
|
13
|
+
return t;
|
|
14
|
+
|
|
11
15
|
const template = await fs.readFile('prompts/meta/개발액션분류.txt', 'utf-8');
|
|
12
16
|
|
|
13
17
|
const prompt = new PromptTemplate({
|
package/package.json
CHANGED
package/src/components/ideAi.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import ninegrid from "ninegrid2";
|
|
2
2
|
import {IdeAiPrompt} from "./ideAiPrompt.js";
|
|
3
|
+
import { HumanMessage, SystemMessage } from '@langchain/core/messages';
|
|
3
4
|
|
|
4
5
|
export class IdeAi
|
|
5
6
|
{
|
|
@@ -149,43 +150,12 @@ export class IdeAi
|
|
|
149
150
|
|
|
150
151
|
generateSourceClient = async (userPrompt) => {
|
|
151
152
|
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
console.log(a);
|
|
155
|
-
|
|
156
|
-
return;
|
|
153
|
+
const prompt = await IdeAiPrompt.getDevelopActionClassification(userPrompt);
|
|
157
154
|
|
|
155
|
+
console.log(prompt);
|
|
158
156
|
|
|
159
157
|
const systemMessage = "You are a helpful assistant.";
|
|
160
|
-
|
|
161
|
-
자연어 쿼리를 Qdrant 필터 JSON 객체로 변환하는 AI 비서입니다.
|
|
162
|
-
|
|
163
|
-
Qdrant 컬렉션에서 사용 가능한 메타데이터 필드와 유형은 다음과 같습니다.:
|
|
164
|
-
${this.#getColumnInfoString()}
|
|
165
|
-
|
|
166
|
-
필터 생성 규칙:
|
|
167
|
-
1. 위에 제공된 필드만 사용하십시오. 새로운 필드를 만들지 마십시오.
|
|
168
|
-
2. 조건이 명확하게 지정되지 않았거나 모호한 경우 필터에 포함하지 마십시오.
|
|
169
|
-
3. AND 조건에는 'must', OR 조건에는 'should', NOT 조건에는 'must_not'을 사용하십시오.
|
|
170
|
-
4. 문자열 일치에는 'match.text'를 사용하십시오.
|
|
171
|
-
5. 날짜 조건은 'YYYY-MM-DD' 형식으로 변형해서 사용하십시요. 오늘날짜는 ${this.#getToday()} 입니다.
|
|
172
|
-
6. 숫자 범위에는 'range.gte', 'range.lte', 'range.gt', 'range.lt'를 사용하십시오.
|
|
173
|
-
7. 특정 값을 포함하는 배열에는 'contains', 'match.any' 또는 'match.all'을 사용하십시오.
|
|
174
|
-
8. 출력은 Qdrant 필터를 나타내는 유효한 JSON 객체여야 합니다.
|
|
175
|
-
9. 적용 가능한 필터가 없는 경우 빈 JSON 객체인 {}를 반환합니다.
|
|
176
|
-
|
|
177
|
-
예:
|
|
178
|
-
- "500달러 미만의 전자제품 찾기" -> {"must": [{"key": "category", "match": {"text": "electronics"}}, {"key": "price", "range": {"lt": 500}}]}
|
|
179
|
-
- "John Doe 또는 Jane Smith의 책 보기" -> {"should": [{"key": "author", "match": {"text": "John Doe"}}, {"key": "author", "match": {"text": "Jane Smith"}}]}
|
|
180
|
-
- "재고 있는 품목(의류 제외)" -> {"must": [{"key": "in_stock", "match": {"text": true}}], "must_not": [{"key": "category", "match": {"text": "clothing"}}]}
|
|
181
|
-
- "다음이 포함된 제품 'new_arrival' 태그" -> {"must": [{"key": "tags", "match": {"text": "new_arrival"}}]}
|
|
182
|
-
- "2020년 이후 출판된 도서" -> {"must": [{"key": "published_year", "range": {"gt": 2020}}]}
|
|
183
|
-
|
|
184
|
-
이제 다음 사용자 쿼리를 변환해 보겠습니다.
|
|
185
|
-
사용자 쿼리: "${userInput}"
|
|
186
|
-
|
|
187
|
-
Qdrant 필터 JSON:
|
|
188
|
-
`;
|
|
158
|
+
|
|
189
159
|
|
|
190
160
|
|
|
191
161
|
const response = await this.#model.invoke([
|
|
@@ -195,26 +165,6 @@ export class IdeAi
|
|
|
195
165
|
|
|
196
166
|
console.log(response);
|
|
197
167
|
|
|
198
|
-
/**
|
|
199
|
-
let filterString;
|
|
200
|
-
switch (this.settings.server) {
|
|
201
|
-
case "openai":
|
|
202
|
-
filterString = this.#extractJsonSnippet(response.content.trim());
|
|
203
|
-
break;
|
|
204
|
-
case "gemini":
|
|
205
|
-
filterString = this.#extractJsonSnippet(response.content.trim());
|
|
206
|
-
break;
|
|
207
|
-
case "ollama":
|
|
208
|
-
filterString = this.#extractJsonSnippet(response);
|
|
209
|
-
break;
|
|
210
|
-
default:
|
|
211
|
-
break;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
//console.log(filterString);
|
|
215
|
-
|
|
216
|
-
return JSON.parse(filterString);
|
|
217
|
-
*/
|
|
218
168
|
}
|
|
219
169
|
}
|
|
220
170
|
|
|
@@ -8,6 +8,10 @@ export class IdeAiPrompt
|
|
|
8
8
|
|
|
9
9
|
static getDevelopActionClassification = async (userPrompt) => {
|
|
10
10
|
|
|
11
|
+
const t = await fetch('prompts/meta/개발액션분류.txt').then(res => res.text());
|
|
12
|
+
|
|
13
|
+
return t;
|
|
14
|
+
|
|
11
15
|
const template = await fs.readFile('prompts/meta/개발액션분류.txt', 'utf-8');
|
|
12
16
|
|
|
13
17
|
const prompt = new PromptTemplate({
|