Skip to content

Commit d4eee77

Browse files
author
ippan
committed
fix(core): openAI custom model not work as expected
close #119
1 parent 44d6d79 commit d4eee77

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/kotlin/cc/unitmesh/devti/llms/openai/OpenAIProvider.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ class OpenAIProvider(val project: Project) : LLMProvider {
3535
private val timeout = Duration.ofSeconds(defaultTimeout)
3636
private val openAiVersion: String
3737
get() {
38-
val customModel = AutoDevSettingsState.getInstance().customModel
39-
if(AutoDevSettingsState.getInstance().openAiModel == SELECT_CUSTOM_MODEL) {
40-
AutoDevSettingsState.getInstance().openAiModel = customModel
38+
val model = AutoDevSettingsState.getInstance().openAiModel
39+
if(model == SELECT_CUSTOM_MODEL) {
40+
return AutoDevSettingsState.getInstance().customModel
4141
}
42-
return AutoDevSettingsState.getInstance().openAiModel
42+
return model
4343
}
4444
private val openAiKey: String
4545
get() = AutoDevSettingsState.getInstance().openAiKey

0 commit comments

Comments
 (0)