Custom nvim gen command adding https schema

This commit is contained in:
don philipe
2025-02-19 11:21:28 +01:00
parent c9e3b33958
commit be00da9268

View File

@@ -9,5 +9,18 @@ return {
model = vars["model"], model = vars["model"],
host = vars["host"], host = vars["host"],
port = vars["port"], port = vars["port"],
https = vars["https"],
show_prompt = true,
debug = false,
-- https://github.com/David-Kunz/gen.nvim/issues/116
command = function(options)
local body = { model = options.model, stream = true }
local schema = "http"
if options.https then
schema = "https"
end
return "curl --silent --no-buffer -X POST " .. schema .. "://" .. options.host .. ":" .. options.port .. "/api/chat -d $body"
end,
}}, }},
} }