znt-agent-chat
v1.0.10
Published
:::info npm i znt-agent-chat
Readme
一、安装
:::info npm i znt-agent-chat
:::
二、引入
import AgentsComponents from "agents-components";
import 'agents-components/lib/style.css'
import TAgentChat from 'znt-agent-chat'
import 'znt-agent-chat/es/znt-agent-chat.css'
let app = createApp(App)
app.use(AgentsComponents).use(TAgentChat).mount('#app')三、权限信息
创建获取权限信息方法,并通过provide注入
import axios from "./axios";
// 获取鉴权信息
export function getAuthorizationDataApi(endpointType, fileId) {
const url = `/authorizationData?endpointType=${endpointType}&fileId=${fileId}`
return axios.get(url)
}import { provide } from 'vue'
import { getAuthorizationDataApi } from '@/api/common'
const getAuthInfo = (endpointType, fileId) => {
return new Promise((resolve, reject) => {
getAuthorizationDataApi(endpointType, fileId).then(res => {
if (res) {
resolve(res)
} else {
$app.$message.error('获取权限信息失败!')
}
}).catch(err => {
$app.$message.error('获取权限信息失败!')
})
})
}
provide('getAuthInfo', getAuthInfo) // 注入异步方法四、配置参数
| 参数名 | 说明 | 类型 | 默认值 |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ----------------------------------------------------- | --------------------------------------------------- |
| isOpenITS | 是否开启语音合成和转写 | <font style="color:rgb(64, 64, 64);">Boolean</font> | <font style="color:rgb(64, 64, 64);">true</font> |
| isOpenCopyText | 是否开启文本复制 | <font style="color:rgb(64, 64, 64);">Boolean</font> | <font style="color:rgb(64, 64, 64);">true</font> |
| isOpenZanCai | 是否开启点赞点踩 | <font style="color:rgb(64, 64, 64);">Boolean</font> | <font style="color:rgb(64, 64, 64);">true</font> |
| isOpenUploadFile | 是否开启上传文件 | <font style="color:rgb(64, 64, 64);">Boolean</font> | <font style="color:rgb(64, 64, 64);">true</font> |
| readOnly | 是否只读 | <font style="color:rgb(64, 64, 64);">Boolean</font> | <font style="color:rgb(64, 64, 64);">false</font> |
| isShowAgentInfo | 是否需要显示头部的智能体信息 | <font style="color:rgb(64, 64, 64);">Boolean</font> | <font style="color:rgb(64, 64, 64);">true</font> |
