Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
language_models: Prevent sending the tools object to unsupported models for Ollama (#37221)
Umesh Yadav63b3839a8398
diff --git a/crates/language_models/src/provider/ollama.rs b/crates/language_models/src/provider/ollama.rsindex 3f2d47fba35..8975115d907 100644--- a/crates/language_models/src/provider/ollama.rs+++ b/crates/language_models/src/provider/ollama.rs@@ -347,7 +347,11 @@ impl OllamaLanguageModel {.model.supports_thinking.map(|supports_thinking| supports_thinking && request.thinking_allowed),- tools: request.tools.into_iter().map(tool_into_ollama).collect(),+ tools: if self.model.supports_tools.unwrap_or(false) {+ request.tools.into_iter().map(tool_into_ollama).collect()+ } else {+ vec![]+ },}}}