@@ -42,31 +42,43 @@ export const maxResponseTokenLength = 1000
4242 * @typedef {typeof defaultConfig } UserConfig
4343 */
4444export const defaultConfig = {
45+ // general
46+
4547 /** @type {keyof TriggerMode }*/
4648 triggerMode : 'manually' ,
4749 /** @type {keyof ThemeMode }*/
4850 themeMode : 'auto' ,
4951 /** @type {keyof Models }*/
5052 modelName : 'chatgptFree' ,
5153 apiKey : '' ,
54+ preferredLanguage : navigator . language . substring ( 0 , 2 ) ,
5255 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' ,
5363 siteRegex : 'match nothing' ,
5464 userSiteRegexOnly : false ,
5565 inputQuery : '' ,
5666 appendQuery : '' ,
5767 prependQuery : '' ,
68+
69+ // others
70+
71+ activeSelectionTools : Object . keys ( toolsConfig ) ,
72+ activeSiteAdapters : [ 'bilibili' , 'github' , 'gitlab' , 'quora' , 'reddit' , 'youtube' , 'zhihu' ] ,
5873 accessToken : '' ,
5974 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 ) ,
6579 selectionTools : Object . keys ( toolsConfig ) ,
66- activeSelectionTools : Object . keys ( toolsConfig ) ,
6780 // importing configuration will result in gpt-3-encoder being packaged into the output file
6881 siteAdapters : [ 'bilibili' , 'github' , 'gitlab' , 'quora' , 'reddit' , 'youtube' , 'zhihu' ] ,
69- activeSiteAdapters : [ 'bilibili' , 'github' , 'gitlab' , 'quora' , 'reddit' , 'youtube' , 'zhihu' ] ,
7082}
7183
7284export async function getUserLanguage ( ) {
0 commit comments