vectocore4 0.0.20 → 0.0.22
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 +3 -1
- package/dist/index.d.ts +10 -8
- package/dist/mjs/index.js +3 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -314,7 +314,7 @@ class Lens {
|
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
316
|
chat(_a) {
|
|
317
|
-
return __awaiter(this, arguments, void 0, function* ({ question, stream, model, xfinder, webSearch, agentic, imageUrls, fileUrls, customContext, sessionKey, maxHisCount, withStatus, staticInfo, }) {
|
|
317
|
+
return __awaiter(this, arguments, void 0, function* ({ question, stream, model, xfinder, webSearch, agentic, imageUrls, fileUrls, customContext, sessionKey, maxHisCount, withStatus, staticInfo, customSystemPrompt, }) {
|
|
318
318
|
const requestParam = {
|
|
319
319
|
command: "lens_chat",
|
|
320
320
|
params: {
|
|
@@ -344,6 +344,8 @@ class Lens {
|
|
|
344
344
|
requestParam.params.with_status = withStatus;
|
|
345
345
|
if (staticInfo)
|
|
346
346
|
requestParam.params.static_info = staticInfo;
|
|
347
|
+
if (customSystemPrompt)
|
|
348
|
+
requestParam.params.custom_system_prompt = customSystemPrompt;
|
|
347
349
|
let response = yield this.requestStream(requestParam);
|
|
348
350
|
if (stream) {
|
|
349
351
|
return response.body.getReader();
|
package/dist/index.d.ts
CHANGED
|
@@ -100,12 +100,6 @@ export interface WebSearchParams {
|
|
|
100
100
|
/** 검색어 */
|
|
101
101
|
question: string;
|
|
102
102
|
}
|
|
103
|
-
export type FileType = {
|
|
104
|
-
type: string;
|
|
105
|
-
name: string;
|
|
106
|
-
url: string;
|
|
107
|
-
extImgUrls?: string[];
|
|
108
|
-
};
|
|
109
103
|
type XFinderOptions = {
|
|
110
104
|
/**
|
|
111
105
|
* vector | keyword | hybrid (Default : hybrid)
|
|
@@ -144,6 +138,12 @@ type CustomContextOptions = {
|
|
|
144
138
|
/** 멀티모달 Context로 전송할 이미지 경로 URL */
|
|
145
139
|
imageUrls?: string;
|
|
146
140
|
};
|
|
141
|
+
export type FileType = {
|
|
142
|
+
type: string;
|
|
143
|
+
name: string;
|
|
144
|
+
url: string;
|
|
145
|
+
extImgUrls?: string[];
|
|
146
|
+
};
|
|
147
147
|
export interface LensChatParams {
|
|
148
148
|
/** 사용자 질문 (필수) */
|
|
149
149
|
question: string;
|
|
@@ -165,7 +165,7 @@ export interface LensChatParams {
|
|
|
165
165
|
/** 사용자 멀티모달 이미지 입력 시 자동으로 호출 */
|
|
166
166
|
imageUrls?: string[];
|
|
167
167
|
/** 사용자 멀티모달 파일(페이지별 이미지) 입력 시, 순수 파일을 올릴 수는 없고 별도의 pdf to images 와 같은 전처리 과정을 거쳐 문서의 각 페이지별 이미지 캡쳐본을 올릴 수 있음. 자동으로 호출 */
|
|
168
|
-
fileUrls?:
|
|
168
|
+
fileUrls?: FileType;
|
|
169
169
|
/**
|
|
170
170
|
* 사용자가 직접 정의한 Context 내에서 답변하고자 할 경우 ({@link CustomContextOptions})
|
|
171
171
|
* 해당 파라미터가 있는 경우 Rag를 무시하고 사용자가 입력한 Context 내에서만 답변합니다.
|
|
@@ -196,6 +196,8 @@ export interface LensChatParams {
|
|
|
196
196
|
withStatus?: boolean;
|
|
197
197
|
/** 사용자의 질문으로 보낼 수 없는 고유한 정보들이 있는 경우 static_info에 보내면 해당 데이터를 AI가 참고함. */
|
|
198
198
|
staticInfo?: any;
|
|
199
|
+
/** Lens의 기본 시스템 프롬프트를 대체함. */
|
|
200
|
+
customSystemPrompt?: string;
|
|
199
201
|
}
|
|
200
202
|
export interface ChatHistoryParams {
|
|
201
203
|
sessionKey: string;
|
|
@@ -317,7 +319,7 @@ export declare class Lens {
|
|
|
317
319
|
constructor({ tenantKey, baseURL }: ClientOptions);
|
|
318
320
|
protected requestStream(requestBody: any): Promise<ReadableStream<Uint8Array> | null>;
|
|
319
321
|
protected genStreamResponse(streamRes: ReadableStream): Promise<any>;
|
|
320
|
-
chat({ question, stream, model, xfinder, webSearch, agentic, imageUrls, fileUrls, customContext, sessionKey, maxHisCount, withStatus, staticInfo, }: LensChatParams): Promise<any>;
|
|
322
|
+
chat({ question, stream, model, xfinder, webSearch, agentic, imageUrls, fileUrls, customContext, sessionKey, maxHisCount, withStatus, staticInfo, customSystemPrompt, }: LensChatParams): Promise<any>;
|
|
321
323
|
history({ sessionKey, limit }: ChatHistoryParams): Promise<any>;
|
|
322
324
|
jsonAutoComplete(jsonString: string): string | null;
|
|
323
325
|
}
|
package/dist/mjs/index.js
CHANGED
|
@@ -274,7 +274,7 @@ export class Lens {
|
|
|
274
274
|
const payload = JSON.parse(content);
|
|
275
275
|
return payload;
|
|
276
276
|
}
|
|
277
|
-
async chat({ question, stream, model, xfinder, webSearch, agentic, imageUrls, fileUrls, customContext, sessionKey, maxHisCount, withStatus, staticInfo, }) {
|
|
277
|
+
async chat({ question, stream, model, xfinder, webSearch, agentic, imageUrls, fileUrls, customContext, sessionKey, maxHisCount, withStatus, staticInfo, customSystemPrompt, }) {
|
|
278
278
|
const requestParam = {
|
|
279
279
|
command: "lens_chat",
|
|
280
280
|
params: {
|
|
@@ -304,6 +304,8 @@ export class Lens {
|
|
|
304
304
|
requestParam.params.with_status = withStatus;
|
|
305
305
|
if (staticInfo)
|
|
306
306
|
requestParam.params.static_info = staticInfo;
|
|
307
|
+
if (customSystemPrompt)
|
|
308
|
+
requestParam.params.custom_system_prompt = customSystemPrompt;
|
|
307
309
|
let response = await this.requestStream(requestParam);
|
|
308
310
|
if (stream) {
|
|
309
311
|
return response.body.getReader();
|