mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-15 23:31:04 +00:00
fix: Fix Hugging Face provider setup not transitioning from welcome view (#6173)
fix: add Hugging Face API key to SECRET_STATE_KEYS and fix validation - Added huggingFaceApiKey to SECRET_STATE_KEYS array to ensure it's properly handled as a secret - Fixed validateModelsAndKeysProvided to check for huggingFaceModelId when validating Hugging Face provider - This fixes the issue where the welcome view wouldn't transition to chat view after configuring Hugging Face
This commit is contained in:
parent
1e17b3b3bb
commit
a82455715c
2 changed files with 11 additions and 0 deletions
|
|
@ -183,6 +183,7 @@ export const SECRET_STATE_KEYS = [
|
|||
"codebaseIndexOpenAiCompatibleApiKey",
|
||||
"codebaseIndexGeminiApiKey",
|
||||
"codebaseIndexMistralApiKey",
|
||||
"huggingFaceApiKey",
|
||||
] as const satisfies readonly (keyof ProviderSettings)[]
|
||||
export type SecretState = Pick<ProviderSettings, (typeof SECRET_STATE_KEYS)[number]>
|
||||
|
||||
|
|
|
|||
|
|
@ -102,6 +102,14 @@ function validateModelsAndKeysProvided(apiConfiguration: ProviderSettings): stri
|
|||
return i18next.t("settings:validation.modelSelector")
|
||||
}
|
||||
break
|
||||
case "huggingface":
|
||||
if (!apiConfiguration.huggingFaceApiKey) {
|
||||
return i18next.t("settings:validation.apiKey")
|
||||
}
|
||||
if (!apiConfiguration.huggingFaceModelId) {
|
||||
return i18next.t("settings:validation.modelId")
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
return undefined
|
||||
|
|
@ -166,6 +174,8 @@ function getModelIdForProvider(apiConfiguration: ProviderSettings, provider: str
|
|||
case "vscode-lm":
|
||||
// vsCodeLmModelSelector is an object, not a string
|
||||
return apiConfiguration.vsCodeLmModelSelector?.id
|
||||
case "huggingface":
|
||||
return apiConfiguration.huggingFaceModelId
|
||||
default:
|
||||
return apiConfiguration.apiModelId
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue