@leatop/ai-agent 1.0.0 → 1.0.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.
- package/README.md +58 -0
- package/package.json +2 -2
- package/LICENSE +0 -21
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# @vben/ai-agent
|
|
2
|
+
|
|
3
|
+
由于本包功能从[`养护数据管家项目`](https://172.17.0.10:6541/svn/EMIS/trunk/20-路段智慧营运管理平台应用研究项目/数据管理系统/leatop-datarms-web)迁移过来, 基于原有项目的架构限制, 集成`@vben/ai-agent`的项目需要使用 pnpm `monorepo`的项目架构.
|
|
4
|
+
|
|
5
|
+
# 集成步骤
|
|
6
|
+
|
|
7
|
+
## 1. 添加文件
|
|
8
|
+
|
|
9
|
+
- 1.1 复制 packages 目录下的所有文件至项目子包目录中
|
|
10
|
+
<img src='./image.png'/>
|
|
11
|
+
|
|
12
|
+
- 1.2 依赖配置
|
|
13
|
+
在 package.json 中添加相关依赖
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
"dependencies": {
|
|
17
|
+
// 其他项目依赖
|
|
18
|
+
"@vben/ai-agent": "workspace:*",
|
|
19
|
+
"@vben/stores": "workspace:*"
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
- 1.3 配置 config.js
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
window.globalConfig = {
|
|
27
|
+
showAiagent: true, // 是否显示AI助手
|
|
28
|
+
essAiAgentConfig: {
|
|
29
|
+
// 具体配置值 可参考 apps/cdp-ops/public/config/conifg.js中的配置
|
|
30
|
+
wence: { Authorization: 'Bearer ...', agend_id: 'ID1' },
|
|
31
|
+
wenshu: { Authorization: 'Bearer ...', agend_id: 'ID2' },
|
|
32
|
+
wenzhen: { Authorization: 'Bearer ...', agend_id: 'ID3' },
|
|
33
|
+
tongwen: { Authorization: 'Bearer ...', agend_id: 'ID4' },
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 2. 在 Vue 页面中引入并使用组件
|
|
39
|
+
```ts
|
|
40
|
+
//项目入口 main.ts 以下代码
|
|
41
|
+
import { EventBus } from "@vben/ai-agent";
|
|
42
|
+
app.config.globalProperties.$EventBus = new EventBus();
|
|
43
|
+
```
|
|
44
|
+
```vue
|
|
45
|
+
<template>
|
|
46
|
+
<AIagent :zoom="1" :userInfo="user" />
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script setup>
|
|
50
|
+
import AIagent from '@vben/ai-agent';
|
|
51
|
+
const user = { userName: '张三', userId: '123' };
|
|
52
|
+
</script>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## 4. 启动并验证
|
|
56
|
+
|
|
57
|
+
- 启动应用并打开包含 `AIagent` 的页面。
|
|
58
|
+
- 确认 AI 助手界面存在且基本交互可用。
|
package/package.json
CHANGED
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Lollipope
|
|
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.
|