feat(admin): 重构系统设置页面并新增渠道管理功能
- 将系统设置页面改为公开/私有双标签页结构 - 新增渠道协议、权重配置和加权随机选择算法 - 替换自定义模型为自定义渠道配置选项 - 实现渠道模型远程获取和在线测试功能 - 添加批量测试和抽屉式编辑界面 - 更新文档说明和数据表结构定义
This commit is contained in:
@@ -116,7 +116,7 @@
|
||||
| `defaultImageModel` | string | 默认图片模型 |
|
||||
| `defaultTextModel` | string | 默认文本模型 |
|
||||
| `systemPrompt` | string | 系统提示词 |
|
||||
| `allowCustomModel` | bool | 是否允许用户自定义模型 |
|
||||
| `allowCustomChannel` | bool | 是否允许用户自定义渠道,允许时前端可提供走后端渠道和自定义 baseUrl 直连两种模式 |
|
||||
|
||||
`private.value` 当前字段:
|
||||
|
||||
@@ -128,14 +128,17 @@
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|----------|----------|----------|
|
||||
| `key` | string | 渠道标识 |
|
||||
| `protocol` | string | 协议,当前支持 `openai` |
|
||||
| `name` | string | 渠道名称 |
|
||||
| `baseUrl` | string | 渠道接口地址 |
|
||||
| `apiKey` | string | 渠道密钥 |
|
||||
| `models` | string[] | 渠道可用模型列表 |
|
||||
| `weight` | number | 渠道权重,同一模型命中多个渠道时按权重随机 |
|
||||
| `enabled` | bool | 是否启用 |
|
||||
| `remark` | string | 备注 |
|
||||
|
||||
后端请求模型时,先按模型名筛选启用且包含该模型的渠道,再按 `weight` 加权随机选择一个渠道。
|
||||
|
||||
### dicts
|
||||
|
||||
字典表。一个字典一行,具体字典项数据放在 `items`。
|
||||
|
||||
Reference in New Issue
Block a user