28
28
import logging
29
29
import os
30
30
31
- from importlib .util import find_spec
32
31
from pathlib import Path
33
32
34
33
import openai
35
- import toml
36
34
import typer
37
35
38
36
from dotenv import load_dotenv
49
47
from gpt_engineer .core .preprompts_holder import PrepromptsHolder
50
48
from gpt_engineer .tools .custom_steps import clarified_gen , lite_gen , self_heal
51
49
52
- # Load the names of the optional dependencies from the pyprojecct file and determine whether
53
- # they can be imported
54
- with open ("pyproject.toml" , "r" ) as file :
55
- pyproject = toml .load (file )
56
-
57
- dependency_group = pyproject ["tool" ]["poetry" ]["group" ]["experimental" ]["dependencies" ]
58
- optional_deps_importable = all (
59
- [find_spec (dep_name .replace ("-" , "_" )) is not None for dep_name in dependency_group ]
60
- )
61
-
62
50
app = typer .Typer () # creates a CLI app
63
51
64
52
@@ -110,11 +98,6 @@ def main(
110
98
"-i" ,
111
99
help = "Improve files_dict from existing project." ,
112
100
),
113
- improve_all_mode : bool = typer .Option (
114
- False ,
115
- "--improve-all-experimental" ,
116
- help = "Improve files_dict from existing project, without manually choosing which files to improve, using vector store (EXPERIMENTAL)." ,
117
- ),
118
101
lite_mode : bool = typer .Option (
119
102
False ,
120
103
"--lite" ,
@@ -156,9 +139,6 @@ def main(
156
139
"""
157
140
logging .basicConfig (level = logging .DEBUG if verbose else logging .INFO )
158
141
#
159
- if improve_all_mode and not improve_mode :
160
- print ("Vector improve mode implies improve mode, setting improve_mode=True" )
161
- improve_mode = True
162
142
163
143
if improve_mode :
164
144
assert not (
@@ -192,18 +172,7 @@ def main(
192
172
else :
193
173
execution_fn = execute_entrypoint
194
174
195
- if improve_all_mode and optional_deps_importable :
196
- from gpt_engineer .tools .experimental .experimental_steps import (
197
- improve_automatic_file_selection ,
198
- )
199
-
200
- improve_fn = improve_automatic_file_selection
201
- elif improve_all_mode :
202
- raise ImportError (
203
- "The experimental improve_all_mode is selected, but the optional dependencies to use it are not installed. Please run 'poetry install --with experimental'"
204
- )
205
- else :
206
- improve_fn = improve
175
+ improve_fn = improve
207
176
208
177
preprompts_path = get_preprompts_path (use_custom_preprompts , Path (project_path ))
209
178
preprompts_holder = PrepromptsHolder (preprompts_path )
@@ -221,10 +190,7 @@ def main(
221
190
222
191
store = FileStore (project_path )
223
192
if improve_mode :
224
- if improve_all_mode :
225
- files_dict = store .download ()
226
- else :
227
- files_dict = ask_for_files (project_path )
193
+ files_dict = ask_for_files (project_path )
228
194
files_dict = agent .improve (files_dict , prompt )
229
195
else :
230
196
files_dict = agent .init (prompt )
0 commit comments