--[ -- Basic LLM completion. --] return { "David-Kunz/gen.nvim", enabled = false, cmd = { "Gen" }, opts = { host = "box.ache.one", -- The host running the Ollama service. port = "1080", -- The port on which the Ollama service is listening. quit_map = "q", -- set keymap for close the response window retry_map = "wc-rw", -- set keymap to re-send the current prompt init = function(_) -- pcall(io.popen, "ollama serve > /dev/null 2>&1 &") end, -- Function to initialize Ollama command = function(options) local body = { model = options.model, stream = true } return "curl -u 'cecca:rouge_et_hedy<3' --basic --silent --no-buffer -X POST https://" .. options.host .. ":" .. options.port .. "/ollama/api/chat -d $body" end, -- The command for the Ollama service. You can use placeholders $prompt, $model and $body (shellescaped). -- This can also be a command string. -- The executed command must return a JSON object with { response, context } -- (context property is optional). -- list_models = '', -- Retrieves a list of model names display_mode = "float", -- The display mode. Can be "float" or "split" or "horizontal-split". show_prompt = false, -- Shows the prompt submitted to Ollama. show_model = false, -- Displays which model you are using at the beginning of your chat session. no_auto_close = false, -- Never closes the window automatically. debug = false, -- Prints errors and the command which is run. }, config = function(_, opts) local gen = require("gen") gen.setup(opts) gen.prompts["Complete"] = { prompt = "$text", replace = true, } gen.prompts["Improove"] = { prompt = "Améliore ce texte de manière à le rendre formel mais amical:\n\n$text\n", -- replace = true, model = "MathiasB/llama3fr:latest", } end, }