developer
developer copied to clipboard
Not working without Modal
I tried the instructions without Modal:
python main_no_modal.py "A basic React app that just displays a page that says 'Hello, World!'"
Result:
Traceback (most recent call last):
File "/Users/dzso/Dev/smol-dev/main_no_modal.py", line 245, in <module>
main(prompt, directory, file)
NameError: name 'file' is not defined. Did you mean: 'filter'?
Seems like the it's expecting another arg for file, but I'm not sure what to give it. I tried by giving it one more argument, test.js
, but I get the same error.
I got a little farther by adding file = None
to the beginning of the block on line 235, changing line 125 to filepaths_string = generate_response(
instead of filepaths_string = generate_response.call(
and setting openai_model = "gpt-3.5-turbo"
. I also had to manually define my env vars (the .env
file wasn't read).
Now, when I run the command it seems like the prompts are executed and something is generated, but it still crashes with the following error:
Traceback (most recent call last):
File "/Users/dzso/Dev/smol-dev/main_no_modal.py", line 246, in <module>
main(prompt, directory, file)
File "/Users/dzso/Dev/smol-dev/main_no_modal.py", line 189, in main
write_file(filename, filecode, directory)
File "/Users/dzso/Dev/smol-dev/main_no_modal.py", line 207, in write_file
file.write(filecode)
TypeError: write() argument must be str, not tuple
Replacing line 207 with:
file.write(filecode[1])
makes it work
I believe I've fixed these issues in PR #17, if you'd like to give it a shot!
thanks to @thatliuser i think this is solved, pls reopen otherwise!