diff --git a/lua/gemini/api.lua b/lua/gemini/api.lua index d38e8cb..aab4285 100644 --- a/lua/gemini/api.lua +++ b/lua/gemini/api.lua @@ -74,23 +74,15 @@ function M.get_response(prompt, context, callback) local contents = create_contents(prompt, context) local payload = vim.json.encode({contents = contents}) - -- Fix URL construction - properly format the URL with model and API key local url = string.format( config.options.api_url .. "?key=%s", config.options.model, api_key ) - -- Debug output - print("URL:", url) - print("Payload:", payload) - local request = http.Request.new(url, payload) request:execute(function(result, error) if error then - vim.schedule(function() - print("Error:", error) -- Add more debug output - end) callback(nil, error) return end