Skip to content

attempt to concatenate field 'OPENAI_API_KEY' (a nil value) #299

@PMassicotte

Description

@PMassicotte

Looks like the last commit (aa8a969) is breaking something.

I am getting this error:

.../.local/share/nvim/lazy/ChatGPT.nvim/lua/chatgpt/api.lua:267: attempt to concatenate field 'OPENAI_API_KEY' (a nil value)  

Api.AUTHORIZATION_HEADER = "Authorization: Bearer " .. Api.OPENAI_API_KEY

FWIW, here is my config:

  config = function()
    local home = vim.fn.expand("$HOME")
    require("chatgpt").setup({
      api_key_cmd = "gpg --decrypt " .. home .. "/openai_api_key.txt.gpg"
    })
  end,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions