branch: externals/ellama
commit b2310817a5404ee983b4f3901b7ee0c7a64353b2
Author: Sergey Kostyaev <sskosty...@gmail.com>
Commit: Sergey Kostyaev <sskosty...@gmail.com>

    Check if llm-ollama-p is defined before using it
    
    Added check for function existence to avoid errors when llm-ollama-p is not
    available.
    This ensures the code gracefully handles cases where the function might not 
be
    defined.
    
    Fix #319
---
 ellama-transient.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ellama-transient.el b/ellama-transient.el
index 458110be48..f000677c60 100644
--- a/ellama-transient.el
+++ b/ellama-transient.el
@@ -171,7 +171,8 @@ Otherwise, prompt the user to enter a system message."
   (declare-function llm-ollama-chat-model "ext:llm-ollama")
   (declare-function llm-ollama-default-chat-temperature "ext:llm-ollama")
   (declare-function llm-ollama-default-chat-non-standard-params 
"ext:llm-ollama")
-  (when (llm-ollama-p provider)
+  (when (and (fboundp 'llm-ollama-p)
+             (llm-ollama-p provider))
     (setq ellama-transient-ollama-model-name (llm-ollama-chat-model provider))
     (setq ellama-transient-temperature (or 
(llm-ollama-default-chat-temperature provider) 0.7))
     (setq ellama-transient-host (llm-ollama-host provider))

Reply via email to