unit-mesh / auto-dev

🧙‍AutoDev: The AI-powered coding wizard(AI 驱动编程助手) with multilingual support 🌐, auto code generation 🏗️, and a helpful bug-slaying assistant 🐞! Customizable prompts 🎨 and a magic Auto Dev/Testing/Document/Agent feature 🧪 included! 🚀
https://ide.unitmesh.cc/
Mozilla Public License 2.0
2.72k stars 314 forks source link

openAI custom model not work expected #119

Closed iptton closed 5 months ago

iptton commented 5 months ago

Describe the bug openAI custom model not work as expected

To Reproduce Steps to reproduce the behavior:

  1. set custom openai model
  2. chat in chat panel
  3. reopen setting panel, the openAI model will reset from custom to gpt-3.5-turbo

Expected behavior setting stay "custom"

relate code:

        get() {
            val customModel = AutoDevSettingsState.getInstance().customModel
            if(AutoDevSettingsState.getInstance().openAiModel == SELECT_CUSTOM_MODEL) {
                AutoDevSettingsState.getInstance().openAiModel = customModel
            }
            return  AutoDevSettingsState.getInstance().openAiModel
        }

will reset openAIModel to a unknow value

https://github.com/unit-mesh/auto-dev/commit/e001c12d54ee01b0dcf5ede6b01fa1a4d7891c35