Skip to content

Conversation

@alizdavoodi
Copy link
Contributor

Hey,
In this MR, I am introducing a new dependency called https://github.com/nvim-lua/plenary.nvim. Plenary is a highly useful plugin with a variety of functions that simplifies the module.

Changes contains:

  1. Rewrite the curl part of the code using the Plenary package: The previous curl implementation has been updated to use the Plenary.curl module.
  2. Add cancel stream functionality: A new function named cancel_stream has been added to the OpenAI model. This function enables users to cancel the current stream and gracefully shut down the handler. This additional functionality provides better control and an improved user experience.(Additionally, there is a new keybinding Ctrl-X to cancel the stream, and if you close the NeoAI window while streaming, the stream will be canceled.)

…sage to properly handle JSON chunks.

2. Added a function to cancel the current stream and shut down the handler in openai.lua.
3. Removed an unnecessary newline in history.lua.
4. Migrated from custom curl implementation to the plenary curl module for better functionality and streamlined code.
5. Added a mapping in ui.lua to cancel the stream using the new cancel_stream() function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant