gencay / vscode-chatgpt

An unofficial Visual Studio Code - OpenAI ChatGPT integration
ISC License
3.5k stars 755 forks source link

Feeding with files/directories in addition to the other functions #158

Closed sreimchen closed 1 year ago

sreimchen commented 1 year ago

Great extension, thanks a lot for your work!

There is on specific function I am missing at the moment which is to feed the conversation with multiple files. I think passing file by file or each file after each other is the way to go here. So awaiting the asynchronous calls call by call in a loop.

Let's assume the user got the following file structure in example:

main.cpp network/ ├─ wifi.h ├─ wifi.cpp ├─ ntp.h

The user would mark all the files, right click and the context menu opens and the user selects "Add files to conversation". Therefore we could provide:

  1. A tree like structure like above and instructions how to proceed with the incoming conversation details
  2. Tell the AI to just answer with some predefined answer like e.g. "Ok" or even to "Comment it in two sentences" (could be modified of course)
  3. Then pass file by file with a filename

So this would look like this: User: "Here is some context for the next questions. At first have a look at the following file structure: main.cpp network/ ├─ wifi.h ├─ wifi.cpp ├─ ntp.h

In the next steps I will show you the file name and content. For every file just answer with 'Ok' till I tell you to do differently." Bot: "Ok" User: "main.cpp: ..." Bot: "Ok" User: "network/wifi.h: ..." Bot: "Ok" User: "network/wifi.cpp: ..." Bot: "Ok" User: "network/ntp.h: ..." Bot: "Ok" User: "That's it. Just tell me if you understood or didn't in a sentence."

ncesar commented 1 year ago

hmm lets keep in mind chatgpt has a limit of context so this would work for smaller files but not for medium-bigger files.

I think we should keep things the way it is. Github CoPilot works better for this specific context I guess.

Correct me if I'm wrong.

sreimchen commented 1 year ago

You're right that ChaptGPT is limited in that sense but this doesn't mean that this isn't a useful feature in my opinion because ChatGPT's answers are quite more accurate if you share any context. As a user you can control the amount of context and sharing a single (and even 2 or 3) file(s) can be handled without a problem in my experience. Even if nobody can say what the future brings I think the amount of possible amount of context will be generally increasing. So it makes sense to realize this feature in my opinion.

sreimchen commented 1 year ago

Hm, isn't this even more useful with GPT-4 because of the havily increased context length?

gencay commented 1 year ago

@sreimchen Please see #239 and our readme about our announcement :(

I'll make sure to archive these feature requests and provide to whomever continues the journey, it won't be us unfortunately.