From c32a484481676bb0c38af8829a01e1ac8e02f072 Mon Sep 17 00:00:00 2001 From: Jonas Widen Date: Mon, 17 Mar 2025 07:24:11 +0100 Subject: [PATCH] debug completion --- lua/gemini/api.lua | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lua/gemini/api.lua b/lua/gemini/api.lua index 731f178..05f8efb 100644 --- a/lua/gemini/api.lua +++ b/lua/gemini/api.lua @@ -87,13 +87,21 @@ function M.get_response(prompt, context, callback) return end - local payload = vim.json.encode({contents = contents}) + local payload = vim.json.encode({ + contents = contents, + generationConfig = { + temperature = 0.1, + topK = 1, + topP = 1, + maxOutputTokens = 2048, + } + }) + -- Correctly format the URL with model and API key local url = string.format( - config.options.api_url .. "?key=%s", - config.options.model, - api_key - ) + config.options.api_url, + config.options.model + ) .. "?key=" .. api_key local request = http.Request.new(url, payload) request:execute(function(result, error)