🎨 管理指定群组新增模型可选范围限制
This commit is contained in:
parent
dee47ddd58
commit
b794df9b63
@ -102,6 +102,7 @@ ai:
|
||||
models:
|
||||
- name: ChatGPT-4
|
||||
model: gpt-4
|
||||
canManager: false
|
||||
- name: 讯飞星火v3.1
|
||||
model: SparkDesk-v3.1
|
||||
- name: 讯飞星火v3.5
|
||||
@ -116,8 +117,10 @@ ai:
|
||||
model: StepChat
|
||||
- name: 豆包Lite-4k
|
||||
model: Doubao-lite-4k
|
||||
canManager: true
|
||||
- name: 豆包Pro-4k
|
||||
model: Doubao-pro-4k
|
||||
canManager: true
|
||||
|
||||
# 资源配置
|
||||
# map[k]v结构,k 会变成全小写,所以这儿不能用大写字母
|
||||
|
@ -17,4 +17,5 @@ type ai struct {
|
||||
type aiModel struct {
|
||||
Name string `json:"name" yaml:"name"` // 模型名称
|
||||
Model string `json:"dto" yaml:"dto"` // 模型代码
|
||||
CanManager bool `json:"canManager" yaml:"canManager"` // 是否可以在manager页面中选择
|
||||
}
|
||||
|
@ -53,7 +53,7 @@
|
||||
<select class="block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-green-600 sm:text-sm sm:leading-6" onchange="aiModelChange(event, {{.info.Wxid}})">
|
||||
{{$useModel := .info.AiModel}}
|
||||
{{ range $.aiModels }}
|
||||
<option value="{{.Model}}" {{ if eq $useModel .Model}}selected{{ end }}>
|
||||
<option value="{{.Model}}" {{ if eq $useModel .Model}}selected{{ end }} {{ if not .CanManager}}disabled{{ end }}>
|
||||
{{.Name}}
|
||||
</option>
|
||||
{{ end }}
|
||||
|
Loading…
Reference in New Issue
Block a user