fix(openai-compatible) fix load model when change baseUrl

This commit is contained in:
sam hoang
2024-12-30 02:20:20 +07:00
parent 54040b067d
commit 7021b71776
3 changed files with 15 additions and 4 deletions

View File

@@ -26,7 +26,16 @@ const OpenAiModelPicker: React.FC = () => {
}
useEffect(() => {
vscode.postMessage({ type: "refreshOpenAiModels" })
if (!apiConfiguration?.openAiBaseUrl || !apiConfiguration?.openAiApiKey) {
return
}
vscode.postMessage({
type: "refreshOpenAiModels", values: {
baseUrl: apiConfiguration?.openAiBaseUrl,
apiKey: apiConfiguration?.openAiApiKey
}
})
}, [apiConfiguration?.openAiBaseUrl, apiConfiguration?.openAiApiKey])
useEffect(() => {