Git Product home page Git Product logo

chatbot-buffer.nvim's People

Contributors

jay-aye-see-kay avatar kukula avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

chatbot-buffer.nvim's Issues

Add a "working buffer" for non-conversation responses to be added to

Adding commands that send a hunk of text for explanation, refactoring, or test writing would be useful. But they'd need a buffer to go to. Probably in the same directory as the conversation buffers.

Unknowns:

  • do we have multiple "working buffers", how are the named and found?
  • do we make it possible to scope a working buffer to a project (given there's no vim-level definition of a project, it's something most users implement themselves to some extent)
  • given the very async nature of ai apis (~10 second responses are normal) do we also exponse a "done" notification somehow?

Use `stream: true` to update buffer as soon as tokens available (like the chatgpt web ui)

curl support the server side events features required for streaming tokens, we just need to handle the format and append to the buffer as they come in. This implementation just worked, but it might be ignore some important data coming in

require("plenary.job")
  :new({
    command = "curl",
    args = { url,
      "-H", "Content-Type: application/json",
      "-H", "Authorization: Bearer " .. key,
      "-d", vim.fn.json_encode({
        model = "gpt-3.5-turbo",
        stream = true,
        messages = {
          { role = "user", content = "Hello" },
        },
      }),
    },
    on_stdout = vim.schedule_wrap(function(_, data)
      local maybeJson = data:sub(7)
      if string.len(maybeJson) > 0 then
        local _, update = pcall(vim.fn.json_decode, maybeJson)
        if update ~= nil then
          print(vim.inspect(update.choices[1]["delta"]["content"]))
        end
      end
    end),
  })
  :start()

Auto name chat files

This requires creating a more thought out file naming scheme, something like YYYY-MM-DD_<num>_<name>.<suffix> where name starts off as "unnamed". Then the name can be set with a function/command. This means we can let the user name a chat file, or turn on auto naming where we ask an ai endpoint to name the chat for us after the nth question / response.

The reason for doing this is to make a list of chat files more meaningful e.g. "I asked about X and Y on Z day - oh there's that code snippets I was looking for".

I'm not sure if I would use the manual naming feature but it's not much extra work to add it in too, and it might be nice sometimes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.