Merge pull request #328 from devchat-ai/update_default_model

update default llm model
This commit is contained in:
boob.yang 2023-10-19 15:31:58 +08:00 committed by GitHub
commit 0730c0a5a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,6 +88,14 @@ export async function dependencyCheck(): Promise<[string, string]> {
apiKeyStatus = 'has valid access key';
return apiKeyStatus;
} else {
// test whether valid model exists
const modelList = await ApiKeyManager.getValidModels();
if (modelList && modelList.length > 0) {
// update default llm model
await UiUtilWrapper.updateConfiguration('devchat', 'defaultModel', modelList[0]);
apiKeyStatus = 'has valid access key';
return apiKeyStatus;
}
apiKeyStatus = 'Click "DevChat" status icon to set key';
return apiKeyStatus;
}