Fix an issue where provider settings were lost when switching between Ollama models (#13402)

Closes #13399.

Release Notes:

- Fixed an issue where provider settings were lost when switching
between Ollama models
([#13399](https://github.com/zed-industries/zed/issues/13399)).
This commit is contained in:
ᴀᴍᴛᴏᴀᴇʀ 2024-06-25 23:58:13 +08:00 committed by GitHub
parent 890443241d
commit 7e694d1bcf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -326,6 +326,14 @@ impl AssistantSettingsContent {
*model = Some(new_model);
}
}
Some(AssistantProviderContent::Ollama {
default_model: model,
..
}) => {
if let LanguageModel::Ollama(new_model) = new_model {
*model = Some(new_model);
}
}
provider => match new_model {
LanguageModel::Cloud(model) => {
*provider = Some(AssistantProviderContent::ZedDotDev {