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

My first run doesn't what I expected

Open urbanmichal opened this issue 2 years ago • 2 comments

Hi,

I just run python3 main.py tictactoe (tictactoe was the name of the folder, where I put main_prompt with the following content: ""We are writing tic-tac-toe game in python. MVC components split in separate files. Keyboard control.")

Unfortunately, there were no .py files generated. Only "python" (without any extension) file with:

from typing import List, Tuple

class View: def init(self, size: int): self.size = size

def display_board(self, board: List[List[str]]) -> None:
    print('\n'.join(['|'.join(row) for row in board]))

def display_message(self, message: str) -> None:
    print(message)

def get_move(self) -> Tuple[int, int]:
    while True:
        try:
            row = int(input('Enter row: '))
            col = int(input('Enter column: '))
            return row, col
        except ValueError:
            print('Invalid input. Please enter integers for row and column.')

And all_output.txt which started with:

Core classes, functions, and methods:

  • Model: responsible for the game logic and state management.
    • __init__(self, size: int): initializes the game board with the given size.

thus I cannot compile it.

I expected this tool to create .py files, so it's ready to be run. Is there anything I did wrong?

urbanmichal avatar Jun 15 '23 18:06 urbanmichal

Good question!

Do you want to send the whole all_output.txt?

AntonOsika avatar Jun 15 '23 21:06 AntonOsika

Welcome to reality. GPT cant write real working code. It's a language model predicting the next word token. It does not have an understanding of actual programming. Well, it doesn't have an understanding at all.

bluebrown avatar Jun 15 '23 21:06 bluebrown

I guess it will be confusing for folks because the example shows that the output are py files instead of a text output.

juarezjl avatar Jun 16 '23 21:06 juarezjl

Files should be created. There are people working on a better approach to make sure it always does, sometimes it doesn't because the output from ChatGPT isn't always the same and this is taken care of via a regex that needs some tweaking, see #35 .

patillacode avatar Jun 17 '23 12:06 patillacode

Closing in favor of #35

patillacode avatar Jun 17 '23 12:06 patillacode