### 一、安装

:::info
npm i znt-agent-chat

:::

### 二、引入

```typescript
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注入

```javascript
import axios from "./axios";

// 获取鉴权信息
export function getAuthorizationDataApi(endpointType, fileId) {
  const url = `/authorizationData?endpointType=${endpointType}&fileId=${fileId}`
  return axios.get(url)
}
```

```vue
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) // 注入异步方法
```

### 四、<font style="color:rgb(60, 60, 67);">配置参数</font>

| **参数名**                                                   | **说明**                                                     | **类型**                                              | **默认值**                                          |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ----------------------------------------------------- | --------------------------------------------------- |
| **<font style="color:rgb(64, 64, 64);">isOpenITS</font>**    | <font style="color:rgb(64, 64, 64);">是否开启语音合成和转写</font> | `<font style="color:rgb(64, 64, 64);">Boolean</font>` | `<font style="color:rgb(64, 64, 64);">true</font>`  |
| **<font style="color:rgb(64, 64, 64);">isOpenCopyText</font>** | <font style="color:rgb(64, 64, 64);">是否开启文本复制</font> | `<font style="color:rgb(64, 64, 64);">Boolean</font>` | `<font style="color:rgb(64, 64, 64);">true</font>`  |
| **<font style="color:rgb(64, 64, 64);">isOpenZanCai</font>** | <font style="color:rgb(64, 64, 64);">是否开启点赞点踩</font> | `<font style="color:rgb(64, 64, 64);">Boolean</font>` | `<font style="color:rgb(64, 64, 64);">true</font>`  |
| **<font style="color:rgb(64, 64, 64);">isOpenUploadFile</font>** | <font style="color:rgb(64, 64, 64);">是否开启上传文件</font> | `<font style="color:rgb(64, 64, 64);">Boolean</font>` | `<font style="color:rgb(64, 64, 64);">true</font>`  |
| **<font style="color:rgb(64, 64, 64);">readOnly</font>**     | <font style="color:rgb(64, 64, 64);">是否只读</font>         | `<font style="color:rgb(64, 64, 64);">Boolean</font>` | `<font style="color:rgb(64, 64, 64);">false</font>` |
| **<font style="color:rgb(64, 64, 64);">isShowAgentInfo</font>** | <font style="color:rgb(64, 64, 64);">是否需要显示头部的智能体信息</font> | `<font style="color:rgb(64, 64, 64);">Boolean</font>` | `<font style="color:rgb(64, 64, 64);">true</font>`  |

