mirror of
https://github.com/aljazceru/gpt-engineer.git
synced 2025-12-17 12:45:26 +01:00
fix to_files
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
def parse_chat(chat): # -> List[Tuple[str, str]]:
|
def parse_chat(chat): # -> List[Tuple[str, str]]:
|
||||||
# Split the chat into sections by the "*CODEBLOCKSBELOW*" token
|
# Split the chat into sections by the "*CODEBLOCKSBELOW*" token
|
||||||
split_chat = chat.split("*CODEBLOCKSBELOW*")
|
split_chat = chat.split("*CODEBLOCKSBELOW*")
|
||||||
@@ -15,7 +14,7 @@ def parse_chat(chat): # -> List[Tuple[str, str]]:
|
|||||||
code_blocks = split_chat[1] if is_token_found else chat
|
code_blocks = split_chat[1] if is_token_found else chat
|
||||||
|
|
||||||
# Get all ``` blocks and preceding filenames
|
# Get all ``` blocks and preceding filenames
|
||||||
regex = r"\[(.*?)\]\s*```.*?\n(.*?)```"
|
regex = r"(\S+?)\n```\S+\n(.+?)```"
|
||||||
matches = re.finditer(regex, code_blocks, re.DOTALL)
|
matches = re.finditer(regex, code_blocks, re.DOTALL)
|
||||||
|
|
||||||
files = []
|
files = []
|
||||||
|
|||||||
Reference in New Issue
Block a user