mirror of
https://github.com/macocianradu/setup.git
synced 2026-03-18 21:00:04 +00:00
Added env key for webui
This commit is contained in:
@@ -5,11 +5,12 @@ require('codecompanion').setup({
|
||||
return require("codecompanion.adapters").extend("openai_compatible", {
|
||||
env = {
|
||||
url = "https://openwebui.estatecloud.org",
|
||||
api_key = os.getenv("OPENWEBUI_API_KEY"),
|
||||
chat_url = "/api/chat/completions",
|
||||
},
|
||||
schema = {
|
||||
model = {
|
||||
default = "deepseek-coder:6.7b", -- Use the exact model name from your PC
|
||||
default = "qwen3.5:9b", -- Use the exact model name from your PC
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -25,12 +26,35 @@ require('codecompanion').setup({
|
||||
end
|
||||
}
|
||||
},
|
||||
strategies = {
|
||||
chat = {
|
||||
adapter = "webui",
|
||||
tools = {
|
||||
["cmd_runner"] = { auto_submit_errors = true },
|
||||
["editor"] = { auto_submit_success = false },
|
||||
["files"] = { auto_submit_success = true }
|
||||
}
|
||||
},
|
||||
agent = {
|
||||
adapter = "webui",
|
||||
},
|
||||
opts = {
|
||||
system_prompt = [[
|
||||
You are an expert coding assistant operating in agent mode.
|
||||
When asked about files or code, ALWAYS use the available tools to:
|
||||
- Read files with the `files` tool before answering questions about them
|
||||
- Use the `editor` tool to read the current buffer
|
||||
- Use `cmd_runner` to run tests or shell commands when relevant
|
||||
Never ask the user to paste file contents — fetch them yourself using tools.
|
||||
]],
|
||||
}
|
||||
},
|
||||
interactions = {
|
||||
chat = {
|
||||
adapter = "codex",
|
||||
model = "gpt-5",
|
||||
adapter = "webui",
|
||||
model = "qwen3.5:9b",
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
vim.keymap.set('n', '<leader>gpt', function(opts) require("codecompanion").chat(opts) end);
|
||||
vim.keymap.set('n', '<leader>gpt', function() require("codecompanion").chat({strategy = "agent" }) end);
|
||||
|
||||
Reference in New Issue
Block a user