perf: completion chatId

This commit is contained in:
archer
2023-07-23 20:07:35 +08:00
parent b7d18e38d1
commit 67e10d6f2c
35 changed files with 447 additions and 385 deletions

View File

@@ -42,6 +42,66 @@ export async function getInitConfig() {
global.qaModels = res.QAModels;
global.vectorModels = res.VectorModels;
} catch (error) {
setDefaultData();
return Promise.reject('get init config error');
}
}
export function setDefaultData() {
global.systemEnv = {
vectorMaxProcess: 15,
qaMaxProcess: 15,
pgIvfflatProbe: 20,
sensitiveCheck: false
};
global.feConfigs = {
show_emptyChat: true,
show_register: true,
show_appStore: true,
show_userDetail: true,
show_git: true,
systemTitle: 'FastAI',
authorText: 'Made by FastAI Team.'
};
global.chatModels = [
{
model: 'gpt-3.5-turbo',
name: 'FastAI-4k',
contextMaxToken: 4000,
systemMaxToken: 2400,
maxTemperature: 1.2,
price: 1.5
},
{
model: 'gpt-3.5-turbo-16k',
name: 'FastAI-16k',
contextMaxToken: 16000,
systemMaxToken: 8000,
maxTemperature: 1.2,
price: 3
},
{
model: 'gpt-4',
name: 'FastAI-Plus',
contextMaxToken: 8000,
systemMaxToken: 4000,
maxTemperature: 1.2,
price: 45
}
];
global.qaModels = [
{
model: 'gpt-3.5-turbo-16k',
name: 'FastAI-16k',
maxToken: 16000,
price: 3
}
];
global.vectorModels = [
{
model: 'text-embedding-ada-002',
name: 'Embedding-2',
price: 0.2
}
];
}