developer icon indicating copy to clipboard operation
developer copied to clipboard

`filepaths_string` does not consistently generate correct Python code

Open thatliuser opened this issue 2 years ago • 2 comments

Given this prompt: An example web page using React and HTML. It should have a text box for the user to enter some text with a button to submit it, and on submission another field should be updated to show the text that was put in. I don't get a parseable Python list when using gpt-3.5-turbo: image By using the same type of refining statements given in generate_file, I was able to produce a proper response. image

thatliuser avatar May 17 '23 21:05 thatliuser

yea as a first step we can modify the prompt to offer few shot examples like you did, but longer term (to guarantee it never returns invalid code) i think we may need to pull in some other dependencies to guarantee returning valid code. i'll try to work on that.

swyxio avatar May 18 '23 00:05 swyxio

I've also had success with using the prompt addendum above:

    ONLY return a list of strings, like so:
    ["index.js", "style.css", "index.html"]

    DO NOT include code fences:
    ```py
    [1,2,3]
    ```

linsomniac avatar May 22 '23 04:05 linsomniac