mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 04:11:10 -05:00
Merge pull request #241 from samhvw8/fix/list-model-openai-compatible
fix(openai-compatible) fix load model when change baseUrl
This commit is contained in:
@@ -522,9 +522,10 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
||||
await this.refreshOpenRouterModels()
|
||||
break
|
||||
case "refreshOpenAiModels":
|
||||
const { apiConfiguration } = await this.getState()
|
||||
const openAiModels = await this.getOpenAiModels(apiConfiguration.openAiBaseUrl, apiConfiguration.openAiApiKey)
|
||||
if (message?.values?.baseUrl && message?.values?.apiKey) {
|
||||
const openAiModels = await this.getOpenAiModels(message?.values?.baseUrl, message?.values?.apiKey)
|
||||
this.postMessageToWebview({ type: "openAiModels", openAiModels })
|
||||
}
|
||||
break
|
||||
case "openImage":
|
||||
openImage(message.text!)
|
||||
|
||||
@@ -59,6 +59,7 @@ export interface WebviewMessage {
|
||||
toolName?: string
|
||||
alwaysAllow?: boolean
|
||||
dataUrls?: string[]
|
||||
values?: Record<string, any>
|
||||
}
|
||||
|
||||
export type ClineAskResponse = "yesButtonClicked" | "noButtonClicked" | "messageResponse"
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user