vectocore4 0.0.26 → 0.0.27

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
@@ -294,7 +294,7 @@ class Lens {
294
294
  body: JSON.stringify(requestBody),
295
295
  };
296
296
  const response = yield fetch(this.baseURL, request);
297
- return response;
297
+ return response.body;
298
298
  });
299
299
  }
300
300
  genStreamResponse(streamRes) {
@@ -348,10 +348,11 @@ class Lens {
348
348
  requestParam.params.custom_system_prompt = customSystemPrompt;
349
349
  let response = yield this.requestStream(requestParam);
350
350
  if (stream) {
351
- return response.body.getReader();
351
+ return response;
352
352
  }
353
353
  else {
354
- return response.json();
354
+ const res = yield this.genStreamResponse(response);
355
+ return res;
355
356
  }
356
357
  });
357
358
  }
package/dist/index.d.ts CHANGED
@@ -324,7 +324,7 @@ export declare class Lens {
324
324
  * @param {string | undefined} [opts.tenantKey=process.env['VECTOCORE4_TENANT_KEY'] ?? undefined]
325
325
  */
326
326
  constructor({ tenantKey, baseURL }: ClientOptions);
327
- protected requestStream(requestBody: any): Promise<Response>;
327
+ protected requestStream(requestBody: any): Promise<ReadableStream<Uint8Array> | null>;
328
328
  protected genStreamResponse(streamRes: ReadableStream): Promise<any>;
329
329
  chat({ question, stream, model, xfinder, webSearch, agentic, imageUrls, fileUrls, customContext, sessionKey, maxHisCount, withStatus, staticInfo, customSystemPrompt, }: LensChatParams): Promise<any>;
330
330
  history({ sessionKey, limit }: ChatHistoryParams): Promise<any>;
package/dist/mjs/index.js CHANGED
@@ -258,7 +258,7 @@ export class Lens {
258
258
  body: JSON.stringify(requestBody),
259
259
  };
260
260
  const response = await fetch(this.baseURL, request);
261
- return response;
261
+ return response.body;
262
262
  }
263
263
  async genStreamResponse(streamRes) {
264
264
  const reader = streamRes?.getReader();
@@ -308,10 +308,11 @@ export class Lens {
308
308
  requestParam.params.custom_system_prompt = customSystemPrompt;
309
309
  let response = await this.requestStream(requestParam);
310
310
  if (stream) {
311
- return response.body.getReader();
311
+ return response;
312
312
  }
313
313
  else {
314
- return response.json();
314
+ const res = await this.genStreamResponse(response);
315
+ return res;
315
316
  }
316
317
  }
317
318
  async history({ sessionKey, limit }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vectocore4",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "description": "",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/cjs/index.js",