@leikeduntech/leiai-js 3.4.0 → 3.4.2

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.
Files changed (2) hide show
  1. package/build/index.js +2 -2
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -464,7 +464,7 @@ Current date: ${currentDate}`;
464
464
  delete body.max_tokens;
465
465
  headers["Authorization"] = signTencentHunyuan(body, url, keyList);
466
466
  } else if (this._manufacturer.toLowerCase() === "baidu") {
467
- if (pluginList.indexOf("zhishiku") > -1) {
467
+ if (pluginList && pluginList.indexOf("zhishiku") > -1) {
468
468
  let query = messages.splice(messages.length - 1, 1);
469
469
  body = Object.assign(body, { query: (_a2 = query[0]) == null ? void 0 : _a2.content, history: messages });
470
470
  delete body.messages;
@@ -473,7 +473,7 @@ Current date: ${currentDate}`;
473
473
  if (this._apiOrg && this._manufacturer.toLowerCase() === "openai") {
474
474
  headers["OpenAI-Organization"] = this._apiOrg;
475
475
  }
476
- if (this._manufacturer.toLowerCase() !== "baidu" || pluginList.indexOf("zhishiku") < 0) {
476
+ if (this._manufacturer.toLowerCase() !== "baidu" || pluginList && pluginList.indexOf("zhishiku") < 0) {
477
477
  if (typeof body.plugins !== void 0)
478
478
  delete body.plugins;
479
479
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leikeduntech/leiai-js",
3
- "version": "3.4.0",
3
+ "version": "3.4.2",
4
4
  "author": "liuhean",
5
5
  "repository": {
6
6
  "type": "git",