This commit is contained in:
2026-08-05 17:50:37 -04:00
parent 17c37168f4
commit 713de225f6
+20 -21
View File
@@ -2,34 +2,33 @@ vim.pack.add({
{ src = "https://github.com/milanglacier/minuet-ai.nvim" }, { src = "https://github.com/milanglacier/minuet-ai.nvim" },
}) })
local function opencode_go_api_key()
local ok, lines = pcall(vim.fn.readfile, vim.fn.expand("~/.local/share/opencode/auth.json"))
if not ok then
return nil
end
local ok_decode, auth = pcall(vim.fn.json_decode, table.concat(lines, "\n"))
if not ok_decode or not auth["opencode-go"] or not auth["opencode-go"].key then
return nil
end
return auth["opencode-go"].key
end
local function setup_minuet() local function setup_minuet()
pcall(require("minuet").setup, { pcall(require("minuet").setup, {
provider = "openai_compatible", provider = "openai_fim_compatible",
n_completions = 1,
context_window = 2048,
request_timeout = 2.5, request_timeout = 2.5,
throttle = 1500, throttle = 600,
debounce = 600, debounce = 250,
provider_options = { provider_options = {
openai_compatible = { openai_fim_compatible = {
api_key = opencode_go_api_key, api_key = "TERM",
end_point = "https://opencode.ai/zen/go/v1/chat/completions", name = "Llama.cpp",
model = "deepseek-v4-flash", end_point = "http://localhost:8012/v1/completions",
name = "Opencode", model = "PLACEHOLDER",
optional = { optional = {
max_tokens = 56, max_tokens = 56,
top_p = 0.9, top_p = 0.9,
thinking = { type = "disabled" }, },
template = {
prompt = function(context_before_cursor, context_after_cursor, _)
return "<|fim_prefix|>"
.. context_before_cursor
.. "<|fim_suffix|>"
.. context_after_cursor
.. "<|fim_middle|>"
end,
suffix = false,
}, },
}, },
}, },