feat: better custom model support

This commit is contained in:
josc146
2023-03-27 15:15:12 +08:00
parent 9409377c45
commit 9c7c596fb6
4 changed files with 29 additions and 9 deletions
+4 -3
View File
@@ -18,14 +18,14 @@ export const Models = {
chatgptApi4_8k: { value: 'gpt-4', desc: 'ChatGPT (GPT-4-8k)' },
chatgptApi4_32k: { value: 'gpt-4-32k', desc: 'ChatGPT (GPT-4-32k)' },
gptApiDavinci: { value: 'text-davinci-003', desc: 'GPT-3.5' },
chatglm6bInt4: { value: 'chatglm-6b-int4', desc: 'ChatGLM-6B-Int4' },
customModel: { value: '', desc: 'Custom Model' },
}
export const chatgptWebModelKeys = ['chatgptFree35', 'chatgptPlus4']
export const bingWebModelKeys = ['bingFree4']
export const gptApiModelKeys = ['gptApiDavinci']
export const chatgptApiModelKeys = ['chatgptApi35', 'chatgptApi4_8k', 'chatgptApi4_32k']
export const customApiModelKeys = ['chatglm6bInt4']
export const customApiModelKeys = ['customModel']
export const TriggerMode = {
always: 'Always',
@@ -66,13 +66,14 @@ export const defaultConfig = {
preferredLanguage: navigator.language.substring(0, 2),
insertAtTop: isMobile(),
lockWhenAnswer: false,
customModelApiUrl: 'http://localhost:8000/chat/completions',
customModelName: 'chatglm-6b-int4',
// advanced
customChatGptWebApiUrl: 'https://chat.openai.com',
customChatGptWebApiPath: '/backend-api/conversation',
customOpenAiApiUrl: 'https://api.openai.com',
customModelApiUrl: 'http://localhost:8000/chat/completions',
siteRegex: 'match nothing',
userSiteRegexOnly: false,
inputQuery: '',