rubberduck-ai / rubberduck-vscode

Use AI-powered code edits, explanations, code generation, error diagnosis, and chat in Visual Studio Code with the official OpenAI API.
https://marketplace.visualstudio.com/items?itemName=Rubberduck.rubberduck-vscode
MIT License
582 stars 70 forks source link

Understanding the binding between classes #57

Closed SenatorInPower closed 1 year ago

SenatorInPower commented 1 year ago

What strategy should I use to get a response in the context of the specified classes from the project? That is, if there is a set of code, do I need to enter it in Start Chat, or is there another solution?

lgrammel commented 1 year ago

Many operations use your text selection (so you can control the context). You can select the code, right click and select the chat actions from the context menu.

SenatorInPower commented 1 year ago

Thank you,I have a question, did you compare the difference in the cost of an answer between a pure question (a question with a code) and in the context of categories ("Edit code" or any)?

SenatorInPower commented 1 year ago

Many operations use your text selection (so you can control the context). You can select the code, right click and select the chat actions from the context menu.

As I understand it, such functions imply that classes should be in one file, and do not imply "clipboard" and other tools for linking several files with code.

lgrammel commented 1 year ago

You can index the codebase and include the results in custom prompts via retrieval augmentation. However it is pretty experimental at this point. I have not compared detailed costs.

SenatorInPower commented 1 year ago

I confess I did not look at the source code, but I do not understand how such payment is formed. First, I wrote "Hello world" in "start chat"(Got a short answer) => then in edit code mode with the "Refactoring" command I asked to edit 133 lines of c#(got 135 lines, almost the same code) => then I asked to answer 4 questions in start chat, the total capacity of questions is 5 lines (when viewed in test file where the correspondence is saved), the answer is 20 lines => then asked "edit code" to edit 30 lines of code, in the context of 2 interfaces and a question (the capacity of the question came out 30 lines with line breaks) => received almost the same answer, since the code is good, BUT the bottom line is that the payment for the generation is 0.1$, in theory, if 1000 lines of code costs 0.002 (Curie), then the price should have been no more than 0.02, how would you comment on this?

SenatorInPower commented 1 year ago

I want to draw attention to the problem, when copying the text in "Reply ...", it is duplicated 2 times, always, at least for me.

lgrammel commented 1 year ago

It's using text-davinci-003 at the moment. Rubberduck has nothing to do with any charging - you just use your open ai key. You can see what is being send to OpenAI using show logs.

SenatorInPower commented 1 year ago

How to increase the number of tokens ? And is it possible to change InstructGPT?

lgrammel commented 1 year ago

How to increase the number of tokens ? And is it possible to change InstructGPT?

The extension does not come with a plan. You are using your own OpenAI account and subscription. You can see you OpenAI usage here: https://platform.openai.com/account/usage

We are planning to add the new (and cheaper) ChatGPT API in the near future.