Fix key not found issue

This commit is contained in:
bobo.yang 2023-10-09 08:12:51 +08:00
parent 67544c37ae
commit 5a25cefbe1
2 changed files with 3 additions and 0 deletions

View File

@ -64,6 +64,8 @@ async function configUpdateTo_0924() {
if (!devchatKey && !openaiKey) { if (!devchatKey && !openaiKey) {
openaiKey = await UiUtilWrapper.secretStorageGet("openai_OPENAI_API_KEY"); openaiKey = await UiUtilWrapper.secretStorageGet("openai_OPENAI_API_KEY");
devchatKey = await UiUtilWrapper.secretStorageGet("devchat_OPENAI_API_KEY"); devchatKey = await UiUtilWrapper.secretStorageGet("devchat_OPENAI_API_KEY");
await UiUtilWrapper.storeSecret("openai_OPENAI_API_KEY", "");
await UiUtilWrapper.storeSecret("devchat_OPENAI_API_KEY", "");
} }
if (!devchatKey && !openaiKey) { if (!devchatKey && !openaiKey) {
openaiKey = process.env.OPENAI_API_KEY; openaiKey = process.env.OPENAI_API_KEY;

View File

@ -6,6 +6,7 @@ export class ApiKeyManager {
static toProviderKey(provider: string) : string | undefined { static toProviderKey(provider: string) : string | undefined {
let providerNameMap = { let providerNameMap = {
"openai": "OpenAI", "openai": "OpenAI",
"devchat": "DevChat",
"cohere": "Cohere", "cohere": "Cohere",
"anthropic": "Anthropic", "anthropic": "Anthropic",
"replicate": "Replicate", "replicate": "Replicate",