gpt-pilot icon indicating copy to clipboard operation
gpt-pilot copied to clipboard

[BUG]: "INPUT REQUIRED" should not ask user to write code

Open mferris77 opened this issue 6 months ago • 3 comments

Version

Command-line (Python) version

Operating System

Windows 10

Your question

Hello - I'm working on a small demo app just to try things out - a small (node) script that will read a list of URLs from a text file, visit those URLs and scrape the contents. It generates the development plan, the folder structures, and then starts creating the files it deems necessary. So far so good!

However then it tells me to open file xyz.js and 'add the required input'. The file's pre-existing content is just a single empty function - in this case it's the function to read the text file. I had provided the absolute path to the text file in my instructions, but no big deal, it's just a few lines of code, so I added it. But I'm wondering to myself why I'm having to write the code myself? It wasn't like it was asking me to enter an API key or other details it doesn't know about.

In the next step, which creates a JS file for doing the actual scraping, the same thing happens. Empty function and it appears I'm supposed to add in all the code myself.

Is that actually what should be happening, or am I misunderstanding and in the later steps this code will get generated? If that's the case, then what (if anything) should I be adding? If that's not the case, is there a better way to have the code generated? Because at this point it really hasn't done anything other than plan out a folder structure for me.

mferris77 avatar Dec 26 '23 17:12 mferris77

Hey @mferris!

The INPUT REQUIRED is for cases where there's a configuration thing, like this:

const mongoUri = 'mongodb://localhost/mydb';  // INPUT_REQUIRED Please change this to the URL to your database

In many cases, even ignoring this would work (but GPT Pilot would pester you about it), but the idea is that you should provide the configuration.

It should absolutely not ask you to code things yourself - as you said, that's its job.

If you have a sample code to copy-paste (just the relevant few lines of the file where it asked you), or if you encounter this again, please comment here, as we're trying to ferret this things out.

senko avatar Dec 26 '23 17:12 senko

Sure - and I did find out by not making any updates that it looks like it's going to add code in a later step. Here's one of the files that was generated and I was instructed to make an update:

// schemas/flightSchema.js

module.exports = function defineFlightSchema(db) {
  // INPUT_REQUIRED {Implementation will be done in task #2}
};

I guess the message itself is a bit vague and leads one to not be sure what exactly they're supposed to be doing with the file (if anything). One thing to point out as well is that I don't believe I knew what the current step was - so is the 'will be done in task 2' a message for me that it will be taken care of in the future, or are we currently on task 2 and this is for me to do?

Thanks again for your hard work on this project!

mferris77 avatar Dec 26 '23 20:12 mferris77

ignoring this would work (but GPT Pilot would pester you about it) <--- hehehe Indeed! :-)

In my unrequested opinion, while it is very clear that:

It should absolutely not ask you to code things yourself - as you said, that's its job.

There should always be an option for the user to edit the code. However, I think the user should be able to do so interactively at the prompt or chat instead of having to edit the actual files.

YosuCadilla avatar Dec 29 '23 04:12 YosuCadilla