assistant panel: Show provider name in model selector (#15523)

With zed.dev provider becoming more popular, it helps alleviate
confusion when showing not only the model name but also the provider
name.

Release Notes:

- N/A
This commit is contained in:
Thorsten Ball 2024-07-31 11:05:16 +02:00 committed by GitHub
parent 8e6af73784
commit d8f7322725
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2787,7 +2787,13 @@ impl Render for ContextEditorToolbarItem {
Label::new(
LanguageModelRegistry::read_global(cx)
.active_model()
.map(|model| model.name().0)
.map(|model| {
format!(
"{}: {}",
model.provider_name().0,
model.name().0
)
})
.unwrap_or_else(|| "No model selected".into()),
)
.size(LabelSize::Small)