ChatGPT.nvim icon indicating copy to clipboard operation
ChatGPT.nvim copied to clipboard

Warning when using `api_key_cmd`

Open wilbrijo opened this issue 1 year ago • 3 comments

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

wilbrijo avatar Jun 07 '24 19:06 wilbrijo

have the second issue as well...

maxpetretta avatar Jun 14 '24 03:06 maxpetretta

same here!

fabmorais avatar Jun 20 '24 14:06 fabmorais

I saw this when trying to use pass. I was setting the OPENAI_API_KEY in my lua plugin but haven't needed to do that now. See if any of this helps.. https://github.com/jackMort/ChatGPT.nvim/issues/454

MrCee avatar Jul 12 '24 05:07 MrCee