jackMort / ChatGPT.nvim

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

error when editing code #285

Closed eyalk11 closed 9 months ago

eyalk11 commented 1 year ago

Whenever I try editing mode, I get the following:

// API ERROR: 'instruction' is a required property

I use a slightly changed version(with log). Is it familiar?

nikbrunner commented 1 year ago

I get the same error when using edit_with_instructions

image
DennisTheMenace780 commented 1 year ago

I have the same problem, not quite sure what this means.

ben-wall commented 1 year ago

Same here would love a fix if possible please, this is when using

use({
  "jackMort/ChatGPT.nvim",
    config = function()
      require("chatgpt").setup()
    end,
    requires = {
      "MunifTanjim/nui.nvim",
      "nvim-lua/plenary.nvim",
      "nvim-telescope/telescope.nvim"
    }
})

and typing something into the input box and pressing enter

nicolimo86 commented 11 months ago

it happens to me when i summarize some code, then i try to further ask questions in the text box about the code. If I inspect :messages I see this: Edit models are deprecated

nicolimo86 commented 11 months ago

I figured it out on my side. I had to change the model from code-davinci-edit-001o to gpt-3.5-turbo for the edit_with_instructions functionality: I went from this:

openai_edit_params = {
      model = "code-davinci-edit-001o",
      temperature = 0,
      top_p = 1,
      n = 1,
    },

to this:

openai_edit_params = {
      model = "gpt-3.5-turbo",
      temperature = 0,
      top_p = 1,
      n = 1,
    },
ekaj2 commented 11 months ago

Yes and if you already have it configured, try:

to open the settings panel and hit enter on the model to change it manually.
jackMort commented 9 months ago

please reopen if issue still exists in newest version