@@ -42,31 +42,43 @@ export const maxResponseTokenLength = 1000
42
42
* @typedef {typeof defaultConfig } UserConfig
43
43
*/
44
44
export const defaultConfig = {
45
+ // general
46
+
45
47
/** @type {keyof TriggerMode }*/
46
48
triggerMode : 'manually' ,
47
49
/** @type {keyof ThemeMode }*/
48
50
themeMode : 'auto' ,
49
51
/** @type {keyof Models }*/
50
52
modelName : 'chatgptFree' ,
51
53
apiKey : '' ,
54
+ preferredLanguage : navigator . language . substring ( 0 , 2 ) ,
52
55
insertAtTop : isMobile ( ) ,
56
+ lockWhenAnswer : false ,
57
+
58
+ // advanced
59
+
60
+ customChatGptWebApiUrl : 'https://chat.openai.com' ,
61
+ customChatGptWebApiPath : '/backend-api/conversation' ,
62
+ customOpenAiApiUrl : 'https://api.openai.com' ,
53
63
siteRegex : 'match nothing' ,
54
64
userSiteRegexOnly : false ,
55
65
inputQuery : '' ,
56
66
appendQuery : '' ,
57
67
prependQuery : '' ,
68
+
69
+ // others
70
+
71
+ activeSelectionTools : Object . keys ( toolsConfig ) ,
72
+ activeSiteAdapters : [ 'bilibili' , 'github' , 'gitlab' , 'quora' , 'reddit' , 'youtube' , 'zhihu' ] ,
58
73
accessToken : '' ,
59
74
tokenSavedOn : 0 ,
60
- preferredLanguage : navigator . language . substring ( 0 , 2 ) ,
61
- userLanguage : navigator . language . substring ( 0 , 2 ) , // unchangeable
62
- customChatGptWebApiUrl : 'https://chat.openai.com' ,
63
- customChatGptWebApiPath : '/backend-api/conversation' ,
64
- customOpenAiApiUrl : 'https://api.openai.com' ,
75
+
76
+ // unchangeable
77
+
78
+ userLanguage : navigator . language . substring ( 0 , 2 ) ,
65
79
selectionTools : Object . keys ( toolsConfig ) ,
66
- activeSelectionTools : Object . keys ( toolsConfig ) ,
67
80
// importing configuration will result in gpt-3-encoder being packaged into the output file
68
81
siteAdapters : [ 'bilibili' , 'github' , 'gitlab' , 'quora' , 'reddit' , 'youtube' , 'zhihu' ] ,
69
- activeSiteAdapters : [ 'bilibili' , 'github' , 'gitlab' , 'quora' , 'reddit' , 'youtube' , 'zhihu' ] ,
70
82
}
71
83
72
84
export async function getUserLanguage ( ) {
0 commit comments