ninegrid2 6.517.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.
@@ -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 = () => {
@@ -204,7 +208,7 @@ class aiContainer extends HTMLElement
204
208
 
205
209
  //console.log("Qdrant Search Params:", JSON.stringify(searchParams, null, 2));
206
210
 
207
- return await qdrantClient.search(collectionName, searchParams);
211
+ return await this.#qdrantClient.search(collectionName, searchParams);
208
212
 
209
213
  //} catch (error) {
210
214
  // console.error("Error during Qdrant search:", error);
@@ -266,6 +270,7 @@ class aiContainer extends HTMLElement
266
270
 
267
271
  const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
268
272
 
273
+
269
274
  elAiChat.add("me", question);
270
275
  elAiChat.add("ing", question);
271
276
 
@@ -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();