vectocore4 0.0.4 → 0.0.5
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 +15 -23
- package/dist/index.d.ts +16 -11
- package/dist/mjs/index.js +15 -22
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -145,37 +145,27 @@ class Vectocore {
|
|
|
145
145
|
return __awaiter(this, arguments, void 0, function* ({ indexName, documentId }) {
|
|
146
146
|
const requestParam = {
|
|
147
147
|
command: "delete_extream_data",
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
params: {
|
|
149
|
+
index_name: indexName,
|
|
150
|
+
document_id: documentId,
|
|
151
|
+
},
|
|
150
152
|
};
|
|
151
153
|
const response = yield this.requestPost(requestParam);
|
|
152
154
|
return response;
|
|
153
155
|
});
|
|
154
156
|
}
|
|
155
157
|
extreamSearch(_a) {
|
|
156
|
-
return __awaiter(this, arguments, void 0, function* ({
|
|
157
|
-
var _b, _c, _d;
|
|
158
|
+
return __awaiter(this, arguments, void 0, function* ({ mode, indexNames, question, top, rerank }) {
|
|
158
159
|
const requestParam = {
|
|
159
160
|
command: "extream_search",
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
requestParam.max_count = maxCount;
|
|
168
|
-
if (findIndexPrompt)
|
|
169
|
-
requestParam.find_index_prompt = findIndexPrompt;
|
|
170
|
-
if (docOnly)
|
|
171
|
-
requestParam.doc_only = docOnly;
|
|
172
|
-
let __webSearch = {
|
|
173
|
-
model: (_b = webSearch === null || webSearch === void 0 ? void 0 : webSearch.model) !== null && _b !== void 0 ? _b : "bing",
|
|
174
|
-
with_image: (_c = webSearch === null || webSearch === void 0 ? void 0 : webSearch.withImage) !== null && _c !== void 0 ? _c : false,
|
|
175
|
-
with_video: (_d = webSearch === null || webSearch === void 0 ? void 0 : webSearch.withVideo) !== null && _d !== void 0 ? _d : false,
|
|
161
|
+
params: {
|
|
162
|
+
mode: mode !== null && mode !== void 0 ? mode : "vector",
|
|
163
|
+
index_names: indexNames !== null && indexNames !== void 0 ? indexNames : [],
|
|
164
|
+
question: question,
|
|
165
|
+
top: top !== null && top !== void 0 ? top : 10,
|
|
166
|
+
rerank: rerank !== null && rerank !== void 0 ? rerank : false,
|
|
167
|
+
},
|
|
176
168
|
};
|
|
177
|
-
if (webSearch)
|
|
178
|
-
requestParam.web_search = __webSearch;
|
|
179
169
|
const response = yield this.requestPost(requestParam);
|
|
180
170
|
return response;
|
|
181
171
|
});
|
|
@@ -184,7 +174,9 @@ class Vectocore {
|
|
|
184
174
|
return __awaiter(this, arguments, void 0, function* ({ question }) {
|
|
185
175
|
const requestParam = {
|
|
186
176
|
command: "web_search",
|
|
187
|
-
|
|
177
|
+
params: {
|
|
178
|
+
question: question,
|
|
179
|
+
},
|
|
188
180
|
};
|
|
189
181
|
const response = yield this.requestPost(requestParam);
|
|
190
182
|
return response;
|
package/dist/index.d.ts
CHANGED
|
@@ -97,19 +97,24 @@ export interface DeleteExtreamDataParams {
|
|
|
97
97
|
documentId: string;
|
|
98
98
|
}
|
|
99
99
|
export interface ExtreamSearchParams {
|
|
100
|
-
|
|
100
|
+
/** 사용자의 질문을 검색하고자하는 인덱스 목록, 생략하거나 []를 전송시 전체 인덱스에서 검색 실행합니다. */
|
|
101
|
+
indexNames?: string[];
|
|
102
|
+
/** 사용자 질문 (시멘틱 검색을 사용하기때문에 서술형을 질문해도 의미를 파악하여 유사한 결과를 유사도 순위별로 리턴.) */
|
|
101
103
|
question: string;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
104
|
+
/**
|
|
105
|
+
* • vector 모드 : 시멘틱 유사도만 사용
|
|
106
|
+
* • keyword 모드 : 키워드 유사도만 사용, 키워드 모드인 경우 해당 "단어"가 문서에 없으면 빈 list를 리턴
|
|
107
|
+
* • hybrid 모드 : 시멘틱 검색 순위와 키워드 검색 순위를 모두 사용하여 순위 결정
|
|
108
|
+
* @default "vector"
|
|
109
|
+
*/
|
|
110
|
+
mode?: "vector" | "keyword" | "hybrid";
|
|
111
|
+
/** 결과로 보고싶은 목록의 최대 건수, 생략시 10건을 조회. */
|
|
112
|
+
top?: number;
|
|
113
|
+
/** 검색 mode가 hybrid일 경우 벡터 검색과 키워드 검색 결과를 ai가 다시 score를 산정하는 방식으로 별도의 토큰이 소모 됨. */
|
|
114
|
+
rerank?: boolean;
|
|
111
115
|
}
|
|
112
116
|
export interface WebSearchParams {
|
|
117
|
+
/** 검색어 */
|
|
113
118
|
question: string;
|
|
114
119
|
}
|
|
115
120
|
export type FileType = {
|
|
@@ -166,7 +171,7 @@ export declare class Vectocore {
|
|
|
166
171
|
listExtreamData({ indexName, lastKey }: ListExtreamDataParams): Promise<any>;
|
|
167
172
|
listAllExtreamData({ indexName }: ListAllExtreamDataParams): Promise<any>;
|
|
168
173
|
deleteExtreamData({ indexName, documentId }: DeleteExtreamDataParams): Promise<any>;
|
|
169
|
-
extreamSearch({
|
|
174
|
+
extreamSearch({ mode, indexNames, question, top, rerank }: ExtreamSearchParams): Promise<any>;
|
|
170
175
|
webSearch({ question }: WebSearchParams): Promise<any>;
|
|
171
176
|
}
|
|
172
177
|
export declare class Lens {
|
package/dist/mjs/index.js
CHANGED
|
@@ -114,41 +114,34 @@ export class Vectocore {
|
|
|
114
114
|
async deleteExtreamData({ indexName, documentId }) {
|
|
115
115
|
const requestParam = {
|
|
116
116
|
command: "delete_extream_data",
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
params: {
|
|
118
|
+
index_name: indexName,
|
|
119
|
+
document_id: documentId,
|
|
120
|
+
},
|
|
119
121
|
};
|
|
120
122
|
const response = await this.requestPost(requestParam);
|
|
121
123
|
return response;
|
|
122
124
|
}
|
|
123
|
-
async extreamSearch({
|
|
125
|
+
async extreamSearch({ mode, indexNames, question, top, rerank }) {
|
|
124
126
|
const requestParam = {
|
|
125
127
|
command: "extream_search",
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
requestParam.max_count = maxCount;
|
|
134
|
-
if (findIndexPrompt)
|
|
135
|
-
requestParam.find_index_prompt = findIndexPrompt;
|
|
136
|
-
if (docOnly)
|
|
137
|
-
requestParam.doc_only = docOnly;
|
|
138
|
-
let __webSearch = {
|
|
139
|
-
model: webSearch?.model ?? "bing",
|
|
140
|
-
with_image: webSearch?.withImage ?? false,
|
|
141
|
-
with_video: webSearch?.withVideo ?? false,
|
|
128
|
+
params: {
|
|
129
|
+
mode: mode ?? "vector",
|
|
130
|
+
index_names: indexNames ?? [],
|
|
131
|
+
question: question,
|
|
132
|
+
top: top ?? 10,
|
|
133
|
+
rerank: rerank ?? false,
|
|
134
|
+
},
|
|
142
135
|
};
|
|
143
|
-
if (webSearch)
|
|
144
|
-
requestParam.web_search = __webSearch;
|
|
145
136
|
const response = await this.requestPost(requestParam);
|
|
146
137
|
return response;
|
|
147
138
|
}
|
|
148
139
|
async webSearch({ question }) {
|
|
149
140
|
const requestParam = {
|
|
150
141
|
command: "web_search",
|
|
151
|
-
|
|
142
|
+
params: {
|
|
143
|
+
question: question,
|
|
144
|
+
},
|
|
152
145
|
};
|
|
153
146
|
const response = await this.requestPost(requestParam);
|
|
154
147
|
return response;
|