smol-ai / developer

the first library to let you embed a developer agent in your own app!
https://twitter.com/SmolModels
MIT License
11.81k stars 1.03k forks source link

Invalid Character error return both by main.py and main_no_modal.py #56

Open rikbon opened 1 year ago

rikbon commented 1 year ago

Hi, I'm trying this prompt:

"write a python project for a tic-tac-toe game with a gui. remember also to include requirements.txt and a shell file that launches the game.
There should be 3 levels:
1) dumb (randomly marks)
2) intelligent (does it's strategy)
3) Cheater"

This is the output for main_no_modal.py (but the same error occurs using main.py)

... Here are the filepaths for the tic-tac-toe game with a GUI:

  • tic_tac_toe.py: This file will contain the main logic for the game.
  • gui.py: This file will contain the code for the graphical user interface.
  • requirements.txt: This file will list all the dependencies required to run the program.
  • launch.sh: This shell script will launch the game.

Here is the complete list of filepaths:

tic_tac_toe/
├── tic_tac_toe.py
├── gui.py
├── requirements.txt
└── launch.sh

Note: The tic_tac_toe/ directory is optional and is used to group all the files related to the game together. Traceback (most recent call last): File "/home/rikbon/developer/main_no_modal.py", line 241, in main(prompt, directory, file) File "/home/rikbon/developer/main_no_modal.py", line 138, in main list_actual = ast.literal_eval(filepaths_string) File "/usr/lib/python3.10/ast.py", line 62, in literal_eval node_or_string = parse(node_or_string.lstrip(" \t"), mode='eval') File "/usr/lib/python3.10/ast.py", line 50, in parse return compile(source, filename, mode, flags, File "", line 12 ├── tic_tac_toe.py ^ SyntaxError: invalid character '├' (U+251C) ...

Any idea? Thanks in advance.

swyxio commented 1 year ago

hey! yeah this is a very common pain point related to #45 - basically the model is not following my instructions enough and we should upgrade the prompt. its not your fault.. we're just not good enough at prompt engineering yet. would tweak the prompt!