@leikeduntech/leiai-js 3.5.2 → 3.5.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/build/index.js +5 -3
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -371,6 +371,8 @@ var ChatGPTAPI = class {
|
|
|
371
371
|
delete headers.Authorization;
|
|
372
372
|
} else if (this._manufacturer.toLowerCase() === "chatdoc") {
|
|
373
373
|
url = this._apiBaseUrl;
|
|
374
|
+
} else if (this._manufacturer.toLocaleLowerCase() === "anthropic") {
|
|
375
|
+
url = this._apiBaseUrl;
|
|
374
376
|
}
|
|
375
377
|
let pluginList;
|
|
376
378
|
if (completionParams.pluginList) {
|
|
@@ -646,7 +648,7 @@ var ChatGPTAPI = class {
|
|
|
646
648
|
result.id = response.id;
|
|
647
649
|
}
|
|
648
650
|
}
|
|
649
|
-
if (((_l = response.choices) == null ? void 0 : _l.length) && ["openai", "azure", "tencent"].indexOf(
|
|
651
|
+
if (((_l = response.choices) == null ? void 0 : _l.length) && ["openai", "azure", "tencent", "anthropic"].indexOf(
|
|
650
652
|
this._manufacturer.toLowerCase()
|
|
651
653
|
) > -1) {
|
|
652
654
|
const delta = response.choices[0].delta;
|
|
@@ -939,7 +941,7 @@ var ChatGPTAPI = class {
|
|
|
939
941
|
}
|
|
940
942
|
const systemMessageOffset = messages.length;
|
|
941
943
|
let userMessage = null;
|
|
942
|
-
if (["baidu", "zhipu", "xunfei", "aliyun", "tencent", "chatdoc"].indexOf(
|
|
944
|
+
if (["baidu", "zhipu", "xunfei", "aliyun", "tencent", "chatdoc", "anthropic"].indexOf(
|
|
943
945
|
this._manufacturer.toLowerCase()
|
|
944
946
|
) > -1) {
|
|
945
947
|
userMessage = [{ role: "user", content: text }];
|
|
@@ -997,7 +999,7 @@ ${message.content}`]);
|
|
|
997
999
|
}
|
|
998
1000
|
const parentMessageRole = parentMessage.role || "user";
|
|
999
1001
|
let parentMessageItem = null;
|
|
1000
|
-
if (["baidu", "zhipu", "xunfei", "aliyun", "tencent", "chatdoc"].indexOf(
|
|
1002
|
+
if (["baidu", "zhipu", "xunfei", "aliyun", "tencent", "chatdoc", "anthropic"].indexOf(
|
|
1001
1003
|
this._manufacturer.toLowerCase()
|
|
1002
1004
|
) > -1) {
|
|
1003
1005
|
parentMessageItem = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leikeduntech/leiai-js",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.4",
|
|
4
4
|
"author": "liuhean",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"node": ">=14"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@leikeduntech/spark-nodejs": "1.0
|
|
44
|
+
"@leikeduntech/spark-nodejs": "1.1.0",
|
|
45
45
|
"cac": "^6.7.14",
|
|
46
46
|
"conf": "^11.0.1",
|
|
47
47
|
"crypto-js": "^4.1.1",
|