model.data.ts
2.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import { FormSchema } from '@/components/Form';
import deepspeek from '/@/views/super/airag/aimodel/icon/deepspeek.png';
import ollama from '/@/views/super/airag/aimodel/icon/ollama.png';
import OpenAi from '/@/views/super/airag/aimodel/icon/OpenAi.png';
import qianfan from '/@/views/super/airag/aimodel/icon/qianfan.png';
import qianwen from '/@/views/super/airag/aimodel/icon/qianwen.png';
import zhipuai from '/@/views/super/airag/aimodel/icon/zhipuai.png';
import { ref } from 'vue';
/**
* 表单
*/
export const formSchema: FormSchema[] = [
{
label: 'id',
field: 'id',
component: 'Input',
show: false,
},
{
label: '模型名称',
field: 'name',
required: true,
component: 'Input',
},
{
label: '模型类型',
field: 'modelType',
slot: 'modelType',
required: true,
component: 'Select',
},
{
label: '基础模型',
field: 'modelName',
required: true,
slot: 'modelName',
component: 'Select',
},
{
label: 'API域名',
field: 'baseUrl',
required: true,
component: 'Input',
},
{
label: 'API Key',
field: 'apiKey',
required: true,
component: 'InputPassword',
ifShow: ({ values }) => {
if (values.provider === 'OLLAMA') {
return false;
}
return true;
},
},
{
label: 'Secret Key',
field: 'secretKey',
required: true,
component: 'InputPassword',
ifShow: ({ values }) => {
if (
values.provider === 'DEEPSEEK' ||
values.provider === 'OLLAMA' ||
values.provider === 'OPENAI' ||
values.provider === 'ZHIPU' ||
values.provider === 'QWEN'
) {
return false;
}
return true;
},
},
{
label: '供应者',
field: 'provider',
component: 'Input',
show: false,
},
];
/**
* 图片路径映射
*
* @param name
*/
export const imageList = ref<any>({
DEEPSEEK: deepspeek,
OLLAMA: ollama,
OPENAI: OpenAi,
QIANFAN: qianfan,
QWEN: qianwen,
ZHIPU: zhipuai,
});