From c076f03da461258b0697aaea7c27bf8885e6b689 Mon Sep 17 00:00:00 2001 From: Jonas Widen Date: Sun, 16 Mar 2025 19:11:09 +0100 Subject: [PATCH] Fixed issues --- lua/gemini/api.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/gemini/api.lua b/lua/gemini/api.lua index 4e2cafa..d38e8cb 100644 --- a/lua/gemini/api.lua +++ b/lua/gemini/api.lua @@ -74,7 +74,7 @@ function M.get_response(prompt, context, callback) local contents = create_contents(prompt, context) local payload = vim.json.encode({contents = contents}) - -- Fix URL construction + -- 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, @@ -88,6 +88,9 @@ function M.get_response(prompt, context, callback) 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