ninegrid2 6.513.0 → 6.516.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 +58 -10
- package/dist/bundle.cjs.js +53 -10
- package/dist/bundle.esm.js +54 -11
- package/package.json +1 -1
- package/src/ai/aiContainer.js +58 -10
package/dist/ai/aiContainer.js
CHANGED
|
@@ -3,6 +3,7 @@ import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
|
|
|
3
3
|
import { Ollama } from "@langchain/ollama";
|
|
4
4
|
import { ChatOpenAI } from '@langchain/openai';
|
|
5
5
|
import { HumanMessage, SystemMessage } from '@langchain/core/messages';
|
|
6
|
+
import { OllamaEmbeddings } from "@langchain/ollama";
|
|
6
7
|
|
|
7
8
|
class aiContainer extends HTMLElement
|
|
8
9
|
{
|
|
@@ -150,13 +151,12 @@ class aiContainer extends HTMLElement
|
|
|
150
151
|
}
|
|
151
152
|
//filterString = filterString.replaceAll('"value"', '"text"')
|
|
152
153
|
console.log("Generated Filter String:", filterString);
|
|
153
|
-
|
|
154
|
+
|
|
154
155
|
// Gemini가 JSON 모드나 Structured Output을 지원하지 않는 경우, 직접 파싱 시도
|
|
155
156
|
// 안정적인 JSON 파싱을 위해 'JSON Mode' 또는 Function Calling 사용을 강력히 권장
|
|
156
157
|
// LangChain의 SelfQueryRetriever를 사용하면 이 부분을 자동화할 수 있습니다.
|
|
157
158
|
//try {
|
|
158
|
-
|
|
159
|
-
return a;
|
|
159
|
+
return JSON.parse(filterString);
|
|
160
160
|
//} catch (parseError) {
|
|
161
161
|
// console.error("Failed to parse filter string as JSON:", parseError);
|
|
162
162
|
// console.error("String that failed to parse:", filterString);
|
|
@@ -170,16 +170,62 @@ filterString = "a" + filterString;
|
|
|
170
170
|
//}
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
+
#searchWithQdrantFilter = async (filter) => {
|
|
174
|
+
|
|
175
|
+
const queryText = this.shadowRoot.querySelector("textarea").value.trim();
|
|
176
|
+
const collectionName = this.#target.collectionName.trim();
|
|
177
|
+
|
|
178
|
+
//try {
|
|
179
|
+
// 쿼리 텍스트를 임베딩으로 변환 (Gemini Embedding 모델 사용)
|
|
180
|
+
// LangChain의 Embeddings 클래스 또는 @google/generative-ai SDK 직접 사용 가능
|
|
181
|
+
// 여기서는 예시를 위해 임시로 더미 벡터를 사용합니다.
|
|
182
|
+
// 실제로는 GoogleGenerativeAI.embedContent 등을 사용해야 합니다.
|
|
183
|
+
// const genAI = new GoogleGenerativeAI(GEMINI_API_KEY);
|
|
184
|
+
// const embeddingModel = genAI.get GenerativeModel({ model: "embedding-001" });
|
|
185
|
+
// const { embedding } = await embeddingModel.embedContent({
|
|
186
|
+
// content: queryText,
|
|
187
|
+
// taskType: "retrieval_query",
|
|
188
|
+
// });
|
|
189
|
+
//const queryVector = [0.1, 0.2, 0.3, 0.4, ...Array(764).fill(0)]; // 실제 임베딩 벡터로 대체
|
|
190
|
+
const embeddings = new OllamaEmbeddings({ model: "nomic-embed-text" });
|
|
191
|
+
const queryVector = await embeddings.embedQuery(queryText);
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
console.log(collectionName, filter);
|
|
195
|
+
|
|
196
|
+
const searchParams = {
|
|
197
|
+
vector: queryVector,
|
|
198
|
+
limit: 500, // 검색 결과 수
|
|
199
|
+
filter: filter, // Gemini가 생성한 필터 적용
|
|
200
|
+
with_payload: true, // 페이로드도 함께 가져오도록 설정
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
//console.log("Qdrant Search Params:", JSON.stringify(searchParams, null, 2));
|
|
204
|
+
|
|
205
|
+
return await qdrantClient.search(collectionName, searchParams);
|
|
206
|
+
|
|
207
|
+
//} catch (error) {
|
|
208
|
+
// console.error("Error during Qdrant search:", error);
|
|
209
|
+
return [];
|
|
210
|
+
//}
|
|
211
|
+
}
|
|
212
|
+
|
|
173
213
|
#q1 = async () => {
|
|
174
|
-
await this.#generateQdrantFilter();
|
|
214
|
+
const filter = await this.#generateQdrantFilter();
|
|
215
|
+
const d = await this.#searchWithQdrantFilter(filter);
|
|
216
|
+
console.log(d);
|
|
175
217
|
};
|
|
176
218
|
|
|
177
219
|
#q2 = async () => {
|
|
178
|
-
await this.#generateQdrantFilter();
|
|
220
|
+
const filter = await this.#generateQdrantFilter();
|
|
221
|
+
const d = await this.#searchWithQdrantFilter(filter);
|
|
222
|
+
console.log(d);
|
|
179
223
|
};
|
|
180
224
|
|
|
181
225
|
#q3 = async () => {
|
|
182
|
-
await this.#generateQdrantFilter();
|
|
226
|
+
const filter = await this.#generateQdrantFilter();
|
|
227
|
+
const d = await this.#searchWithQdrantFilter(filter);
|
|
228
|
+
console.log(d);
|
|
183
229
|
};
|
|
184
230
|
|
|
185
231
|
#init = (info) => {
|
|
@@ -216,8 +262,10 @@ filterString = "a" + filterString;
|
|
|
216
262
|
e.target.value = "";
|
|
217
263
|
});
|
|
218
264
|
|
|
219
|
-
this.shadowRoot.querySelector("nx-ai-chat")
|
|
220
|
-
|
|
265
|
+
const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
|
|
266
|
+
|
|
267
|
+
elAiChat.add("me", question);
|
|
268
|
+
elAiChat.add("ing", question);
|
|
221
269
|
|
|
222
270
|
try {
|
|
223
271
|
this.#createModel();
|
|
@@ -232,8 +280,8 @@ filterString = "a" + filterString;
|
|
|
232
280
|
await this.#q3();
|
|
233
281
|
}
|
|
234
282
|
} catch (error) {
|
|
235
|
-
console.error("Error generating Qdrant filter:", error);
|
|
236
|
-
|
|
283
|
+
//console.error("Error generating Qdrant filter:", error);
|
|
284
|
+
elAiChat.add("ai", error);
|
|
237
285
|
}
|
|
238
286
|
|
|
239
287
|
|
package/dist/bundle.cjs.js
CHANGED
|
@@ -28004,13 +28004,12 @@ class aiContainer extends HTMLElement
|
|
|
28004
28004
|
}
|
|
28005
28005
|
//filterString = filterString.replaceAll('"value"', '"text"')
|
|
28006
28006
|
console.log("Generated Filter String:", filterString);
|
|
28007
|
-
|
|
28007
|
+
|
|
28008
28008
|
// Gemini가 JSON 모드나 Structured Output을 지원하지 않는 경우, 직접 파싱 시도
|
|
28009
28009
|
// 안정적인 JSON 파싱을 위해 'JSON Mode' 또는 Function Calling 사용을 강력히 권장
|
|
28010
28010
|
// LangChain의 SelfQueryRetriever를 사용하면 이 부분을 자동화할 수 있습니다.
|
|
28011
28011
|
//try {
|
|
28012
|
-
|
|
28013
|
-
return a;
|
|
28012
|
+
return JSON.parse(filterString);
|
|
28014
28013
|
//} catch (parseError) {
|
|
28015
28014
|
// console.error("Failed to parse filter string as JSON:", parseError);
|
|
28016
28015
|
// console.error("String that failed to parse:", filterString);
|
|
@@ -28024,16 +28023,58 @@ filterString = "a" + filterString;
|
|
|
28024
28023
|
//}
|
|
28025
28024
|
}
|
|
28026
28025
|
|
|
28026
|
+
#searchWithQdrantFilter = async (filter) => {
|
|
28027
|
+
|
|
28028
|
+
const queryText = this.shadowRoot.querySelector("textarea").value.trim();
|
|
28029
|
+
const collectionName = this.#target.collectionName.trim();
|
|
28030
|
+
|
|
28031
|
+
//try {
|
|
28032
|
+
// 쿼리 텍스트를 임베딩으로 변환 (Gemini Embedding 모델 사용)
|
|
28033
|
+
// LangChain의 Embeddings 클래스 또는 @google/generative-ai SDK 직접 사용 가능
|
|
28034
|
+
// 여기서는 예시를 위해 임시로 더미 벡터를 사용합니다.
|
|
28035
|
+
// 실제로는 GoogleGenerativeAI.embedContent 등을 사용해야 합니다.
|
|
28036
|
+
// const genAI = new GoogleGenerativeAI(GEMINI_API_KEY);
|
|
28037
|
+
// const embeddingModel = genAI.get GenerativeModel({ model: "embedding-001" });
|
|
28038
|
+
// const { embedding } = await embeddingModel.embedContent({
|
|
28039
|
+
// content: queryText,
|
|
28040
|
+
// taskType: "retrieval_query",
|
|
28041
|
+
// });
|
|
28042
|
+
//const queryVector = [0.1, 0.2, 0.3, 0.4, ...Array(764).fill(0)]; // 실제 임베딩 벡터로 대체
|
|
28043
|
+
const embeddings = new ollama.OllamaEmbeddings({ model: "nomic-embed-text" });
|
|
28044
|
+
const queryVector = await embeddings.embedQuery(queryText);
|
|
28045
|
+
|
|
28046
|
+
|
|
28047
|
+
console.log(collectionName, filter);
|
|
28048
|
+
|
|
28049
|
+
const searchParams = {
|
|
28050
|
+
vector: queryVector,
|
|
28051
|
+
limit: 500, // 검색 결과 수
|
|
28052
|
+
filter: filter, // Gemini가 생성한 필터 적용
|
|
28053
|
+
with_payload: true, // 페이로드도 함께 가져오도록 설정
|
|
28054
|
+
};
|
|
28055
|
+
|
|
28056
|
+
//console.log("Qdrant Search Params:", JSON.stringify(searchParams, null, 2));
|
|
28057
|
+
|
|
28058
|
+
return await qdrantClient.search(collectionName, searchParams);
|
|
28059
|
+
//}
|
|
28060
|
+
}
|
|
28061
|
+
|
|
28027
28062
|
#q1 = async () => {
|
|
28028
|
-
await this.#generateQdrantFilter();
|
|
28063
|
+
const filter = await this.#generateQdrantFilter();
|
|
28064
|
+
const d = await this.#searchWithQdrantFilter(filter);
|
|
28065
|
+
console.log(d);
|
|
28029
28066
|
};
|
|
28030
28067
|
|
|
28031
28068
|
#q2 = async () => {
|
|
28032
|
-
await this.#generateQdrantFilter();
|
|
28069
|
+
const filter = await this.#generateQdrantFilter();
|
|
28070
|
+
const d = await this.#searchWithQdrantFilter(filter);
|
|
28071
|
+
console.log(d);
|
|
28033
28072
|
};
|
|
28034
28073
|
|
|
28035
28074
|
#q3 = async () => {
|
|
28036
|
-
await this.#generateQdrantFilter();
|
|
28075
|
+
const filter = await this.#generateQdrantFilter();
|
|
28076
|
+
const d = await this.#searchWithQdrantFilter(filter);
|
|
28077
|
+
console.log(d);
|
|
28037
28078
|
};
|
|
28038
28079
|
|
|
28039
28080
|
#init = (info) => {
|
|
@@ -28069,8 +28110,10 @@ filterString = "a" + filterString;
|
|
|
28069
28110
|
e.target.value = "";
|
|
28070
28111
|
});
|
|
28071
28112
|
|
|
28072
|
-
this.shadowRoot.querySelector("nx-ai-chat")
|
|
28073
|
-
|
|
28113
|
+
const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
|
|
28114
|
+
|
|
28115
|
+
elAiChat.add("me", question);
|
|
28116
|
+
elAiChat.add("ing", question);
|
|
28074
28117
|
|
|
28075
28118
|
try {
|
|
28076
28119
|
this.#createModel();
|
|
@@ -28085,8 +28128,8 @@ filterString = "a" + filterString;
|
|
|
28085
28128
|
await this.#q3();
|
|
28086
28129
|
}
|
|
28087
28130
|
} catch (error) {
|
|
28088
|
-
console.error("Error generating Qdrant filter:", error);
|
|
28089
|
-
|
|
28131
|
+
//console.error("Error generating Qdrant filter:", error);
|
|
28132
|
+
elAiChat.add("ai", error);
|
|
28090
28133
|
}
|
|
28091
28134
|
|
|
28092
28135
|
|
package/dist/bundle.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ExcelJS$1 from 'exceljs';
|
|
2
2
|
import { ChatGoogleGenerativeAI } from '@langchain/google-genai';
|
|
3
|
-
import { Ollama } from '@langchain/ollama';
|
|
3
|
+
import { Ollama, OllamaEmbeddings } from '@langchain/ollama';
|
|
4
4
|
import { ChatOpenAI } from '@langchain/openai';
|
|
5
5
|
import { SystemMessage, HumanMessage } from '@langchain/core/messages';
|
|
6
6
|
|
|
@@ -28002,13 +28002,12 @@ class aiContainer extends HTMLElement
|
|
|
28002
28002
|
}
|
|
28003
28003
|
//filterString = filterString.replaceAll('"value"', '"text"')
|
|
28004
28004
|
console.log("Generated Filter String:", filterString);
|
|
28005
|
-
|
|
28005
|
+
|
|
28006
28006
|
// Gemini가 JSON 모드나 Structured Output을 지원하지 않는 경우, 직접 파싱 시도
|
|
28007
28007
|
// 안정적인 JSON 파싱을 위해 'JSON Mode' 또는 Function Calling 사용을 강력히 권장
|
|
28008
28008
|
// LangChain의 SelfQueryRetriever를 사용하면 이 부분을 자동화할 수 있습니다.
|
|
28009
28009
|
//try {
|
|
28010
|
-
|
|
28011
|
-
return a;
|
|
28010
|
+
return JSON.parse(filterString);
|
|
28012
28011
|
//} catch (parseError) {
|
|
28013
28012
|
// console.error("Failed to parse filter string as JSON:", parseError);
|
|
28014
28013
|
// console.error("String that failed to parse:", filterString);
|
|
@@ -28022,16 +28021,58 @@ filterString = "a" + filterString;
|
|
|
28022
28021
|
//}
|
|
28023
28022
|
}
|
|
28024
28023
|
|
|
28024
|
+
#searchWithQdrantFilter = async (filter) => {
|
|
28025
|
+
|
|
28026
|
+
const queryText = this.shadowRoot.querySelector("textarea").value.trim();
|
|
28027
|
+
const collectionName = this.#target.collectionName.trim();
|
|
28028
|
+
|
|
28029
|
+
//try {
|
|
28030
|
+
// 쿼리 텍스트를 임베딩으로 변환 (Gemini Embedding 모델 사용)
|
|
28031
|
+
// LangChain의 Embeddings 클래스 또는 @google/generative-ai SDK 직접 사용 가능
|
|
28032
|
+
// 여기서는 예시를 위해 임시로 더미 벡터를 사용합니다.
|
|
28033
|
+
// 실제로는 GoogleGenerativeAI.embedContent 등을 사용해야 합니다.
|
|
28034
|
+
// const genAI = new GoogleGenerativeAI(GEMINI_API_KEY);
|
|
28035
|
+
// const embeddingModel = genAI.get GenerativeModel({ model: "embedding-001" });
|
|
28036
|
+
// const { embedding } = await embeddingModel.embedContent({
|
|
28037
|
+
// content: queryText,
|
|
28038
|
+
// taskType: "retrieval_query",
|
|
28039
|
+
// });
|
|
28040
|
+
//const queryVector = [0.1, 0.2, 0.3, 0.4, ...Array(764).fill(0)]; // 실제 임베딩 벡터로 대체
|
|
28041
|
+
const embeddings = new OllamaEmbeddings({ model: "nomic-embed-text" });
|
|
28042
|
+
const queryVector = await embeddings.embedQuery(queryText);
|
|
28043
|
+
|
|
28044
|
+
|
|
28045
|
+
console.log(collectionName, filter);
|
|
28046
|
+
|
|
28047
|
+
const searchParams = {
|
|
28048
|
+
vector: queryVector,
|
|
28049
|
+
limit: 500, // 검색 결과 수
|
|
28050
|
+
filter: filter, // Gemini가 생성한 필터 적용
|
|
28051
|
+
with_payload: true, // 페이로드도 함께 가져오도록 설정
|
|
28052
|
+
};
|
|
28053
|
+
|
|
28054
|
+
//console.log("Qdrant Search Params:", JSON.stringify(searchParams, null, 2));
|
|
28055
|
+
|
|
28056
|
+
return await qdrantClient.search(collectionName, searchParams);
|
|
28057
|
+
//}
|
|
28058
|
+
}
|
|
28059
|
+
|
|
28025
28060
|
#q1 = async () => {
|
|
28026
|
-
await this.#generateQdrantFilter();
|
|
28061
|
+
const filter = await this.#generateQdrantFilter();
|
|
28062
|
+
const d = await this.#searchWithQdrantFilter(filter);
|
|
28063
|
+
console.log(d);
|
|
28027
28064
|
};
|
|
28028
28065
|
|
|
28029
28066
|
#q2 = async () => {
|
|
28030
|
-
await this.#generateQdrantFilter();
|
|
28067
|
+
const filter = await this.#generateQdrantFilter();
|
|
28068
|
+
const d = await this.#searchWithQdrantFilter(filter);
|
|
28069
|
+
console.log(d);
|
|
28031
28070
|
};
|
|
28032
28071
|
|
|
28033
28072
|
#q3 = async () => {
|
|
28034
|
-
await this.#generateQdrantFilter();
|
|
28073
|
+
const filter = await this.#generateQdrantFilter();
|
|
28074
|
+
const d = await this.#searchWithQdrantFilter(filter);
|
|
28075
|
+
console.log(d);
|
|
28035
28076
|
};
|
|
28036
28077
|
|
|
28037
28078
|
#init = (info) => {
|
|
@@ -28067,8 +28108,10 @@ filterString = "a" + filterString;
|
|
|
28067
28108
|
e.target.value = "";
|
|
28068
28109
|
});
|
|
28069
28110
|
|
|
28070
|
-
this.shadowRoot.querySelector("nx-ai-chat")
|
|
28071
|
-
|
|
28111
|
+
const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
|
|
28112
|
+
|
|
28113
|
+
elAiChat.add("me", question);
|
|
28114
|
+
elAiChat.add("ing", question);
|
|
28072
28115
|
|
|
28073
28116
|
try {
|
|
28074
28117
|
this.#createModel();
|
|
@@ -28083,8 +28126,8 @@ filterString = "a" + filterString;
|
|
|
28083
28126
|
await this.#q3();
|
|
28084
28127
|
}
|
|
28085
28128
|
} catch (error) {
|
|
28086
|
-
console.error("Error generating Qdrant filter:", error);
|
|
28087
|
-
|
|
28129
|
+
//console.error("Error generating Qdrant filter:", error);
|
|
28130
|
+
elAiChat.add("ai", error);
|
|
28088
28131
|
}
|
|
28089
28132
|
|
|
28090
28133
|
|
package/package.json
CHANGED
package/src/ai/aiContainer.js
CHANGED
|
@@ -3,6 +3,7 @@ import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
|
|
|
3
3
|
import { Ollama } from "@langchain/ollama";
|
|
4
4
|
import { ChatOpenAI } from '@langchain/openai';
|
|
5
5
|
import { HumanMessage, SystemMessage } from '@langchain/core/messages';
|
|
6
|
+
import { OllamaEmbeddings } from "@langchain/ollama";
|
|
6
7
|
|
|
7
8
|
class aiContainer extends HTMLElement
|
|
8
9
|
{
|
|
@@ -150,13 +151,12 @@ class aiContainer extends HTMLElement
|
|
|
150
151
|
}
|
|
151
152
|
//filterString = filterString.replaceAll('"value"', '"text"')
|
|
152
153
|
console.log("Generated Filter String:", filterString);
|
|
153
|
-
|
|
154
|
+
|
|
154
155
|
// Gemini가 JSON 모드나 Structured Output을 지원하지 않는 경우, 직접 파싱 시도
|
|
155
156
|
// 안정적인 JSON 파싱을 위해 'JSON Mode' 또는 Function Calling 사용을 강력히 권장
|
|
156
157
|
// LangChain의 SelfQueryRetriever를 사용하면 이 부분을 자동화할 수 있습니다.
|
|
157
158
|
//try {
|
|
158
|
-
|
|
159
|
-
return a;
|
|
159
|
+
return JSON.parse(filterString);
|
|
160
160
|
//} catch (parseError) {
|
|
161
161
|
// console.error("Failed to parse filter string as JSON:", parseError);
|
|
162
162
|
// console.error("String that failed to parse:", filterString);
|
|
@@ -170,16 +170,62 @@ filterString = "a" + filterString;
|
|
|
170
170
|
//}
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
+
#searchWithQdrantFilter = async (filter) => {
|
|
174
|
+
|
|
175
|
+
const queryText = this.shadowRoot.querySelector("textarea").value.trim();
|
|
176
|
+
const collectionName = this.#target.collectionName.trim();
|
|
177
|
+
|
|
178
|
+
//try {
|
|
179
|
+
// 쿼리 텍스트를 임베딩으로 변환 (Gemini Embedding 모델 사용)
|
|
180
|
+
// LangChain의 Embeddings 클래스 또는 @google/generative-ai SDK 직접 사용 가능
|
|
181
|
+
// 여기서는 예시를 위해 임시로 더미 벡터를 사용합니다.
|
|
182
|
+
// 실제로는 GoogleGenerativeAI.embedContent 등을 사용해야 합니다.
|
|
183
|
+
// const genAI = new GoogleGenerativeAI(GEMINI_API_KEY);
|
|
184
|
+
// const embeddingModel = genAI.get GenerativeModel({ model: "embedding-001" });
|
|
185
|
+
// const { embedding } = await embeddingModel.embedContent({
|
|
186
|
+
// content: queryText,
|
|
187
|
+
// taskType: "retrieval_query",
|
|
188
|
+
// });
|
|
189
|
+
//const queryVector = [0.1, 0.2, 0.3, 0.4, ...Array(764).fill(0)]; // 실제 임베딩 벡터로 대체
|
|
190
|
+
const embeddings = new OllamaEmbeddings({ model: "nomic-embed-text" });
|
|
191
|
+
const queryVector = await embeddings.embedQuery(queryText);
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
console.log(collectionName, filter);
|
|
195
|
+
|
|
196
|
+
const searchParams = {
|
|
197
|
+
vector: queryVector,
|
|
198
|
+
limit: 500, // 검색 결과 수
|
|
199
|
+
filter: filter, // Gemini가 생성한 필터 적용
|
|
200
|
+
with_payload: true, // 페이로드도 함께 가져오도록 설정
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
//console.log("Qdrant Search Params:", JSON.stringify(searchParams, null, 2));
|
|
204
|
+
|
|
205
|
+
return await qdrantClient.search(collectionName, searchParams);
|
|
206
|
+
|
|
207
|
+
//} catch (error) {
|
|
208
|
+
// console.error("Error during Qdrant search:", error);
|
|
209
|
+
return [];
|
|
210
|
+
//}
|
|
211
|
+
}
|
|
212
|
+
|
|
173
213
|
#q1 = async () => {
|
|
174
|
-
await this.#generateQdrantFilter();
|
|
214
|
+
const filter = await this.#generateQdrantFilter();
|
|
215
|
+
const d = await this.#searchWithQdrantFilter(filter);
|
|
216
|
+
console.log(d);
|
|
175
217
|
};
|
|
176
218
|
|
|
177
219
|
#q2 = async () => {
|
|
178
|
-
await this.#generateQdrantFilter();
|
|
220
|
+
const filter = await this.#generateQdrantFilter();
|
|
221
|
+
const d = await this.#searchWithQdrantFilter(filter);
|
|
222
|
+
console.log(d);
|
|
179
223
|
};
|
|
180
224
|
|
|
181
225
|
#q3 = async () => {
|
|
182
|
-
await this.#generateQdrantFilter();
|
|
226
|
+
const filter = await this.#generateQdrantFilter();
|
|
227
|
+
const d = await this.#searchWithQdrantFilter(filter);
|
|
228
|
+
console.log(d);
|
|
183
229
|
};
|
|
184
230
|
|
|
185
231
|
#init = (info) => {
|
|
@@ -216,8 +262,10 @@ filterString = "a" + filterString;
|
|
|
216
262
|
e.target.value = "";
|
|
217
263
|
});
|
|
218
264
|
|
|
219
|
-
this.shadowRoot.querySelector("nx-ai-chat")
|
|
220
|
-
|
|
265
|
+
const elAiChat = this.shadowRoot.querySelector("nx-ai-chat");
|
|
266
|
+
|
|
267
|
+
elAiChat.add("me", question);
|
|
268
|
+
elAiChat.add("ing", question);
|
|
221
269
|
|
|
222
270
|
try {
|
|
223
271
|
this.#createModel();
|
|
@@ -232,8 +280,8 @@ filterString = "a" + filterString;
|
|
|
232
280
|
await this.#q3();
|
|
233
281
|
}
|
|
234
282
|
} catch (error) {
|
|
235
|
-
console.error("Error generating Qdrant filter:", error);
|
|
236
|
-
|
|
283
|
+
//console.error("Error generating Qdrant filter:", error);
|
|
284
|
+
elAiChat.add("ai", error);
|
|
237
285
|
}
|
|
238
286
|
|
|
239
287
|
|