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

Remove OPENAI_API_KEY warning #245

Closed ghaerdi closed 8 months ago

ghaerdi commented 1 year ago

I'm using api_key_cmd to set my key but I'm getting this warning, is there any way to remove this warning? image

KapJ1coH commented 11 months ago

Have you managed to remove it?

dodotronix commented 11 months ago

Hi, i had that issue, because i copy-pasted the installation snippet from the README and did not notice, that there is following setting in the installation guideline:

...
config = function()
      require("chatgpt").setup()
    end
...

The way i do configure my neovim is setting up all the plugins after i launch the plugin manager. In this case, first configuration did not have my api_key_cmd set, so i got that warning, but right after that my custom setup require for chatgpt plugin launched with the api_key_cmd set and everything worked except, there was the warning message. When i removed the config line in the lazy manager snippet, it solved that issue.