From 3d8e3134e9adb956e6d975a3e6094562b7ef1f9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Wed, 8 Apr 2026 22:32:30 +0200 Subject: [PATCH] change model for imac --- lua/plugins/codecompanion.lua | 39 +++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/lua/plugins/codecompanion.lua b/lua/plugins/codecompanion.lua index 852b1a8..2ae4ac1 100644 --- a/lua/plugins/codecompanion.lua +++ b/lua/plugins/codecompanion.lua @@ -30,7 +30,8 @@ return { }, schema = { model = { - default = "gemini-1.5-pro", -- oder "gemini-1.5-flash" + --default = "gemini-2.5-flash", -- oder "gemini-1.5-flash" + default = "gemma-2-2b-it-Q8_0", }, }, }) @@ -41,11 +42,41 @@ return { -- Jetzt sagen wir den Strategien, wo sie suchen sollen: -- Der Pfad ist intern nun "http.my_imac" opts.strategies = { - chat = { adapter = nil }, - inline = { adapter = nil }, - agent = { adapter = nil }, + chat = { adapter = "my_gemini" }, + inline = { adapter = "my_gemini" }, + agent = { adapter = "my_gemini" }, + } + opts.prompt_library = { + ["Generate Commit Message"] = { + strategy = "chat", + description = "Erstellt eine Commit-Message basierend auf den Staged Changes", + opts = { + index = 1, + is_default = true, + is_slash_cmd = true, -- Erlaubt /commit im Chat + short_name = "commit", + auto_submit = true, + }, + prompts = { + { + role = "system", + content = "Write a concise commit message in Conventional Commits format based on the diff provided. Use present tense. Do not use wordy explanations.", + }, + { + role = "user", + content = function() + return "Hier ist der Diff der gestageden Änderungen:\n\n```diff\n" + .. vim.fn.system "git diff --staged" + .. "\n```" + end, + }, + }, + }, } return opts end, + keys = { + { "gc", "CodeCompanion /commit", desc = "AI Generate Commit Message" }, + }, }