vectocore4 1.0.2 → 1.0.4

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/cjs/index.js CHANGED
@@ -122,6 +122,7 @@ class Vectocore {
122
122
  * @param {string} params.docBody.imageUrl doc_type이 "image"일 경우 사용하는 필드로 웹에서 접근 가능한 이미지의 경로를 입력.
123
123
  * @param {object} params.docBody.metadata 문서 저장시 추가로 남기고 싶은 정보를 json 형식으로 추가하면 향후 검색 결과시 리턴. 문서명이나, 페이지 번호 등을 입력하여 출처 확인용으로 사용할 수 있다
124
124
  * @param {boolean} params.docBody.refOnlyText lens 기능 사용시 사용하는 옵션으로 doc_type이 "image"인 경우 "image_url"의 경로를 자동으로 멀티모달로 전달하는데 ref_only_text : true로 설정한 경우 멀티모달을 전달하지 않고 "data" 필드의 정보만 context로 활용한다.
125
+ * @param {string[]} params.docBody.tags 키:값 형태의 문자열 목록을 입력하면 향후 정교한 필터링 식으로 활용할 수 있습니다.
125
126
  *
126
127
  * ---
127
128
  * @returns
@@ -129,7 +130,7 @@ class Vectocore {
129
130
  */
130
131
  putExtremeData(_a) {
131
132
  return __awaiter(this, arguments, void 0, function* ({ indexName, docBody }) {
132
- var _b, _c;
133
+ var _b, _c, _d;
133
134
  const requestParam = {
134
135
  command: "put_extreme_data",
135
136
  params: {
@@ -140,6 +141,7 @@ class Vectocore {
140
141
  data: docBody.data,
141
142
  doc_type: (_b = docBody.docType) !== null && _b !== void 0 ? _b : "text",
142
143
  ref_only_text: (_c = docBody.refOnlyText) !== null && _c !== void 0 ? _c : false,
144
+ tags: (_d = docBody.tags) !== null && _d !== void 0 ? _d : [],
143
145
  },
144
146
  },
145
147
  };
@@ -265,13 +267,14 @@ class Vectocore {
265
267
  * @param {string[]} params.indexName 사용자의 질문을 검색하고자하는 인덱스 목록, 생략하거나 []를 전송시 전체 인덱스에서 검색 실행
266
268
  * @param {number} params.top 결과로 보고싶은 목록의 최대 건수, 생략시 10건을 조회.
267
269
  * @param {boolean} params.rerank 검색 mode가 hybrid일 경우 벡터 검색과 키워드 검색 결과를 ai가 다시 score를 산정하는 방식으로 별도의 토큰이 소모 됨.
270
+ * @param {string[]} params.tags 데이터 생성시 입력한 tags를 eq필터링 식으로 핕러링 할 수 있습니다.
268
271
  *
269
272
  * ---
270
273
  * @returns
271
274
  * - 순위가 있는 문서 목록
272
275
  */
273
276
  extremeSearch(_a) {
274
- return __awaiter(this, arguments, void 0, function* ({ mode, indexNames, question, top, rerank }) {
277
+ return __awaiter(this, arguments, void 0, function* ({ mode, indexNames, question, top, rerank, tags }) {
275
278
  const requestParam = {
276
279
  command: "extreme_search",
277
280
  params: {
@@ -280,6 +283,7 @@ class Vectocore {
280
283
  question: question,
281
284
  top: top !== null && top !== void 0 ? top : 10,
282
285
  rerank: rerank !== null && rerank !== void 0 ? rerank : false,
286
+ tags: tags !== null && tags !== void 0 ? tags : [],
283
287
  },
284
288
  };
285
289
  const response = yield this.requestPost(requestParam);
@@ -407,7 +411,7 @@ class Lens {
407
411
  */
408
412
  chat(_a) {
409
413
  return __awaiter(this, arguments, void 0, function* ({ question, stream = true, model = "4o", xfinder, webSearch, agentic, imageUrls, fileUrls, customContext, sessionKey, maxHisCount, withStatus, staticInfo, customSystemPrompt, }) {
410
- var _b, _c;
414
+ var _b, _c, _d, _e, _f, _g;
411
415
  const requestParam = {
412
416
  command: "lens_chat",
413
417
  params: {
@@ -417,12 +421,19 @@ class Lens {
417
421
  };
418
422
  if (model)
419
423
  requestParam.params.model = model;
420
- if (xfinder)
421
- requestParam.params.xfinder = xfinder;
424
+ if (xfinder) {
425
+ requestParam.params.xfinder = {
426
+ mode: (_b = xfinder.mode) !== null && _b !== void 0 ? _b : "hybrid",
427
+ index_names: (_c = xfinder.indexNames) !== null && _c !== void 0 ? _c : [],
428
+ top: xfinder.top,
429
+ rerank: (_d = xfinder.rerank) !== null && _d !== void 0 ? _d : false,
430
+ text_only: (_e = xfinder.textOnly) !== null && _e !== void 0 ? _e : false,
431
+ };
432
+ }
422
433
  if (webSearch) {
423
434
  requestParam.params.web_search = {
424
- with_image: (_b = webSearch.withImage) !== null && _b !== void 0 ? _b : false,
425
- with_video: (_c = webSearch.withVideo) !== null && _c !== void 0 ? _c : false,
435
+ with_image: (_f = webSearch.withImage) !== null && _f !== void 0 ? _f : false,
436
+ with_video: (_g = webSearch.withVideo) !== null && _g !== void 0 ? _g : false,
426
437
  };
427
438
  }
428
439
  if (agentic)
package/dist/index.d.ts CHANGED
@@ -52,6 +52,8 @@ export interface PutExtremeDataParams {
52
52
  metadata?: any;
53
53
  /** lens 기능 사용시 사용하는 옵션으로 doc_type이 "image"인 경우 "image_url"의 경로를 자동으로 멀티모달로 전달하는데 ref_only_text : true로 설정한 경우 멀티모달을 전달하지 않고 "data" 필드의 정보만 context로 활용합니다. */
54
54
  refOnlyText?: boolean;
55
+ /** 키:값 형태의 list를 데이터 생성시 저장하면 extreme_search때 eq식의 필터링이 가능합니다. */
56
+ tags?: string[];
55
57
  };
56
58
  }
57
59
  export interface ListExtremeDataParams {
@@ -98,6 +100,8 @@ export interface ExtremeSearchParams {
98
100
  top?: number;
99
101
  /** 검색 mode가 hybrid일 경우 벡터 검색과 키워드 검색 결과를 ai가 다시 score를 산정하는 방식으로 별도의 토큰이 소모 됨. */
100
102
  rerank?: boolean;
103
+ /** 데이터 생성시 입력한 tags를 필터링 값으로 사용 가능합니다. */
104
+ tags?: string[];
101
105
  }
102
106
  export interface WebSearchParams {
103
107
  /** 검색어 */
@@ -267,6 +271,7 @@ export declare class Vectocore {
267
271
  * @param {string} params.docBody.imageUrl doc_type이 "image"일 경우 사용하는 필드로 웹에서 접근 가능한 이미지의 경로를 입력.
268
272
  * @param {object} params.docBody.metadata 문서 저장시 추가로 남기고 싶은 정보를 json 형식으로 추가하면 향후 검색 결과시 리턴. 문서명이나, 페이지 번호 등을 입력하여 출처 확인용으로 사용할 수 있다
269
273
  * @param {boolean} params.docBody.refOnlyText lens 기능 사용시 사용하는 옵션으로 doc_type이 "image"인 경우 "image_url"의 경로를 자동으로 멀티모달로 전달하는데 ref_only_text : true로 설정한 경우 멀티모달을 전달하지 않고 "data" 필드의 정보만 context로 활용한다.
274
+ * @param {string[]} params.docBody.tags 키:값 형태의 문자열 목록을 입력하면 향후 정교한 필터링 식으로 활용할 수 있습니다.
270
275
  *
271
276
  * ---
272
277
  * @returns
@@ -334,12 +339,13 @@ export declare class Vectocore {
334
339
  * @param {string[]} params.indexName 사용자의 질문을 검색하고자하는 인덱스 목록, 생략하거나 []를 전송시 전체 인덱스에서 검색 실행
335
340
  * @param {number} params.top 결과로 보고싶은 목록의 최대 건수, 생략시 10건을 조회.
336
341
  * @param {boolean} params.rerank 검색 mode가 hybrid일 경우 벡터 검색과 키워드 검색 결과를 ai가 다시 score를 산정하는 방식으로 별도의 토큰이 소모 됨.
342
+ * @param {string[]} params.tags 데이터 생성시 입력한 tags를 eq필터링 식으로 핕러링 할 수 있습니다.
337
343
  *
338
344
  * ---
339
345
  * @returns
340
346
  * - 순위가 있는 문서 목록
341
347
  */
342
- extremeSearch({ mode, indexNames, question, top, rerank }: ExtremeSearchParams): Promise<any>;
348
+ extremeSearch({ mode, indexNames, question, top, rerank, tags }: ExtremeSearchParams): Promise<any>;
343
349
  /**
344
350
  * 웹검색
345
351
  * ---
package/dist/mjs/index.js CHANGED
@@ -104,6 +104,7 @@ export class Vectocore {
104
104
  * @param {string} params.docBody.imageUrl doc_type이 "image"일 경우 사용하는 필드로 웹에서 접근 가능한 이미지의 경로를 입력.
105
105
  * @param {object} params.docBody.metadata 문서 저장시 추가로 남기고 싶은 정보를 json 형식으로 추가하면 향후 검색 결과시 리턴. 문서명이나, 페이지 번호 등을 입력하여 출처 확인용으로 사용할 수 있다
106
106
  * @param {boolean} params.docBody.refOnlyText lens 기능 사용시 사용하는 옵션으로 doc_type이 "image"인 경우 "image_url"의 경로를 자동으로 멀티모달로 전달하는데 ref_only_text : true로 설정한 경우 멀티모달을 전달하지 않고 "data" 필드의 정보만 context로 활용한다.
107
+ * @param {string[]} params.docBody.tags 키:값 형태의 문자열 목록을 입력하면 향후 정교한 필터링 식으로 활용할 수 있습니다.
107
108
  *
108
109
  * ---
109
110
  * @returns
@@ -120,6 +121,7 @@ export class Vectocore {
120
121
  data: docBody.data,
121
122
  doc_type: docBody.docType ?? "text",
122
123
  ref_only_text: docBody.refOnlyText ?? false,
124
+ tags: docBody.tags ?? [],
123
125
  },
124
126
  },
125
127
  };
@@ -236,12 +238,13 @@ export class Vectocore {
236
238
  * @param {string[]} params.indexName 사용자의 질문을 검색하고자하는 인덱스 목록, 생략하거나 []를 전송시 전체 인덱스에서 검색 실행
237
239
  * @param {number} params.top 결과로 보고싶은 목록의 최대 건수, 생략시 10건을 조회.
238
240
  * @param {boolean} params.rerank 검색 mode가 hybrid일 경우 벡터 검색과 키워드 검색 결과를 ai가 다시 score를 산정하는 방식으로 별도의 토큰이 소모 됨.
241
+ * @param {string[]} params.tags 데이터 생성시 입력한 tags를 eq필터링 식으로 핕러링 할 수 있습니다.
239
242
  *
240
243
  * ---
241
244
  * @returns
242
245
  * - 순위가 있는 문서 목록
243
246
  */
244
- async extremeSearch({ mode, indexNames, question, top, rerank }) {
247
+ async extremeSearch({ mode, indexNames, question, top, rerank, tags }) {
245
248
  const requestParam = {
246
249
  command: "extreme_search",
247
250
  params: {
@@ -250,6 +253,7 @@ export class Vectocore {
250
253
  question: question,
251
254
  top: top ?? 10,
252
255
  rerank: rerank ?? false,
256
+ tags: tags ?? [],
253
257
  },
254
258
  };
255
259
  const response = await this.requestPost(requestParam);
@@ -381,8 +385,15 @@ export class Lens {
381
385
  };
382
386
  if (model)
383
387
  requestParam.params.model = model;
384
- if (xfinder)
385
- requestParam.params.xfinder = xfinder;
388
+ if (xfinder) {
389
+ requestParam.params.xfinder = {
390
+ mode: xfinder.mode ?? "hybrid",
391
+ index_names: xfinder.indexNames ?? [],
392
+ top: xfinder.top,
393
+ rerank: xfinder.rerank ?? false,
394
+ text_only: xfinder.textOnly ?? false,
395
+ };
396
+ }
386
397
  if (webSearch) {
387
398
  requestParam.params.web_search = {
388
399
  with_image: webSearch.withImage ?? false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vectocore4",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/cjs/index.js",