0.0.1 • Published 7 months ago

g-ai-robot3-ts v0.0.1

Weekly downloads
-
License
-
Repository
-
Last release
7 months ago

g-ai-robot3

简介

封装了QA问答和语音问答功能(vue3版本)

安装(npm or yarn)

npm install g-ai-robot3 --save

使用

import gAiRobot from "g-ai-robot";
import "g-ai-robot3/dist/g-ai-robot3.css"

<g-ai-robot
  :robotCss="{ zIndex: 9999, left: '10px', bottom: '300px' }"
  placement="top-end"
>
</g-ai-robot>

props

参数说明类型可选值默认值
isDebug开启debug打印Boolean--
title问答标题String--
greet问答问候语String--
waitTxt问答等候语String--
systemName系统编码String--
robotCss机器人在视口中的位置object-left: "10px", bottom: "10px"
placement问答弹窗位置Stringleft/right/top/bottom/top-start/top-end/bottom-start/bottom-endtop-end
useAudio语音功能Booleantrue/falsetrue
space监听时间间隔Number-3000
mode交互模式Stringtext/audiotext
openInstruct是否开启指令控制Booleantrue/falsetrue
qaServer问答服务地址String--
audioServer语音服务地址String--
cozeInfo扣字大模型参数Object--
wsServer语音监听地址String--
instructWs指令监听地址String--
eventFun触发事件Array--
searchTextCallback扣子大模型事件流回调函数Function--

cozeInfo

参数说明类型可选值默认值
issString--
kidString--
private_keyString--
bot_idString--

eventFun

参数说明类型可选值默认值
keywords触发关键字Array--
trigger回调触发时机Stringafter/together-
fun触发的回调函数Function--

方法

参数说明参数
searchText问答接口接收一个参数:{searchText} 问题的字符串
startMonitorAudio开启语音监听-
uploadWavFile语音转文字接口接收一个参数(formData类型):{modelName,audio} modelName:语音模型(tiny/base/small/medium/large), audio:语音文件流

Slot

参数说明
reference触发问答弹窗显示的HTML元素