Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

ollama: Add button for refreshing available models (#38181)

tidely12d71b37bbf7
diff --git a/crates/language_models/src/provider/ollama.rs b/crates/language_models/src/provider/ollama.rs
index 2150966c1af..6341baa6f36 100644
--- a/crates/language_models/src/provider/ollama.rs
+++ b/crates/language_models/src/provider/ollama.rs
@@ -906,6 +906,16 @@ impl Render for ConfigurationView {
.child(Icon::new(IconName::Check).color(Color::Success))
.child(Label::new("Connected"))
.into_any_element(),
+ )
+ .child(
+ IconButton::new("refresh-models", IconName::RotateCcw)
+ .tooltip(Tooltip::text("Refresh models"))
+ .on_click(cx.listener(|this, _, _, cx| {
+ this.state.update(cx, |state, _| {
+ state.fetched_models.clear();
+ });
+ this.retry_connection(cx);
+ })),
),
)
} else {