karthink/gptel

Per-gptel-buffer contexts

Opened this issue · 1 comments

Describe the solution you'd like
I like to define sets of files/buffers as context, and it would be convenient to have a gptel buffer correspond to a particular set of files as context. So I could have * Claude (No Context) * buffer, * Claude (Project A1) * buffer, *Claude Project A2* ,etc.

Describe alternatives you've considered
An easy way to clear the whole gptel context, plus user defined (gptel-add-file file) functions would serve a similar purpose. I'm not sure how to easily remove all items currently in the context.

Additional context
Thanks for creating and maintaining gptel!

I think I understand what you mean. Let's call it the "buffer-local context sets" feature, because you can have independent sets of context. This feature makes sense in the abstract, but not in the details. Here's why I think it's under-specified:

  1. Suppose you visit some buffer, select a region and run gpel-add to add it to the context.

    • Which gptel buffer's context (context set) should this be added to?
    • How about when there is no chat buffer? gptel is usable in any buffer, and most of the time I don't use a chat buffer.
  2. Same question as 1, but for when you run gptel-add in a dired buffer to add a file.

  3. Suppose you run gptel-add-file, either from the transient menu or via M-x. This command can be run in any buffer. Which context set should it be added to?

I imagine what you're describing is actually "project-local context sets", not "buffer-local context sets". Now each project (as managed by project.el or projectile) has an independent gptel context, and any of the above actions 1-3 will add the region/buffer/file to its project's context. In this case, what happens when you run/want to include a region/buffer/file in project A's context that does not belong to project A?