This PR implements a cleaner version of using GPT 3.5/4 directly, and also has support for leveraging OpenAI functions if the use_openai_functions_for_edits config option is set to true (default is false).
On the whole, using OpenAI functions works well, however, there are some edge cases where parsing out the function arguments throws JSON parsing errors -- I tried for awhile to figure out the escaping magic to get it to behave in all cases, but so far have not had luck. Perhaps another set of eyes could help with that...
This is a mostly working solution, which greatly expands upon the work started at https://github.com/jackMort/ChatGPT.nvim/pull/249
This PR implements a cleaner version of using GPT 3.5/4 directly, and also has support for leveraging OpenAI functions if the
use_openai_functions_for_edits
config option is set totrue
(default isfalse
).On the whole, using OpenAI functions works well, however, there are some edge cases where parsing out the function arguments throws JSON parsing errors -- I tried for awhile to figure out the escaping magic to get it to behave in all cases, but so far have not had luck. Perhaps another set of eyes could help with that...