Closed DennisTheMenace780 closed 7 months ago
A plugin update a couple of months ago made some changes to api_key_cmd
. I believe tilde expansion doesn't work anymore (https://github.com/jackMort/ChatGPT.nvim/issues/220).
Have you tried something along the lines of api_key_cmd = "gpg --decrypt " .. vim.fn.expand("$HOME") .. "/openai_trial_key.txt.gpg"
instead?
Interesting, i'll try this out and see what comes of it!
A plugin update a couple of months ago made some changes to
api_key_cmd
. I believe tilde expansion doesn't work anymore (#220).Have you tried something along the lines of
api_key_cmd = "gpg --decrypt " .. vim.fn.expand("$HOME") .. "/openai_trial_key.txt.gpg"
instead?
Thank you, @stekern , after hours of trying to get this to work, you really came through!!
for anyone using lazy.lua, this works just dropped into your init.lua:
{
"jackMort/ChatGPT.nvim",
event = "VeryLazy",
config = function()
require("chatgpt").setup({
api_key_cmd = "gpg --quiet --batch --decrypt " .. vim.fn.expand("$HOME") .. "/yourencryptedfile.txt.gpg",
})
end,
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"folke/trouble.nvim",
"nvim-telescope/telescope.nvim"
}
},
I'm receiving the above error when trying to use my OpenAI API key. I've provided a series of steps below that emulate what I am doing in my own setup. Note that I am using the free version of the OpenAI trial key, just for purposes of experimentation before I buy a GPT4 license.
1. Set up of the plugin:
2. How I have created my trial key:
So everything seems to be set up properly, but there are two things I am thinking might be a problem here:
secret
, but that seems silly to me.