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

`code-davinci-edit-001` is deprecated, `ChatGPTEditWithInstructions` doesn't work anymore #368

Open traysh opened 6 months ago

traysh commented 6 months ago

Starting today, when I run ChatGPTEditWithInstructions, I get an error message:

// API ERROR: The model `text-davinci-003` has been deprecated, learn more
here: https://platform.openai.com/docs/deprecations

The error message seems wrong, as text-davinci-003 is not used in ChatGPT.nvim. Nonetheless, the command fails and the deprecations URL the error refers to points code-davinci-edit-001 was to be shutdown at 2024-01-04. The recommended replacement is GPT-4, but that might increase the costs (I didn't check).

traysh commented 6 months ago

just found the model text-davinci-003 is the one actually used in the code, in ChatGPT.nvim/lua/chatgpt/flows/code_completions/init.lua

lalewis1 commented 5 months ago

temp workaround is to change that model to gpt-3.5-turbo-instruct works for me.

Msouza91 commented 5 months ago

I changed to the instruct model and at first it worked for me, but now I am getting some API errors // API ERROR: Invalid URL (POST /v1/edits)

Msouza91 commented 5 months ago

@lalewis1 Did you just change the model reference on the ^-o settings screen? Mine only works if I set it to a GPT-4 model which is considerably more expensive relative to 3.5-turbo

lalewis1 commented 5 months ago

Sorry, should have mentioned that.

I changed this line https://github.com/jackMort/ChatGPT.nvim/blob/main/lua%2Fchatgpt%2Fflows%2Fcode_completions%2Finit.lua#L55

From: model = "text-davinci-003", To: model = "gpt-3.5-turbo-instruct",

If you are using Lazy the source files should be under ~/.local/share/nvim/lazy/chatgpt/...

Or at least that's where they are on my Linux machine. Might be different on Windows.

kaka-ruto commented 3 months ago

Can this be closed as it seems to have been fixed by https://github.com/jackMort/ChatGPT.nvim/pull/373

lalewis1 commented 3 months ago

yeah that's correct.