ninegrid2 6.516.0 → 6.518.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/ai/aiContainer.js +9 -2
- package/dist/ai/aiSettings.js +8 -0
- package/dist/bundle.cjs.js +26414 -166
- package/dist/bundle.esm.js +26414 -166
- package/package.json +1 -1
- package/src/ai/aiContainer.js +9 -2
- package/src/ai/aiSettings.js +8 -0
package/dist/ai/aiContainer.js
CHANGED
|
@@ -4,12 +4,14 @@ import { Ollama } from "@langchain/ollama";
|
|
|
4
4
|
import { ChatOpenAI } from '@langchain/openai';
|
|
5
5
|
import { HumanMessage, SystemMessage } from '@langchain/core/messages';
|
|
6
6
|
import { OllamaEmbeddings } from "@langchain/ollama";
|
|
7
|
+
import { QdrantClient } from "@qdrant/js-client-rest";
|
|
7
8
|
|
|
8
9
|
class aiContainer extends HTMLElement
|
|
9
10
|
{
|
|
10
11
|
#target;
|
|
11
12
|
#ing = false;
|
|
12
13
|
#model;
|
|
14
|
+
#qdrantClient;
|
|
13
15
|
//#elChat;
|
|
14
16
|
|
|
15
17
|
#geminiApiKey = "";
|
|
@@ -83,6 +85,8 @@ class aiContainer extends HTMLElement
|
|
|
83
85
|
this.#model = new Ollama({ model: elSettings.model });
|
|
84
86
|
break;
|
|
85
87
|
}
|
|
88
|
+
|
|
89
|
+
this.#qdrantClient = new QdrantClient({ url: elSettings.qdrantUrl });
|
|
86
90
|
};
|
|
87
91
|
|
|
88
92
|
#getColumnInfo = () => {
|
|
@@ -140,6 +144,8 @@ class aiContainer extends HTMLElement
|
|
|
140
144
|
new HumanMessage(prompt),
|
|
141
145
|
]);
|
|
142
146
|
|
|
147
|
+
console.log(response);
|
|
148
|
+
|
|
143
149
|
let filterString = response.content.trim();
|
|
144
150
|
if (filterString.startsWith("```json")) {
|
|
145
151
|
filterString = filterString.replace("```json", "");
|
|
@@ -173,7 +179,7 @@ class aiContainer extends HTMLElement
|
|
|
173
179
|
#searchWithQdrantFilter = async (filter) => {
|
|
174
180
|
|
|
175
181
|
const queryText = this.shadowRoot.querySelector("textarea").value.trim();
|
|
176
|
-
const collectionName = this.#target.collectionName
|
|
182
|
+
const collectionName = this.#target.collectionName;
|
|
177
183
|
|
|
178
184
|
//try {
|
|
179
185
|
// 쿼리 텍스트를 임베딩으로 변환 (Gemini Embedding 모델 사용)
|
|
@@ -202,7 +208,7 @@ class aiContainer extends HTMLElement
|
|
|
202
208
|
|
|
203
209
|
//console.log("Qdrant Search Params:", JSON.stringify(searchParams, null, 2));
|
|
204
210
|
|
|
205
|
-
return await qdrantClient.search(collectionName, searchParams);
|
|
211
|
+
return await this.#qdrantClient.search(collectionName, searchParams);
|
|
206
212
|
|
|
207
213
|
//} catch (error) {
|
|
208
214
|
// console.error("Error during Qdrant search:", error);
|
|
@@ -264,6 +270,7 @@ class aiContainer extends HTMLElement
|
|
|
264
270
|
|
|
265
271
|
const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
|
|
266
272
|
|
|
273
|
+
|
|
267
274
|
elAiChat.add("me", question);
|
|
268
275
|
elAiChat.add("ing", question);
|
|
269
276
|
|
package/dist/ai/aiSettings.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
class aiSettings extends HTMLElement
|
|
4
4
|
{
|
|
5
|
+
#qdrantUrl;
|
|
6
|
+
|
|
5
7
|
EVENT = {
|
|
6
8
|
MODEL_CHANGE : "model_change",
|
|
7
9
|
};
|
|
@@ -45,6 +47,9 @@ class aiSettings extends HTMLElement
|
|
|
45
47
|
})); */
|
|
46
48
|
};
|
|
47
49
|
|
|
50
|
+
get qdrantUrl() { return this.#qdrantUrl || "http://localhost:6333"; };
|
|
51
|
+
set qdrantUrl(v) { this.shadowRoot.querySelector("#qdrantUrl").value = this.#qdrantUrl = v; };
|
|
52
|
+
|
|
48
53
|
|
|
49
54
|
|
|
50
55
|
connectedCallback() {
|
|
@@ -131,6 +136,9 @@ class aiSettings extends HTMLElement
|
|
|
131
136
|
</select>
|
|
132
137
|
</label>
|
|
133
138
|
</div>
|
|
139
|
+
<div class="line qdrant">
|
|
140
|
+
<label>Url: <input id="qdrantUrl" value="${this.qdrantUrl}"/></label>
|
|
141
|
+
</div>
|
|
134
142
|
`;
|
|
135
143
|
|
|
136
144
|
this.#init();
|