jcraane / gpt-mentor-plugin

6 stars 3 forks source link

Add support to select context files #20

Open trehak1 opened 1 year ago

trehak1 commented 1 year ago

Hi! I think it would be very helpful to be able to select "context files" that would be sent with every request. For example when working with Repositories I would select liquibase changelog file and domain files, supply them to ChatGPT as context and then query ChatGPT to perform larger actions (i.e. extend domain object with some property and it would also modify repository, SQL, etc.)

jcraane commented 1 year ago

Great idea!

I am going to investigate. On the other hand, the new IntelliJ IDEA EAP also has an AI assistant which is similar as my plugin. I am unsure if I still need to invest int his one or just the one from Jetbrains.

trehak1 commented 1 year ago

It does not look like they support this feature. It would be cool to have it! I can imagine a context menu on a file, selection "Add to GPT context" and then a simple list of files attached to current query context (would be necessary to add display token count). I can imagine, using gpt-4-32k, that I could easily replace like 6 junior developers :laughing:

jcraane commented 1 year ago

Yes, I like the idea and indeed might be worth to add it to the plugin. I am going to see how I can integrate this (with token count and an indicator that context files (and even which files) are added to the chat). I can even include an option later to save/restore different contexts based on the task you are working on.

trehak1 commented 1 year ago

You can find java tokenizer for GPT here - https://github.com/knuddelsgmbh/jtokkit - I am using in my projects and it is accurate. Different contexts are something that I had in my mind as well but if I was going to implement it I would do it in the next stage. According to my experience it is crucial to carefully select as much as right context to the prompt as possible. I had a chat with BITO.AI and they are thinking about implementing this as well (The repo context is something we are working on and hoping to launch in the next few weeks. See https://bito.ai/next-gen/) but I really like simplicity and speed of this plugin of yours.

jcraane commented 1 year ago

Cool! Will take a look at the tokenizer as well.