branch: externals/ellama commit b467c269133f5f2e38e994d1fddba2128b73f5b2 Author: Tobias Tschinkowitz <m...@zibebe.net> Commit: Tobias Tschinkowitz <m...@zibebe.net>
Add coding-provider and update documentation --- README.org | 7 +++++++ ellama.el | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index a47c621b5a..48c40e50ff 100644 --- a/README.org +++ b/README.org @@ -53,6 +53,11 @@ In that case you should customize ellama configuration like this: :chat-model "qwen2.5:3b" :embedding-model "nomic-embed-text" :default-chat-non-standard-params '(("num_ctx" . 32768)))) + (setopt ellama-coding-provider + (make-llm-ollama + :chat-model "qwen2.5-coder:3b" + :embedding-model "nomic-embed-text" + :default-chat-non-standard-params '(("num_ctx" . 32768)))) ;; Predefined llm providers for interactive switching. ;; You shouldn't add ollama providers here - it can be selected interactively ;; without it. It is just example. @@ -339,6 +344,8 @@ argument generated text string. - ~ellama-chat-translation-enabled~: Enable chat translations if set. - ~ellama-translation-provider~: LLM translation provider. ~ellama-provider~ will be used if not set. +- ~ellama-coding-provider~: LLM coding tasks provider. + ~ellama-provider~ will be used if not set. - ~ellama-summarization-provider~ LLM summarization provider. ~ellama-provider~ will be used if not set. - ~ellama-show-quotes~: Show quotes content in chat buffer. Disabled diff --git a/ellama.el b/ellama.el index 7406f24a18..1a27803080 100644 --- a/ellama.el +++ b/ellama.el @@ -97,6 +97,11 @@ :group 'ellama :type '(sexp :validate 'llm-standard-provider-p)) +(defcustom ellama-coding-provider nil + "LLM provider for coding tasks." + :group 'ellama + :type '(sexp :validate 'llm-standard-provider-p)) + (defcustom ellama-providers nil "LLM provider list for fast switching." :group 'ellama @@ -1778,7 +1783,8 @@ the full response text when the request completes (with BUFFER current)." (diff (or (ellama--diff-cached) (ellama--diff)))) (ellama-stream - (format ellama-generate-commit-message-template diff))))) + (format ellama-generate-commit-message-template diff) + :provider ellama-coding-provider)))) ;;;###autoload (defun ellama-ask-line () @@ -1866,7 +1872,8 @@ ARGS contains keys for fine control. (let ((text (if (region-active-p) (buffer-substring-no-properties (region-beginning) (region-end)) (buffer-substring-no-properties (point-min) (point-max))))) - (ellama-instant (format ellama-code-review-prompt-template text)))) + (ellama-instant (format ellama-code-review-prompt-template text) + :provider ellama-coding-provider))) ;;;###autoload (defun ellama-change (change &optional edit-template) @@ -1930,6 +1937,7 @@ prefix (\\[universal-argument]), prompt the user to amend the template." (format ellama-code-edit-prompt-template change text) + :provider ellama-coding-provider :filter #'ellama--code-filter :point beg))) @@ -1949,6 +1957,7 @@ prefix (\\[universal-argument]), prompt the user to amend the template." (format ellama-code-improve-prompt-template text) + :provider ellama-coding-provider :filter #'ellama--code-filter :point beg))) @@ -1967,6 +1976,7 @@ prefix (\\[universal-argument]), prompt the user to amend the template." (format ellama-code-complete-prompt-template text) + :provider ellama-coding-provider :filter #'ellama--code-filter :point end))) @@ -1987,6 +1997,7 @@ buffer." (format ellama-code-add-prompt-template text description) + :provider ellama-coding-provider :filter #'ellama--code-filter)))