From 18b4d06508beb497f25e2486ec2c9fa1ffd7ee2f Mon Sep 17 00:00:00 2001 From: Jonas Widen Date: Sun, 16 Mar 2025 14:22:53 +0100 Subject: [PATCH] Fixed issues --- lua/gemini/api.lua | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/lua/gemini/api.lua b/lua/gemini/api.lua index 5b811b5..2843f79 100644 --- a/lua/gemini/api.lua +++ b/lua/gemini/api.lua @@ -29,20 +29,7 @@ local function make_request(prompt) return nil end - -- List models first to verify available options - local list_models_command = string.format( - "curl -s 'https://generativelanguage.googleapis.com/v1/models?key=%s'", - api_key - ) - - local models_result = vim.fn.system(list_models_command) - local success, models_data = pcall(vim.json.decode, models_result) - - if success and models_data.models then - vim.notify("Available models: " .. vim.inspect(models_data.models), vim.log.levels.DEBUG) - end - - local model = "gemini-1.0-pro" -- Updated model name + local model = "gemini-2.0-flash" -- Updated to an available model local payload = vim.json.encode({ contents = { { @@ -58,7 +45,6 @@ local function make_request(prompt) -- Escape the payload for shell payload = vim.fn.shellescape(payload) - -- Updated API endpoint URL with v1 path local command = string.format( "curl -s -X POST " .. "'https://generativelanguage.googleapis.com/v1/models/%s:generateContent?key=%s' "