vectocore4 0.0.3 → 0.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 +42 -19
- package/dist/index.d.ts +32 -4
- package/dist/mjs/index.js +39 -19
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -45,8 +45,10 @@ class Vectocore {
|
|
|
45
45
|
return __awaiter(this, arguments, void 0, function* ({ indexName, description }) {
|
|
46
46
|
const requestParam = {
|
|
47
47
|
command: "put_index",
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
params: {
|
|
49
|
+
index_name: indexName,
|
|
50
|
+
description: description !== null && description !== void 0 ? description : "",
|
|
51
|
+
},
|
|
50
52
|
};
|
|
51
53
|
const response = yield this.requestPost(requestParam);
|
|
52
54
|
return response;
|
|
@@ -56,7 +58,9 @@ class Vectocore {
|
|
|
56
58
|
return __awaiter(this, arguments, void 0, function* ({ indexName }) {
|
|
57
59
|
const requestParam = {
|
|
58
60
|
command: "delete_index",
|
|
59
|
-
|
|
61
|
+
params: {
|
|
62
|
+
index_name: indexName,
|
|
63
|
+
},
|
|
60
64
|
};
|
|
61
65
|
const response = yield this.requestPost(requestParam);
|
|
62
66
|
return response;
|
|
@@ -73,22 +77,25 @@ class Vectocore {
|
|
|
73
77
|
}
|
|
74
78
|
putExtreamData(_a) {
|
|
75
79
|
return __awaiter(this, arguments, void 0, function* ({ indexName, docBody }) {
|
|
80
|
+
var _b, _c;
|
|
76
81
|
const requestParam = {
|
|
77
82
|
command: "put_extream_data",
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
params: {
|
|
84
|
+
index_name: indexName,
|
|
85
|
+
doc_body: {
|
|
86
|
+
id: docBody.id,
|
|
87
|
+
keywords: docBody.keywords,
|
|
88
|
+
data: docBody.data,
|
|
89
|
+
doc_type: (_b = docBody.docType) !== null && _b !== void 0 ? _b : "text",
|
|
90
|
+
ref_only_text: (_c = docBody.refOnlyText) !== null && _c !== void 0 ? _c : false,
|
|
91
|
+
},
|
|
85
92
|
},
|
|
86
93
|
};
|
|
87
|
-
if (docBody.imageUrl) {
|
|
88
|
-
requestParam.doc_body.image_url = docBody.imageUrl;
|
|
89
|
-
}
|
|
90
94
|
if (docBody.metadata) {
|
|
91
|
-
requestParam.doc_body.metadata = docBody.metadata;
|
|
95
|
+
requestParam.params.doc_body.metadata = docBody.metadata;
|
|
96
|
+
}
|
|
97
|
+
if (docBody.imageUrl) {
|
|
98
|
+
requestParam.params.doc_body.image_url = docBody.imageUrl;
|
|
92
99
|
}
|
|
93
100
|
const response = yield this.requestPost(requestParam);
|
|
94
101
|
return response;
|
|
@@ -98,8 +105,10 @@ class Vectocore {
|
|
|
98
105
|
return __awaiter(this, arguments, void 0, function* ({ indexName, documentId }) {
|
|
99
106
|
const requestParam = {
|
|
100
107
|
command: "get_extream_data",
|
|
101
|
-
|
|
102
|
-
|
|
108
|
+
params: {
|
|
109
|
+
index_name: indexName,
|
|
110
|
+
document_id: documentId,
|
|
111
|
+
},
|
|
103
112
|
};
|
|
104
113
|
const response = yield this.requestPost(requestParam);
|
|
105
114
|
return response;
|
|
@@ -109,15 +118,29 @@ class Vectocore {
|
|
|
109
118
|
return __awaiter(this, arguments, void 0, function* ({ indexName, lastKey }) {
|
|
110
119
|
const requestParam = {
|
|
111
120
|
command: "list_extream_data",
|
|
112
|
-
|
|
121
|
+
params: {
|
|
122
|
+
index_name: indexName,
|
|
123
|
+
},
|
|
113
124
|
};
|
|
114
|
-
if (lastKey
|
|
115
|
-
requestParam.last_key = lastKey;
|
|
125
|
+
if (lastKey) {
|
|
126
|
+
requestParam.params.last_key = lastKey;
|
|
116
127
|
}
|
|
117
128
|
const response = yield this.requestPost(requestParam);
|
|
118
129
|
return response;
|
|
119
130
|
});
|
|
120
131
|
}
|
|
132
|
+
listAllExtreamData(_a) {
|
|
133
|
+
return __awaiter(this, arguments, void 0, function* ({ indexName }) {
|
|
134
|
+
const requestParam = {
|
|
135
|
+
command: "list_all_extream_data",
|
|
136
|
+
params: {
|
|
137
|
+
index_name: indexName,
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
const response = yield this.requestPost(requestParam);
|
|
141
|
+
return response;
|
|
142
|
+
});
|
|
143
|
+
}
|
|
121
144
|
deleteExtreamData(_a) {
|
|
122
145
|
return __awaiter(this, arguments, void 0, function* ({ indexName, documentId }) {
|
|
123
146
|
const requestParam = {
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export interface CustomDataParams {
|
|
|
17
17
|
}
|
|
18
18
|
export interface LensClientOptions {
|
|
19
19
|
tenantKey?: string;
|
|
20
|
-
baseURL?: string
|
|
20
|
+
baseURL?: string;
|
|
21
21
|
role?: string;
|
|
22
22
|
rule?: string;
|
|
23
23
|
outputFormat?: any;
|
|
@@ -43,30 +43,57 @@ export interface PutIndexParams {
|
|
|
43
43
|
description?: string;
|
|
44
44
|
}
|
|
45
45
|
export interface DeleteIndexParams {
|
|
46
|
+
/**
|
|
47
|
+
* 삭제할 인덱스의 이름입니다.
|
|
48
|
+
* 인덱스를 삭제하면 인덱스내 모든 문서도 함께 삭제됩니다.
|
|
49
|
+
*/
|
|
46
50
|
indexName: string;
|
|
47
51
|
}
|
|
48
52
|
export interface PutExtreamDataParams {
|
|
53
|
+
/**
|
|
54
|
+
* 지식을 추가할 인덱스의 이름입니다.
|
|
55
|
+
*/
|
|
49
56
|
indexName: string;
|
|
57
|
+
/**
|
|
58
|
+
* 추가할 문서의 실제 본문 데이터입니다.
|
|
59
|
+
*/
|
|
50
60
|
docBody: {
|
|
61
|
+
/** 문서의 고유 식별자(ID) ""로 전송하면 자동으로 채번합니다.*/
|
|
51
62
|
id: string;
|
|
63
|
+
/** 검색 최적화를 위한 키워드 목록 (쉼표로 구분하거나 공백으로 구분하세요.) */
|
|
52
64
|
keywords: string;
|
|
65
|
+
/** 실제 지식 본문 텍스트 데이터 */
|
|
53
66
|
data: string;
|
|
54
|
-
|
|
55
|
-
|
|
67
|
+
/** 저장하는 지식의 타입 */
|
|
68
|
+
docType: "text" | "image";
|
|
69
|
+
/** docType이 "image"인 경우 함께 업로드할 이미지의 URL입니다. */
|
|
70
|
+
imageUrl?: string;
|
|
71
|
+
/** 문서 저장시 추가로 남기고 싶은 정보를 json 형식으로 추가하면 향후 검색 결과시 리턴. 문서명이나, 페이지 번호 등을 입력하여 출처 확인용으로 사용할 수 있습니다. */
|
|
56
72
|
metadata?: any;
|
|
73
|
+
/** lens 기능 사용시 사용하는 옵션으로 doc_type이 "image"인 경우 "image_url"의 경로를 자동으로 멀티모달로 전달하는데 ref_only_text : true로 설정한 경우 멀티모달을 전달하지 않고 "data" 필드의 정보만 context로 활용합니다. */
|
|
57
74
|
refOnlyText?: boolean;
|
|
58
75
|
};
|
|
59
76
|
}
|
|
60
77
|
export interface ListExtreamDataParams {
|
|
78
|
+
/** 데이터 목록을 조회할 인덱스의 이름입니다. */
|
|
79
|
+
indexName: string;
|
|
80
|
+
/** 페이징된 결과를 받았을때 해당 key부터 다음 페이징까지 결과를 조회하는 기준 키 입니다. */
|
|
81
|
+
lastKey?: string | null;
|
|
82
|
+
}
|
|
83
|
+
export interface ListAllExtreamDataParams {
|
|
84
|
+
/** 데이터 목록을 조회할 인덱스의 이름입니다. */
|
|
61
85
|
indexName: string;
|
|
62
|
-
lastKey?: any | null;
|
|
63
86
|
}
|
|
64
87
|
export interface GetExtreamDataParams {
|
|
88
|
+
/** 조회할 문서가 저장되어 있는 인덱스의 이름입니다. */
|
|
65
89
|
indexName: string;
|
|
90
|
+
/** 조회할 문서의 ID입니다. */
|
|
66
91
|
documentId: string;
|
|
67
92
|
}
|
|
68
93
|
export interface DeleteExtreamDataParams {
|
|
94
|
+
/** 삭제할 문서가 저장되어 있는 인덱스의 이름입니다. */
|
|
69
95
|
indexName: string;
|
|
96
|
+
/** 삭제할 문서의 ID입니다. */
|
|
70
97
|
documentId: string;
|
|
71
98
|
}
|
|
72
99
|
export interface ExtreamSearchParams {
|
|
@@ -137,6 +164,7 @@ export declare class Vectocore {
|
|
|
137
164
|
putExtreamData({ indexName, docBody }: PutExtreamDataParams): Promise<any>;
|
|
138
165
|
getExtreamData({ indexName, documentId }: GetExtreamDataParams): Promise<any>;
|
|
139
166
|
listExtreamData({ indexName, lastKey }: ListExtreamDataParams): Promise<any>;
|
|
167
|
+
listAllExtreamData({ indexName }: ListAllExtreamDataParams): Promise<any>;
|
|
140
168
|
deleteExtreamData({ indexName, documentId }: DeleteExtreamDataParams): Promise<any>;
|
|
141
169
|
extreamSearch({ indexName, question, maxCount, mode, webSearch, findIndexPrompt, docOnly, }: ExtreamSearchParams): Promise<any>;
|
|
142
170
|
webSearch({ question }: WebSearchParams): Promise<any>;
|
package/dist/mjs/index.js
CHANGED
|
@@ -29,8 +29,10 @@ export class Vectocore {
|
|
|
29
29
|
async putIndex({ indexName, description }) {
|
|
30
30
|
const requestParam = {
|
|
31
31
|
command: "put_index",
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
params: {
|
|
33
|
+
index_name: indexName,
|
|
34
|
+
description: description ?? "",
|
|
35
|
+
},
|
|
34
36
|
};
|
|
35
37
|
const response = await this.requestPost(requestParam);
|
|
36
38
|
return response;
|
|
@@ -38,7 +40,9 @@ export class Vectocore {
|
|
|
38
40
|
async deleteIndex({ indexName }) {
|
|
39
41
|
const requestParam = {
|
|
40
42
|
command: "delete_index",
|
|
41
|
-
|
|
43
|
+
params: {
|
|
44
|
+
index_name: indexName,
|
|
45
|
+
},
|
|
42
46
|
};
|
|
43
47
|
const response = await this.requestPost(requestParam);
|
|
44
48
|
return response;
|
|
@@ -53,20 +57,22 @@ export class Vectocore {
|
|
|
53
57
|
async putExtreamData({ indexName, docBody }) {
|
|
54
58
|
const requestParam = {
|
|
55
59
|
command: "put_extream_data",
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
params: {
|
|
61
|
+
index_name: indexName,
|
|
62
|
+
doc_body: {
|
|
63
|
+
id: docBody.id,
|
|
64
|
+
keywords: docBody.keywords,
|
|
65
|
+
data: docBody.data,
|
|
66
|
+
doc_type: docBody.docType ?? "text",
|
|
67
|
+
ref_only_text: docBody.refOnlyText ?? false,
|
|
68
|
+
},
|
|
63
69
|
},
|
|
64
70
|
};
|
|
65
|
-
if (docBody.imageUrl) {
|
|
66
|
-
requestParam.doc_body.image_url = docBody.imageUrl;
|
|
67
|
-
}
|
|
68
71
|
if (docBody.metadata) {
|
|
69
|
-
requestParam.doc_body.metadata = docBody.metadata;
|
|
72
|
+
requestParam.params.doc_body.metadata = docBody.metadata;
|
|
73
|
+
}
|
|
74
|
+
if (docBody.imageUrl) {
|
|
75
|
+
requestParam.params.doc_body.image_url = docBody.imageUrl;
|
|
70
76
|
}
|
|
71
77
|
const response = await this.requestPost(requestParam);
|
|
72
78
|
return response;
|
|
@@ -74,8 +80,10 @@ export class Vectocore {
|
|
|
74
80
|
async getExtreamData({ indexName, documentId }) {
|
|
75
81
|
const requestParam = {
|
|
76
82
|
command: "get_extream_data",
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
params: {
|
|
84
|
+
index_name: indexName,
|
|
85
|
+
document_id: documentId,
|
|
86
|
+
},
|
|
79
87
|
};
|
|
80
88
|
const response = await this.requestPost(requestParam);
|
|
81
89
|
return response;
|
|
@@ -83,14 +91,26 @@ export class Vectocore {
|
|
|
83
91
|
async listExtreamData({ indexName, lastKey }) {
|
|
84
92
|
const requestParam = {
|
|
85
93
|
command: "list_extream_data",
|
|
86
|
-
|
|
94
|
+
params: {
|
|
95
|
+
index_name: indexName,
|
|
96
|
+
},
|
|
87
97
|
};
|
|
88
|
-
if (lastKey
|
|
89
|
-
requestParam.last_key = lastKey;
|
|
98
|
+
if (lastKey) {
|
|
99
|
+
requestParam.params.last_key = lastKey;
|
|
90
100
|
}
|
|
91
101
|
const response = await this.requestPost(requestParam);
|
|
92
102
|
return response;
|
|
93
103
|
}
|
|
104
|
+
async listAllExtreamData({ indexName }) {
|
|
105
|
+
const requestParam = {
|
|
106
|
+
command: "list_all_extream_data",
|
|
107
|
+
params: {
|
|
108
|
+
index_name: indexName,
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
const response = await this.requestPost(requestParam);
|
|
112
|
+
return response;
|
|
113
|
+
}
|
|
94
114
|
async deleteExtreamData({ indexName, documentId }) {
|
|
95
115
|
const requestParam = {
|
|
96
116
|
command: "delete_extream_data",
|