Robitx/gp.nvim

repo_instructions as a config option?

weeksie opened this issue · 3 comments

First off, thanks for an awesome plugin! I'm still learning my way around but it's really fantastic. Best thing I've come across by far.

I'd love a smooth way to hook a rag server into the prompt building process. I suppose I can monkey patch, but it would be nice to be able to hook into the the repo_instructions function call and build the instructions dynamically. (e.g. a call to a RAG server, some sort of prompt construction based on file path, etc.)

I may well be missing something.

I'd leave repo_instructions function as is (static repo instructions via .gp.md file), but yes exposing lets say rag_context function as config option would be easy and potential very useful.

The only non trivial thing is settling on the right signature for this function. Do you have any particular rag server in mind?

Fair go! rag_context would be amazing, I was just poking around and that seemed like one thing I might be able to monkey patch to get something going to hack around with.

I'm running a local custom endpoint/server, so I don't have a good idea of a standard set of api params.

  1. Wouldn't want to blindly make a rag request for every call, so some idea of which command was invoked in which context would be very useful.
  2. As such would probably want access to a lot of the same info that Prompt has, but maybe that's not entirely necessary
  1. I'm currently working on generic @macro support which among other things will allow people to choose arbitrary combination of contexts (@rag, @repo_instructions, @file xy, @link xy etc.) for both chats and commands
  2. rag_context(artifacts), artifacts will be a table into which we'll shove whats available (user command, repo dir, filename, filetype, selection and whatever else will come in the future)