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)