@tachybase/plugin-ai-chat 0.23.11 → 0.23.26
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/externalVersion.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"react": "18.3.1",
|
|
3
|
-
"@tachybase/client": "0.23.
|
|
3
|
+
"@tachybase/client": "0.23.35",
|
|
4
4
|
"@ant-design/icons": "5.5.2",
|
|
5
5
|
"antd": "5.22.5",
|
|
6
|
-
"@tachybase/server": "0.23.
|
|
6
|
+
"@tachybase/server": "0.23.35",
|
|
7
7
|
"antd-style": "3.7.1",
|
|
8
|
-
"@tachybase/schema": "0.23.
|
|
8
|
+
"@tachybase/schema": "0.23.35",
|
|
9
9
|
"lodash": "4.17.21",
|
|
10
10
|
"react-i18next": "15.2.0",
|
|
11
|
-
"@tachybase/actions": "0.23.
|
|
12
|
-
"@tachybase/utils": "0.23.
|
|
11
|
+
"@tachybase/actions": "0.23.35",
|
|
12
|
+
"@tachybase/utils": "0.23.35",
|
|
13
13
|
"axios": "1.7.7",
|
|
14
|
-
"@tachybase/database": "0.23.
|
|
14
|
+
"@tachybase/database": "0.23.35"
|
|
15
15
|
};
|
|
@@ -86,14 +86,15 @@ class AIChatController {
|
|
|
86
86
|
var _a, _b, _c, _d, _e, _f;
|
|
87
87
|
const repo = ctx.db.getRepository("aisettings");
|
|
88
88
|
const data = await repo.findOne();
|
|
89
|
-
const model
|
|
89
|
+
const { Model: model, AI_URL: apiUrl, AI_API_KEY: aitoken, System_messages: SystemMessages } = data || {};
|
|
90
90
|
const userMessage = ((_c = (_b = (_a = ctx.action) == null ? void 0 : _a.params) == null ? void 0 : _b.values) == null ? void 0 : _c.message) || void 0;
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
if (!model || !apiUrl || !aitoken || !userMessage) {
|
|
92
|
+
ctx.throw("Missing required fields for AI chat");
|
|
93
|
+
}
|
|
93
94
|
const requestData = {
|
|
94
95
|
model,
|
|
95
96
|
messages: [
|
|
96
|
-
{ role: "system", content:
|
|
97
|
+
{ role: "system", content: SystemMessages },
|
|
97
98
|
{ role: "user", content: userMessage }
|
|
98
99
|
]
|
|
99
100
|
};
|
package/dist/server/plugin.js
CHANGED
|
@@ -82,7 +82,8 @@ class PluginAiChatServer extends (_a = import_server.Plugin) {
|
|
|
82
82
|
id: 1,
|
|
83
83
|
Model: "deepseek-chat",
|
|
84
84
|
AI_URL: "https://api.deepseek.com/chat/completions",
|
|
85
|
-
AI_API_KEY: "sk-xxxxxxxxxx"
|
|
85
|
+
AI_API_KEY: "sk-xxxxxxxxxx",
|
|
86
|
+
System_messages: "\u4F60\u662F\u4E00\u4E2A\u4E13\u6CE8\u4E8E\u89E3\u51B3 JavaScript \u76F8\u5173\u95EE\u9898\u7684\u667A\u80FD\u52A9\u624B\uFF0C\u80FD\u591F\u63D0\u4F9B\u4EE3\u7801\u793A\u4F8B\u3001\u95EE\u9898\u5206\u6790\u548C\u4F18\u5316\u5EFA\u8BAE.\n1.\u89E3\u7B54 JavaScript \u8BED\u6CD5\u3001\u5F02\u6B65\u7F16\u7A0B\u3001\u51FD\u6570\u7B49\u5E38\u89C1\u95EE\u9898\u3002\n2.\u63D0\u4F9B\u4EE3\u7801\u8C03\u8BD5\u4E0E\u4F18\u5316\u65B9\u6848\u3002\n3.\u751F\u6210 JavaScript \u4EE3\u7801\u7247\u6BB5\u5E76\u89E3\u91CA\u6BCF\u4E2A\u90E8\u5206\u7684\u4F5C\u7528\u3002"
|
|
86
87
|
}
|
|
87
88
|
});
|
|
88
89
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/plugin-ai-chat",
|
|
3
|
-
"
|
|
3
|
+
"displayName": "AI Chat",
|
|
4
|
+
"version": "0.23.26",
|
|
5
|
+
"description": "AI chatbot, providing operational help, intelligent Q&A",
|
|
4
6
|
"main": "dist/server/index.js",
|
|
5
7
|
"devDependencies": {
|
|
6
8
|
"@ant-design/icons": "^5.5.2",
|
|
@@ -12,12 +14,14 @@
|
|
|
12
14
|
"react-i18next": "^15.2.0"
|
|
13
15
|
},
|
|
14
16
|
"peerDependencies": {
|
|
15
|
-
"@tachybase/actions": "0.23.
|
|
16
|
-
"@tachybase/client": "0.23.
|
|
17
|
-
"@tachybase/database": "0.23.
|
|
18
|
-
"@tachybase/
|
|
19
|
-
"@tachybase/test": "0.23.
|
|
20
|
-
"@tachybase/
|
|
21
|
-
"@tachybase/utils": "0.23.
|
|
22
|
-
}
|
|
17
|
+
"@tachybase/actions": "0.23.35",
|
|
18
|
+
"@tachybase/client": "0.23.35",
|
|
19
|
+
"@tachybase/database": "0.23.35",
|
|
20
|
+
"@tachybase/server": "0.23.35",
|
|
21
|
+
"@tachybase/test": "0.23.35",
|
|
22
|
+
"@tachybase/schema": "0.23.35",
|
|
23
|
+
"@tachybase/utils": "0.23.35"
|
|
24
|
+
},
|
|
25
|
+
"description.zh-CN": "AI聊天机器人,提供操作帮助,智能问答",
|
|
26
|
+
"displayName.zh-CN": "AI聊天"
|
|
23
27
|
}
|