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
| import type { VbenFormSchema } from '#/adapter/form';
|
| import { AiModelTypeEnum } from '@vben/constants';
|
| import { getModelSimpleList } from '#/api/ai/model/model';
|
| export function useFormSchema(): VbenFormSchema[] {
| return [
| {
| component: 'Input',
| fieldName: 'id',
| dependencies: {
| triggerFields: [''],
| show: () => false,
| },
| },
| {
| fieldName: 'systemMessage',
| label: '角色设定',
| component: 'Textarea',
| componentProps: {
| rows: 4,
| placeholder: '请输入角色设定',
| },
| },
| {
| component: 'ApiSelect',
| fieldName: 'modelId',
| label: '模型',
| componentProps: {
| api: () => getModelSimpleList(AiModelTypeEnum.CHAT),
| labelField: 'name',
| valueField: 'id',
| allowClear: true,
| placeholder: '请选择模型',
| },
| rules: 'required',
| },
| {
| fieldName: 'temperature',
| label: '温度参数',
| component: 'InputNumber',
| componentProps: {
| class: '!w-full',
| placeholder: '请输入温度参数',
| precision: 2,
| min: 0,
| max: 2,
| },
| rules: 'required',
| },
| {
| fieldName: 'maxTokens',
| label: '回复数 Token 数',
| component: 'InputNumber',
| componentProps: {
| class: '!w-full',
| placeholder: '请输入回复数 Token 数',
| min: 0,
| max: 8192,
| },
| rules: 'required',
| },
| {
| fieldName: 'maxContexts',
| label: '上下文数量',
| component: 'InputNumber',
| componentProps: {
| class: '!w-full',
| placeholder: '请输入上下文数量',
| min: 0,
| max: 20,
| },
| rules: 'required',
| },
| ];
| }
|
|