jackMort / ChatGPT.nvim

ChatGPT Neovim Plugin: Effortless Natural Language Generation with OpenAI's ChatGPT API
Apache License 2.0
3.56k stars 307 forks source link

Changing model in lua configuration does not have any effect #356

Closed lukeemhigh closed 6 months ago

lukeemhigh commented 6 months ago

I'm trying to change gpt model to gpt-4, but nothing seems to happen.

Here's my config for ChatGPT.nvim:

return {
  {
    "jackMort/ChatGPT.nvim",
    event = "VeryLazy",
    config = function()
      require("chatgpt").setup {
        api_key_cmd = "gpg --decrypt /path/to/my/supersecret_openai_api_key.gpg",
        openai_params = {
          model = "gpt-4",
          max_tokens = 8192,
        },
        openai_edit_params = {
          model = "gpt-4-1106-preview",
          max_tokens = 128000,
        },
      }
    end,
    dependencies = {
      "MunifTanjim/nui.nvim",
      "nvim-lua/plenary.nvim",
      "nvim-telescope/telescope.nvim",
    },
  },
}

I do pay for a subscription, so this is not an API problem.

When asked to report the gpt model, ChatGPT reports that I'm still interacting with gpt-3.

On the other hand, I was able to switch to gpt-4-1106-preview in ChatGPTEditWithInstructions mode by editing the options on the go with <C-o>, but changing it in the lua config does not seem to have any effect on the plugin.

Am I missing something?

Aaronik commented 6 months ago

Is that your actual api_key_cmd? You might want to remove that line if you have OPENAI_API_KEY set in your env

lukeemhigh commented 6 months ago

Is that your actual api_key_cmd? You might want to remove that line if you have OPENAI_API_KEY set in your env

No worries, that's not my actual api_key_cmd and I do type in my passphrase manually 😃

In fact I managed to make it work by switching both models to the same one. I verified by asking GPT some questions that should have different answers when replied by gpt-3.5-turbo and gpt-4 due to the difference in training data.

cd-a commented 5 months ago

this doesn't work at all for me. it always says it's still only with data from 2021 even with latest preview model.