Christopher-Hayes / vscode-chatgpt-reborn

Refactor, improve, and debug your code in VSCode with GPT-3 and GPT-4.
https://marketplace.visualstudio.com/items?itemName=chris-hayes.chatgpt-reborn
ISC License
207 stars 38 forks source link

Pass full local files to OpenAI API #44

Open rambalachandran opened 1 year ago

rambalachandran commented 1 year ago

Describe the feature

One of the important limitations that I have in the current implementation is that I would like to pass json/csv files of input data and expected output data to OpenAI API and ask it to generate a function or method to perform the transformation. VSCode has access to all files in the current workspacefolder and being able to pass them to OpenAI API would be very helpful

Christopher-Hayes commented 1 year ago

You can already do this with "Editor selection".

But, I'll leave this issue open for an easier way to select (multiple) files. The thing is adding entire files is a quick way to max out token count. But, the nice thing about CSVs is that you can just give it the header row, and maybe a couple real data rows, and usually that's all it needs, so providing the whole data file is often not needed.

image

Christopher-Hayes commented 1 year ago

I understand this ask is partly coming from expectations that ChatGPT Reborn do a lot of the same things that the ChatGPT Web UI can do, so I'll look for ways to make the UI feel more familiar to ChatGPT Web UI users.

raphael2692 commented 1 year ago

Hi @Christopher-Hayes , I read that chromadb supports a Javascript Client. I am not experienced with vscode exstensions, do you think we could integrate it in ChatGPT Reborn? The usecase would be: on button press embedd a set of (supported) local files and the open a chat panel to chat with them.

My only concern is that iusing a local model for embedding is tassative on cpu while using remote services like chatgpt is expensive...

https://github.com/chroma-core/chroma

Christopher-Hayes commented 1 year ago

@raphael2692 yeah looks possible. The db seems like the easier part, the harder part is knowing when to use text embeddings and making work in a way that isn't confusing for the end user.

wojtekcz commented 11 months ago

The thing is adding entire files is a quick way to max out token count.

One can use Claude with 100k context window. That would push token limit specter back a bit ;-)

Christopher-Hayes commented 1 month ago

Marking planned, but this extension needs to support the "Assistants API" first. So, that needs to come first, once we support it, uploading files to the assistant should easy.