ibc-ai-web-sdk 2.0.3 → 2.0.5
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 +23 -1
- package/dist/index.cjs.js +1236 -372
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1236 -372
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1236 -372
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/index.d.ts +35 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -39,6 +39,28 @@ const dialog = createAIChatDialog({
|
|
|
39
39
|
dialog.open();
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
### 内嵌模式(作为页面组件嵌入)
|
|
43
|
+
|
|
44
|
+
指定 `target` 即可将对话组件嵌入到页面的某个容器内,而非浮窗形式:
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<div id="chat-box" style="width:480px;height:680px"></div>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
AIWebSDK.create({
|
|
52
|
+
target: '#chat-box', // 挂载容器
|
|
53
|
+
apiEndpoint: '/v1/app/completion',
|
|
54
|
+
appId: 'your-app-id',
|
|
55
|
+
userId: 'user-123',
|
|
56
|
+
bizType: 'chat',
|
|
57
|
+
token: 'your-auth-token'
|
|
58
|
+
});
|
|
59
|
+
// 内嵌模式自动展开,无需调用 open()
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
> **npm 用户**:将 `AIWebSDK.create()` 替换为 `createAIChatDialog()` 即可。
|
|
63
|
+
|
|
42
64
|
---
|
|
43
65
|
|
|
44
66
|
## 配置选项
|
|
@@ -55,7 +77,7 @@ dialog.open();
|
|
|
55
77
|
| `welcomeText` | string | `'Hi,我是智能助手 ~'` | | 欢迎语 |
|
|
56
78
|
| `welcomeDesc` | string | `'全新自动化能力上线...'` | | 欢迎描述 |
|
|
57
79
|
| `theme` | string\|object | `'default'` | | 主题,见下方[主题定制](#主题定制) |
|
|
58
|
-
| `suggestions` | array |
|
|
80
|
+
| `suggestions` | array | 内置默认建议 | | 欢迎页建议列表 `[{ label, value }]` |
|
|
59
81
|
| `timeout` | number | `60000` | | 请求超时(毫秒) |
|
|
60
82
|
| `maxLength` | number | `500` | | 输入最大字符数 |
|
|
61
83
|
| `enableDrag` | boolean | `true` | | 是否允许拖拽对话框 |
|