gpt-engineer-org / gpt-engineer

Platform to experiment with the AI Software Engineer. Terminal based. NOTE: Very different from https://gptengineer.app
MIT License
52.55k stars 6.83k forks source link

Quickstart erroring #180

Closed johnwahba closed 1 year ago

johnwahba commented 1 year ago

Running through the quickstart with a directory with main_prompt:

I suspect this might be related to the most recent version bump?

➜  workspace gpt-engineer chatbot
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/johnwahba/.pyenv/versions/3.11.4/lib/python3.11/site-packages/gpt_engineer/main.py:58 in  │
│ main                                                                                             │
│                                                                                                  │
│   55 │   )                                                                                       │
│   56 │                                                                                           │
│   57 │   for step in STEPS[steps_config]:                                                        │
│ ❱ 58 │   │   messages = step(ai, dbs)                                                            │
│   59 │   │   dbs.logs[step.__name__] = json.dumps(messages)                                      │
│   60                                                                                             │
│   61                                                                                             │
│                                                                                                  │
│ ╭────────────────────────────────── locals ───────────────────────────────────╮                  │
│ │              ai = <gpt_engineer.ai.AI object at 0x10b069910>                │                  │
│ │             dbs = DBs(                                                      │                  │
│ │                   │   memory=<gpt_engineer.db.DB object at 0x105dd5ad0>,    │                  │
│ │                   │   logs=<gpt_engineer.db.DB object at 0x10b1c29d0>,      │                  │
│ │                   │   identity=<gpt_engineer.db.DB object at 0x10b1e6a50>,  │                  │
│ │                   │   input=<gpt_engineer.db.DB object at 0x104eef790>,     │                  │
│ │                   │   workspace=<gpt_engineer.db.DB object at 0x10b06b890>  │                  │
│ │                   )                                                         │                  │
│ │ delete_existing = False                                                     │                  │
│ │      input_path = PosixPath('/Users/johnwahba/workspace/chatbot')           │                  │
│ │     memory_path = PosixPath('/Users/johnwahba/workspace/chatbot/memory')    │                  │
│ │           model = 'gpt-4'                                                   │                  │
│ │    project_path = 'chatbot'                                                 │                  │
│ │      run_prefix = ''                                                        │                  │
│ │            step = <function gen_spec at 0x10b1bd300>                        │                  │
│ │    steps_config = 'default'                                                 │                  │
│ │     temperature = 0.1                                                       │                  │
│ │         verbose = False                                                     │                  │
│ │  workspace_path = PosixPath('/Users/johnwahba/workspace/chatbot/workspace') │                  │
│ ╰─────────────────────────────────────────────────────────────────────────────╯                  │
│                                                                                                  │
│ /Users/johnwahba/.pyenv/versions/3.11.4/lib/python3.11/site-packages/gpt_engineer/steps.py:61 in │
│ gen_spec                                                                                         │
│                                                                                                  │
│    58 │   the workspace                                                                          │
│    59 │   """                                                                                    │
│    60 │   messages = [                                                                           │
│ ❱  61 │   │   ai.fsystem(setup_sys_prompt(dbs)),                                                 │
│    62 │   │   ai.fsystem(f"Instructions: {dbs.input['main_prompt']}"),                           │
│    63 │   ]                                                                                      │
│    64                                                                                            │
│                                                                                                  │
│ ╭──────────────────────────── locals ────────────────────────────╮                               │
│ │  ai = <gpt_engineer.ai.AI object at 0x10b069910>               │                               │
│ │ dbs = DBs(                                                     │                               │
│ │       │   memory=<gpt_engineer.db.DB object at 0x105dd5ad0>,   │                               │
│ │       │   logs=<gpt_engineer.db.DB object at 0x10b1c29d0>,     │                               │
│ │       │   identity=<gpt_engineer.db.DB object at 0x10b1e6a50>, │                               │
│ │       │   input=<gpt_engineer.db.DB object at 0x104eef790>,    │                               │
│ │       │   workspace=<gpt_engineer.db.DB object at 0x10b06b890> │                               │
│ │       )                                                        │                               │
│ ╰────────────────────────────────────────────────────────────────╯                               │
│                                                                                                  │
│ /Users/johnwahba/.pyenv/versions/3.11.4/lib/python3.11/site-packages/gpt_engineer/steps.py:11 in │
│ setup_sys_prompt                                                                                 │
│                                                                                                  │
│     8                                                                                            │
│     9                                                                                            │
│    10 def setup_sys_prompt(dbs):                                                                 │
│ ❱  11 │   return dbs.identity["generate"] + "\nUseful to know:\n" + dbs.identity["philosophy"]   │
│    12                                                                                            │
│    13                                                                                            │
│    14 def simple_gen(ai: AI, dbs: DBs):                                                          │
│                                                                                                  │
│ ╭──────────────────────────── locals ────────────────────────────╮                               │
│ │ dbs = DBs(                                                     │                               │
│ │       │   memory=<gpt_engineer.db.DB object at 0x105dd5ad0>,   │                               │
│ │       │   logs=<gpt_engineer.db.DB object at 0x10b1c29d0>,     │                               │
│ │       │   identity=<gpt_engineer.db.DB object at 0x10b1e6a50>, │                               │
│ │       │   input=<gpt_engineer.db.DB object at 0x104eef790>,    │                               │
│ │       │   workspace=<gpt_engineer.db.DB object at 0x10b06b890> │                               │
│ │       )                                                        │                               │
│ ╰────────────────────────────────────────────────────────────────╯                               │
│                                                                                                  │
│ /Users/johnwahba/.pyenv/versions/3.11.4/lib/python3.11/site-packages/gpt_engineer/db.py:21 in    │
│ __getitem__                                                                                      │
│                                                                                                  │
│   18 │   │   │   with full_path.open("r", encoding="utf-8") as f:                                │
│   19 │   │   │   │   return f.read()                                                             │
│   20 │   │   else:                                                                               │
│ ❱ 21 │   │   │   raise KeyError(key)                                                             │
│   22 │                                                                                           │
│   23 │   def __setitem__(self, key, val):                                                        │
│   24 │   │   full_path = self.path / key                                                         │
│                                                                                                  │
│ ╭─────────────────────────────── locals ────────────────────────────────╮                        │
│ │ full_path = PosixPath('/Users/johnwahba/workspace/identity/generate') │                        │
│ │       key = 'generate'                                                │                        │
│ │      self = <gpt_engineer.db.DB object at 0x10b1e6a50>                │                        │
│ ╰───────────────────────────────────────────────────────────────────────╯                        │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: 'generate'
JustAnotherDataScientist commented 1 year ago

Same error here.

Ryan526 commented 1 year ago

Have you run make install after pulling the changes?

I was running into this problem before doing that and now no longer see this problem.

JustAnotherDataScientist commented 1 year ago

Personnally I just piped install

nbashaw commented 1 year ago

Same error, also pip installed

amjadraza commented 1 year ago

Used !pip install Having save error

gwz94 commented 1 year ago

Having the same error.

asaf050 commented 1 year ago

Same error here

gwz94 commented 1 year ago

Solved it by following the steps in README.md!

amjadraza commented 1 year ago

Solved it by following the steps in README.md!

What steps? Creating the Projects/Example/abc.text

gwz94 commented 1 year ago

table** release:

For development:

Setup

With an api key that has GPT4 access run:

Run:

Just follow all the steps above. I could run the code with no problem

patillacode commented 1 year ago

Following the README should fix this issue, closing but please comment if you still find this error after following the steps.

Kotrotsos commented 1 year ago

Use the development instructions, not pip install...then it should work.

johnwahba commented 1 year ago

If pip install doesn't work, should those instructions be removed?