Bryley/neoai.nvim

Where to paste "open_api_key_env" in LazyVim!?

jjaimealeman opened this issue · 2 comments

image

I'm not sure where exactly to place open_api_key_env = "**********" while using Lazy.nvim.

At first I had it here:

  config = function()
    require("neoai").setup({
      -- Options go here
      open_api_key_env = "**********",
    })

But that shows the attached image error.

Currently the plugin only supports reading the OpenAI API key from environment variables that way you can keep secrets out of your configuration.

That config option is meant to be what environment variable contains the key (by default OPENAI_API_KEY).

For example using the default plugin config you can use

$ OPENAI_API_KEY=***** nvim

To get up and running quickly.
You can also permanently update the key depending on what shell you're using, there are different ways of setting the environment variable usually typing something like:

export OPENAI_API_KEY=**********

Inside your .bashrc or .zshrc file.

I hope that helps. 👍

I almost had it right - just had to remove the " " double-quotes!

It is working wonderfully!
Thank you!