jackMort / ChatGPT.nvim

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

Warning when using `api_key_cmd` #443

Open wilbrijo opened 3 weeks ago

wilbrijo commented 3 weeks ago

I'm using the op option to set api_key_cmd. There are two issues I'm running in to, however.

  1. Every time I open nvim, I get a warning that OPENAI_API_KEY is not set.
  2. I'm immediately asked to authenticate with 1Password, even though I haven't loaded the plugin. I thought since event = "VeryLazy", this should only load when I actually run chatgpt command.
    I'm obviously doing something wrong, as no one else has posted about this issue. I'm just not sure what it is.
return {
    "jackMort/ChatGPT.nvim",
    event = "VeryLazy",
    config = function()
        require("chatgpt").setup({
            api_key_cmd = "op read op://private/OpenAI/credential --no-newline",
            api_model = "gpt-4-turbo",
        })
    end,
    dependencies = {
        "MunifTanjim/nui.nvim",
        "nvim-lua/plenary.nvim",
        "folke/trouble.nvim",
        "nvim-telescope/telescope.nvim",
    },
}
Screenshot 2024-06-07 at 3 06 35 PM
maxpetretta commented 2 weeks ago

have the second issue as well...

fabmorais commented 1 week ago

same here!