lt-ai-agent
v0.0.1
Published
````markdown # lt-ai-agent — 集成步骤(极简)
Downloads
60
Readme
lt-ai-agent — 快速集成指南(简洁版)
# lt-ai-agent — 集成步骤(极简)
下面只包含最小、必要的集成步骤,便于快速上手。
## 1. 安装
```bash
pnpm add lt-ai-agent
```
## 2. 在 Vue 页面中引入并使用组件
```vue
<template>
<AIagent :zoom="1" :userInfo="user" />
</template>
<script setup>
import AIagent from 'lt-ai-agent';
const user = { userName: '张三', userId: '123' };
</script>
```
## 3. 注入运行时鉴权配置(必须)
在页面加载或应用启动前注入后端提供的鉴权配置到 `window.globalConfig.essAiAgentConfig`(示例):
```js
window.globalConfig = window.globalConfig || {};
window.globalConfig.essAiAgentConfig = {
wence: { Authorization: 'Bearer ...', agend_id: 'ID1' },
wenshu: { Authorization: 'Bearer ...', agend_id: 'ID2' },
wenzhen: { Authorization: 'Bearer ...', agend_id: 'ID3' },
tongwen: { Authorization: 'Bearer ...', agend_id: 'ID4' },
};
```
(由后端提供具体值,确保在渲染包含 `AIagent` 的页面前完成注入。)
## 4. 启动并验证
- 启动应用并打开包含 `AIagent` 的页面。
- 确认 AI 助手界面存在且基本交互可用。
---
文件已更新: [packages/ai-agent/USAGE.md](packages/ai-agent/USAGE.md)