From 24fef650ba0ffde5185bfe51edf62eece334d5b8 Mon Sep 17 00:00:00 2001 From: Nitaym <19125+Nitaym@users.noreply.github.com> Date: Sun, 2 Jul 2023 18:05:09 +0300 Subject: [PATCH] Python 3.8 support + Cleaning up some issues in extracting files out of the prompts (#355) * Changed typing to fit python 3.8 * Made sure GPT won't add in comments about the files as these confuse the chat-to-files regex --- gpt_engineer/ai.py | 4 +++- gpt_engineer/preprompts/generate | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gpt_engineer/ai.py b/gpt_engineer/ai.py index 195aaa6..6430c37 100644 --- a/gpt_engineer/ai.py +++ b/gpt_engineer/ai.py @@ -2,6 +2,8 @@ from __future__ import annotations import logging +from typing import Dict, List + import openai logger = logging.getLogger(__name__) @@ -29,7 +31,7 @@ class AI: def fassistant(self, msg): return {"role": "assistant", "content": msg} - def next(self, messages: list[dict[str, str]], prompt=None): + def next(self, messages: List[Dict[str, str]], prompt=None): if prompt: messages += [{"role": "user", "content": prompt}] diff --git a/gpt_engineer/preprompts/generate b/gpt_engineer/preprompts/generate index 500d344..4f1e643 100644 --- a/gpt_engineer/preprompts/generate +++ b/gpt_engineer/preprompts/generate @@ -14,6 +14,8 @@ FILENAME CODE ``` +Do not comment on what every file does + You will start with the "entrypoint" file, then go to the ones that are imported by that file, and so on. Please note that the code should be fully functional. No placeholders.