@@ -3,29 +3,14 @@ import { z } from 'zod';
3
3
import { AgentSchema } from '@/database/schemas/session' ;
4
4
import { LobeMetaDataSchema } from '@/types/meta' ;
5
5
6
- const modelProviderSchema = z . object ( {
7
- openai : z . object ( {
8
- OPENAI_API_KEY : z . string ( ) . optional ( ) ,
9
- azureApiVersion : z . string ( ) . optional ( ) ,
10
- customModelName : z . string ( ) . optional ( ) ,
11
- endpoint : z . string ( ) . optional ( ) ,
12
- models : z . array ( z . string ( ) ) . optional ( ) ,
13
- useAzure : z . boolean ( ) . optional ( ) ,
14
- } ) ,
15
- // zhipu: z.object({
16
- // ZHIPU_API_KEY: z.string().optional(),
17
- // enabled: z.boolean().default(false),
18
- // }),
19
- } ) ;
20
-
21
6
const settingsSchema = z . object ( {
22
7
defaultAgent : z . object ( {
23
8
config : AgentSchema ,
24
9
meta : LobeMetaDataSchema ,
25
10
} ) ,
26
11
fontSize : z . number ( ) . default ( 14 ) ,
27
12
language : z . string ( ) ,
28
- languageModel : modelProviderSchema . partial ( ) ,
13
+ languageModel : z . any ( ) . optional ( ) ,
29
14
password : z . string ( ) ,
30
15
themeMode : z . string ( ) ,
31
16
tts : z . object ( {
@@ -38,19 +23,10 @@ const settingsSchema = z.object({
38
23
} ) ,
39
24
} ) ;
40
25
41
- // const patchSchema = z.array(
42
- // z.object({
43
- // op: z.string(),
44
- // path: z.string(),
45
- // value: z.any(),
46
- // }),
47
- // );
48
-
49
26
export const DB_UserSchema = z . object ( {
50
27
avatar : z . string ( ) . optional ( ) ,
51
28
settings : settingsSchema . partial ( ) ,
52
29
uuid : z . string ( ) ,
53
- // settings: patchSchema,
54
30
} ) ;
55
31
56
32
export type DB_User = z . infer < typeof DB_UserSchema > ;
0 commit comments