g-ai-robot3 0.1.33 → 0.1.35
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/LICENSE +21 -0
- package/README.md +82 -82
- package/dist/g-ai-robot3.es.js +27159 -0
- package/dist/g-ai-robot3.umd.js +8 -32099
- package/dist/index.css +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.vue.d.ts +117 -0
- package/dist/type.d.ts +26 -0
- package/dist/utils/WsConnecter.d.ts +25 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/log.data.d.ts +4 -0
- package/package.json +40 -59
- package/dist/demo.html +0 -1
- package/dist/g-ai-robot3.common.js +0 -32080
- package/dist/g-ai-robot3.css +0 -1
- package/dist/g-ai-robot3.umd.min.js +0 -12
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 yuchen
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
# g-ai-robot3
|
|
2
|
-
|
|
3
|
-
## 简介
|
|
4
|
-
```
|
|
5
|
-
封装了QA问答和语音问答功能(vue3版本)
|
|
6
|
-
```
|
|
7
|
-
|
|
8
|
-
### 安装(npm or yarn)
|
|
9
|
-
```
|
|
10
|
-
npm install g-ai-robot3 --save
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
### 使用
|
|
14
|
-
``` javascript
|
|
15
|
-
import gAiRobot from "g-ai-robot";
|
|
16
|
-
import "g-ai-robot3/dist/g-ai-robot3.css"
|
|
17
|
-
|
|
18
|
-
<g-ai-robot
|
|
19
|
-
:robotCss="{ zIndex: 9999, left: '10px', bottom: '300px' }"
|
|
20
|
-
placement="top-end"
|
|
21
|
-
>
|
|
22
|
-
</g-ai-robot>
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
# props
|
|
28
|
-
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
29
|
-
|---------- |-------------------|------------|---------|---------|
|
|
30
|
-
| isDebug | 开启debug打印 | Boolean | - | - |
|
|
31
|
-
| title | 问答标题 | String | - | - |
|
|
32
|
-
| greet | 问答问候语 | String | - | - |
|
|
33
|
-
| waitTxt | 问答等候语 | String | - | - |
|
|
34
|
-
| systemName | 系统编码 | String | - | - |
|
|
35
|
-
| robotCss | 机器人在视口中的位置 | object | - | left: "10px", bottom: "10px" |
|
|
36
|
-
| placement | 问答弹窗位置 |String | left/right/top/bottom/top-start/top-end/bottom-start/bottom-end | top-end |
|
|
37
|
-
| useAudio | 语音功能 |Boolean | true/false | true |
|
|
38
|
-
| space | 监听时间间隔 |Number | - | 3000 |
|
|
39
|
-
| mode | 交互模式 |String | text/audio | text |
|
|
40
|
-
| openInstruct | 是否开启指令控制 |Boolean | true/false | true |
|
|
41
|
-
| qaServer | 问答服务地址 |String | - | - |
|
|
42
|
-
| audioServer | 语音服务地址 |String | - | - |
|
|
43
|
-
| cozeInfo | 扣字大模型参数 |Object | - | - |
|
|
44
|
-
| wsServer | 语音监听地址 |String | - | - |
|
|
45
|
-
| instructWs | 指令监听地址 |String | - | - |
|
|
46
|
-
| eventFun | 触发事件 |Array | - | - |
|
|
47
|
-
| searchTextCallback | 扣子大模型事件流回调函数 |Function | - | - |
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
# cozeInfo
|
|
52
|
-
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
53
|
-
|---------- |-------------------|------------|---------|---------|
|
|
54
|
-
| iss | | String | - | - |
|
|
55
|
-
| kid | | String | - | - |
|
|
56
|
-
| private_key | | String | - | - |
|
|
57
|
-
| bot_id | | String | - | - |
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
# eventFun
|
|
61
|
-
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
62
|
-
|---------- |-------------------|------------|---------|---------|
|
|
63
|
-
| keywords | 触发关键字 | Array | - | - |
|
|
64
|
-
| trigger | 回调触发时机 | String | after/together | - |
|
|
65
|
-
| fun | 触发的回调函数 | Function | - | - |
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
# 方法
|
|
69
|
-
| 参数 | 说明 | 参数 |
|
|
70
|
-
|---------- |------------------ |--------------|
|
|
71
|
-
| searchText | 问答接口 |接收一个参数:{searchText} 问题的字符串 |
|
|
72
|
-
| startMonitorAudio | 开启语音监听 | - |
|
|
73
|
-
| uploadWavFile | 语音转文字接口 |接收一个参数(formData类型):{modelName,audio} modelName:语音模型(tiny/base/small/medium/large), audio:语音文件流 |
|
|
74
|
-
|
|
75
|
-
# Slot
|
|
76
|
-
| 参数 | 说明 |
|
|
77
|
-
|---------- |--------------|
|
|
78
|
-
| reference | 触发问答弹窗显示的HTML元素 |
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
1
|
+
# g-ai-robot3
|
|
2
|
+
|
|
3
|
+
## 简介
|
|
4
|
+
```
|
|
5
|
+
封装了QA问答和语音问答功能(vue3版本)
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
### 安装(npm or yarn)
|
|
9
|
+
```
|
|
10
|
+
npm install g-ai-robot3 --save
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### 使用
|
|
14
|
+
``` javascript
|
|
15
|
+
import gAiRobot from "g-ai-robot";
|
|
16
|
+
import "g-ai-robot3/dist/g-ai-robot3.css"
|
|
17
|
+
|
|
18
|
+
<g-ai-robot
|
|
19
|
+
:robotCss="{ zIndex: 9999, left: '10px', bottom: '300px' }"
|
|
20
|
+
placement="top-end"
|
|
21
|
+
>
|
|
22
|
+
</g-ai-robot>
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# props
|
|
28
|
+
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
29
|
+
|---------- |-------------------|------------|---------|---------|
|
|
30
|
+
| isDebug | 开启debug打印 | Boolean | - | - |
|
|
31
|
+
| title | 问答标题 | String | - | - |
|
|
32
|
+
| greet | 问答问候语 | String | - | - |
|
|
33
|
+
| waitTxt | 问答等候语 | String | - | - |
|
|
34
|
+
| systemName | 系统编码 | String | - | - |
|
|
35
|
+
| robotCss | 机器人在视口中的位置 | object | - | left: "10px", bottom: "10px" |
|
|
36
|
+
| placement | 问答弹窗位置 |String | left/right/top/bottom/top-start/top-end/bottom-start/bottom-end | top-end |
|
|
37
|
+
| useAudio | 语音功能 |Boolean | true/false | true |
|
|
38
|
+
| space | 监听时间间隔 |Number | - | 3000 |
|
|
39
|
+
| mode | 交互模式 |String | text/audio | text |
|
|
40
|
+
| openInstruct | 是否开启指令控制 |Boolean | true/false | true |
|
|
41
|
+
| qaServer | 问答服务地址 |String | - | - |
|
|
42
|
+
| audioServer | 语音服务地址 |String | - | - |
|
|
43
|
+
| cozeInfo | 扣字大模型参数 |Object | - | - |
|
|
44
|
+
| wsServer | 语音监听地址 |String | - | - |
|
|
45
|
+
| instructWs | 指令监听地址 |String | - | - |
|
|
46
|
+
| eventFun | 触发事件 |Array | - | - |
|
|
47
|
+
| searchTextCallback | 扣子大模型事件流回调函数 |Function | - | - |
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# cozeInfo
|
|
52
|
+
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
53
|
+
|---------- |-------------------|------------|---------|---------|
|
|
54
|
+
| iss | | String | - | - |
|
|
55
|
+
| kid | | String | - | - |
|
|
56
|
+
| private_key | | String | - | - |
|
|
57
|
+
| bot_id | | String | - | - |
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# eventFun
|
|
61
|
+
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
62
|
+
|---------- |-------------------|------------|---------|---------|
|
|
63
|
+
| keywords | 触发关键字 | Array | - | - |
|
|
64
|
+
| trigger | 回调触发时机 | String | after/together | - |
|
|
65
|
+
| fun | 触发的回调函数 | Function | - | - |
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
# 方法
|
|
69
|
+
| 参数 | 说明 | 参数 |
|
|
70
|
+
|---------- |------------------ |--------------|
|
|
71
|
+
| searchText | 问答接口 |接收一个参数:{searchText} 问题的字符串 |
|
|
72
|
+
| startMonitorAudio | 开启语音监听 | - |
|
|
73
|
+
| uploadWavFile | 语音转文字接口 |接收一个参数(formData类型):{modelName,audio} modelName:语音模型(tiny/base/small/medium/large), audio:语音文件流 |
|
|
74
|
+
|
|
75
|
+
# Slot
|
|
76
|
+
| 参数 | 说明 |
|
|
77
|
+
|---------- |--------------|
|
|
78
|
+
| reference | 触发问答弹窗显示的HTML元素 |
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|