@shun-js/aibaiban-server 0.9.1 → 1.0.1
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/package.json +3 -3
- package/server/util/llm-agent.js +2 -2
- package/server/util/prompt-agent.js +16 -6
- package/views/index.html +6 -6
- package/LICENSE +0 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shun-js/aibaiban-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "aibaiban.com server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai aibaiban"
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
25
|
"pack": "cp ./static/index.html ./views/index.html",
|
|
26
|
-
"upload": "qcos fo ../../configs/
|
|
26
|
+
"upload": "qcos fo ../../configs/aibaiban-web.json ./static aibaiban/static"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@shun-js/shun-config": "^0.3.1",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"access": "public",
|
|
45
45
|
"registry": "https://registry.npmjs.org/"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "620060d4440a59999fdaf310790434eba9c81d3c"
|
|
48
48
|
}
|
package/server/util/llm-agent.js
CHANGED
|
@@ -44,7 +44,7 @@ function extractJSON(text) {
|
|
|
44
44
|
exports.callLLMForJSON = async (prompt) => {
|
|
45
45
|
// 非流式调用,等待完整响应
|
|
46
46
|
const response = await llm.chat({
|
|
47
|
-
model:
|
|
47
|
+
model: finalLLMConfig.modelName,
|
|
48
48
|
messages: [{ role: 'user', content: prompt }],
|
|
49
49
|
});
|
|
50
50
|
|
|
@@ -61,7 +61,7 @@ exports.callLLM = async (prompt) => {
|
|
|
61
61
|
let fullContent = '';
|
|
62
62
|
|
|
63
63
|
await llm.chatWithStreaming(
|
|
64
|
-
{ model:
|
|
64
|
+
{ model: finalLLMConfig.modelName, messages: [{ role: 'user', content: prompt }] },
|
|
65
65
|
{
|
|
66
66
|
contentCallback: (chunk) => {
|
|
67
67
|
fullContent += chunk;
|
|
@@ -7,7 +7,7 @@ module.exports = {
|
|
|
7
7
|
/**
|
|
8
8
|
* 意图分类 - 判断是否与白板相关
|
|
9
9
|
*/
|
|
10
|
-
ROUTER_PROMPT: `你是一个意图分类器。判断用户输入是否与"
|
|
10
|
+
ROUTER_PROMPT: `你是一个意图分类器。判断用户输入是否与"画图/白板/图表/流程图/甘特图/思维导图/时序图/类图/状态图/ER图/饼图/Git分支图/用户旅程图"相关。
|
|
11
11
|
|
|
12
12
|
用户输入: {input}
|
|
13
13
|
|
|
@@ -20,10 +20,15 @@ module.exports = {
|
|
|
20
20
|
|
|
21
21
|
可选类型:
|
|
22
22
|
- flowchart: 流程图、步骤图、决策流程
|
|
23
|
+
- sequence: 时序图、交互流程、调用链
|
|
24
|
+
- classDiagram: 类图、对象关系、继承结构
|
|
25
|
+
- stateDiagram: 状态图、状态机、状态流转
|
|
26
|
+
- erDiagram: ER图、实体关系图、数据库设计
|
|
23
27
|
- gantt: 甘特图、项目计划、时间线
|
|
24
|
-
-
|
|
28
|
+
- pie: 饼图、占比图、比例分布
|
|
29
|
+
- gitGraph: Git分支图、版本管理流程
|
|
30
|
+
- journey: 用户旅程图、体验地图
|
|
25
31
|
- mindmap: 思维导图、知识结构
|
|
26
|
-
- sequence: 时序图、交互流程
|
|
27
32
|
|
|
28
33
|
用户输入: {input}
|
|
29
34
|
|
|
@@ -40,10 +45,15 @@ module.exports = {
|
|
|
40
45
|
请输出结构化的 JSON 描述,包含图表的所有节点、连接关系、标签等信息。
|
|
41
46
|
根据图表类型调整结构:
|
|
42
47
|
- flowchart: {"nodes": [...], "edges": [...]}
|
|
48
|
+
- sequence: {"participants": [...], "messages": [...]}
|
|
49
|
+
- classDiagram: {"classes": [{"name": "", "attributes": [...], "methods": [...]}], "relations": [...]}
|
|
50
|
+
- stateDiagram: {"states": [...], "transitions": [...]}
|
|
51
|
+
- erDiagram: {"entities": [{"name": "", "attributes": [...]}], "relations": [...]}
|
|
43
52
|
- gantt: {"tasks": [{"name": "", "start": "", "duration": ""}]}
|
|
53
|
+
- pie: {"title": "", "slices": [{"label": "", "value": 0}]}
|
|
54
|
+
- gitGraph: {"branches": [...], "commits": [...], "merges": [...]}
|
|
55
|
+
- journey: {"title": "", "sections": [{"name": "", "tasks": [{"name": "", "score": 0}]}]}
|
|
44
56
|
- mindmap: {"root": "", "children": [...]}
|
|
45
|
-
- sequence: {"participants": [...], "messages": [...]}
|
|
46
|
-
- prd: {"modules": [...], "relations": [...]}
|
|
47
57
|
|
|
48
58
|
只回复 JSON。`,
|
|
49
59
|
|
|
@@ -91,5 +101,5 @@ module.exports = {
|
|
|
91
101
|
* 非白板请求的固定回复
|
|
92
102
|
*/
|
|
93
103
|
FIXED_REPLY:
|
|
94
|
-
'
|
|
104
|
+
'我是一个白板助手,专门帮你生成各种图表。支持:流程图、时序图、类图、状态图、ER图、甘特图、饼图、Git分支图、用户旅程图、思维导图。请告诉我你想画什么图吧!',
|
|
95
105
|
};
|
package/views/index.html
CHANGED
|
@@ -107,32 +107,32 @@
|
|
|
107
107
|
<script
|
|
108
108
|
type="module"
|
|
109
109
|
crossorigin
|
|
110
|
-
src="https://static-small.vincentqiao.com/aibaiban/static/index-
|
|
110
|
+
src="https://static-small.vincentqiao.com/aibaiban/static/index-CsqtP3ZT.js"
|
|
111
111
|
></script>
|
|
112
112
|
<link
|
|
113
113
|
rel="modulepreload"
|
|
114
114
|
crossorigin
|
|
115
|
-
href="https://static-small.vincentqiao.com/aibaiban/static/chunks/react-vendor-
|
|
115
|
+
href="https://static-small.vincentqiao.com/aibaiban/static/chunks/react-vendor-Cy8ztC7t.js"
|
|
116
116
|
/>
|
|
117
117
|
<link
|
|
118
118
|
rel="modulepreload"
|
|
119
119
|
crossorigin
|
|
120
|
-
href="https://static-small.vincentqiao.com/aibaiban/static/chunks/antd-base-
|
|
120
|
+
href="https://static-small.vincentqiao.com/aibaiban/static/chunks/antd-base-eH03AryP.js"
|
|
121
121
|
/>
|
|
122
122
|
<link
|
|
123
123
|
rel="modulepreload"
|
|
124
124
|
crossorigin
|
|
125
|
-
href="https://static-small.vincentqiao.com/aibaiban/static/chunks/antd-icons-
|
|
125
|
+
href="https://static-small.vincentqiao.com/aibaiban/static/chunks/antd-icons-YV1DFW0X.js"
|
|
126
126
|
/>
|
|
127
127
|
<link
|
|
128
128
|
rel="modulepreload"
|
|
129
129
|
crossorigin
|
|
130
|
-
href="https://static-small.vincentqiao.com/aibaiban/static/chunks/antd-x-
|
|
130
|
+
href="https://static-small.vincentqiao.com/aibaiban/static/chunks/antd-x-DyGKn05l.js"
|
|
131
131
|
/>
|
|
132
132
|
<link
|
|
133
133
|
rel="modulepreload"
|
|
134
134
|
crossorigin
|
|
135
|
-
href="https://static-small.vincentqiao.com/aibaiban/static/chunks/excalidraw-
|
|
135
|
+
href="https://static-small.vincentqiao.com/aibaiban/static/chunks/excalidraw-CaW1wDJE.js"
|
|
136
136
|
/>
|
|
137
137
|
<link
|
|
138
138
|
rel="stylesheet"
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 qiaowenbin<uikoo9@qq.com>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|