0.1.33 • Published 11 months ago
g-ai-robot v0.1.33
g-ai-robot
简介
封装了QA问答和语音问答功能(vue2版本)
安装(npm or yarn)
npm install g-ai-robot --save
使用
import gAiRobot from "g-ai-robot";
import "g-ai-robot/dist/g-ai-robot.css"
components: {
gAiRobot,
}
<g-ai-robot
:robotCss="{ zIndex: 9999, right: '10px', top: '300px' }"
placement="left"
>
</g-ai-robot>
props
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
title | 问答标题 | String | - | - |
greet | 问答问候语 | String | - | - |
waitTxt | 问答等候语 | String | - | - |
systemName | 系统编码 | String | - | - |
robotCss | 机器人在视口中的位置 | object | - | left: "10px", bottom: "10px" |
placement | 问答弹窗位置 | String | left/right/top/bottom/top-start/top-end/bottom-start/bottom-end | top-end |
useAudio | 语音功能 | Boolean | true/false | true |
space | 监听时间间隔 | Number | - | 3000 |
mode | 交互模式 | String | text/audio | text |
openInstruct | 是否开启指令控制 | Boolean | true/false | true |
qaServer | 问答服务地址 | String | - | - |
audioServer | 语音服务地址 | String | - | - |
wsServer | 语音监听地址 | String | - | - |
instructWs | 指令监听地址 | String | - | - |
eventFun | 触发事件 | Array | - | - |
eventFun
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
keywords | 触发关键字 | Array | - | - |
trigger | 回调触发时机 | String | after/together | - |
fun | 触发的回调函数 | Function | - | - |
方法
参数 | 说明 | 参数 |
---|---|---|
searchText | 问答接口 | 接收一个参数:{searchText} 问题的字符串 |
startMonitorAudio | 开启语音监听 | - |
uploadWavFile | 语音转文字接口 | 接收一个参数(formData类型):{modelName,audio} modelName:语音模型(tiny/base/small/medium/large), audio:语音文件流 |
Slot
参数 | 说明 |
---|---|
reference | 触发问答弹窗显示的HTML元素 |
0.1.33
11 months ago
0.1.30
11 months ago
0.1.31
11 months ago
0.1.32
11 months ago
0.1.29
11 months ago
0.1.28
11 months ago
0.1.27
12 months ago
0.1.26
12 months ago
0.1.24
12 months ago
0.1.25
12 months ago
0.1.23
12 months ago
0.1.20
1 year ago
0.1.21
1 year ago
0.1.22
12 months ago
0.1.19
1 year ago
0.1.18
1 year ago
0.1.17
1 year ago
0.1.16
1 year ago
0.1.15
1 year ago
0.1.14
1 year ago
0.1.13
1 year ago
0.1.12
1 year ago
0.1.11
1 year ago
0.1.10
1 year ago
0.1.9
1 year ago
0.1.8
1 year ago
0.1.7
1 year ago
0.1.6
1 year ago
0.1.5
1 year ago
0.1.4
1 year ago
0.1.3
1 year ago
0.1.2
1 year ago
0.1.1
1 year ago
0.1.0
1 year ago