jackMort / ChatGPT.nvim

ChatGPT Neovim Plugin: Effortless Natural Language Generation with OpenAI's ChatGPT API
Apache License 2.0
3.64k stars 312 forks source link

Error with LazyVim (diff than just Lazy.nvim) #261

Closed r3k2 closed 1 year ago

r3k2 commented 1 year ago

Hello I have on my lua/plugins/chatgpt.lua

return {
  "jackMort/ChatGPT.nvim",
  event = "VeryLazy",
  config = function()
    require("chatgpt").setup({
      api_key_cmd = "gopass show -o -f chatgpt/apikey",
    })
  end,
  dependencies = {
    "MunifTanjim/nui.nvim",
    "nvim-lua/plenary.nvim",
    "nvim-telescope/telescope.nvim",
  },
  keys = {
    { "<leader>Cc", "<cmd>ChatGPT<cr>", desc = "ChatGPT" },
  },
}

but when I do :ChatGPTRun errors out with:

Error executing Lua callback: ...vim/lazy/ChatGPT.nvim/lua/chatgpt/flows/actions/init.lua:59: attempt to index local 'item' (a nil value)
stack traceback:
    ...vim/lazy/ChatGPT.nvim/lua/chatgpt/flows/actions/init.lua:59: in function 'run_action'
    ...rek2/.local/share/nvim/lazy/ChatGPT.nvim/lua/chatgpt.lua:46: in function 'run_action'
    ...2/.local/share/nvim/lazy/ChatGPT.nvim/plugin/chatgpt.lua:14: in function <...2/.local/share/nvim/lazy/ChatGPT.nvim/plugin/chatgpt.lua:13>
wakatara commented 10 months ago

@r3k2

Do you mind me asking what you did to fix this?

I have precisely the same error in my neovim, so quite curious as to what you did to fix this (and only with ChatGPT Run) since I assume you puzzled it out since you both opened and closed the ticket... =] (like you, I'm using gopass to handle the secrets as well... =] ).

I'm assuming it is something with one of my setup configs but unsure where my config might have gone wrong or be conflicting here.

thanks!

desirelabs commented 9 months ago

Hello, for those who are passing here (@wakatara), the command ChatGPTRun is expecting a command to run after. Just space tab to see the available ones.