Skip to content

Commit

Permalink
Merge pull request #899 from ATheorell/main
Browse files Browse the repository at this point in the history
Fixes to main path problem
  • Loading branch information
ATheorell committed Dec 13, 2023
2 parents 3996fbb + 4816f65 commit 80f9477
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 37 deletions.
38 changes: 2 additions & 36 deletions gpt_engineer/applications/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@
import logging
import os

from importlib.util import find_spec
from pathlib import Path

import openai
import toml
import typer

from dotenv import load_dotenv
Expand All @@ -49,16 +47,6 @@
from gpt_engineer.core.preprompts_holder import PrepromptsHolder
from gpt_engineer.tools.custom_steps import clarified_gen, lite_gen, self_heal

# Load the names of the optional dependencies from the pyprojecct file and determine whether
# they can be imported
with open("pyproject.toml", "r") as file:
pyproject = toml.load(file)

dependency_group = pyproject["tool"]["poetry"]["group"]["experimental"]["dependencies"]
optional_deps_importable = all(
[find_spec(dep_name.replace("-", "_")) is not None for dep_name in dependency_group]
)

app = typer.Typer() # creates a CLI app


Expand Down Expand Up @@ -110,11 +98,6 @@ def main(
"-i",
help="Improve files_dict from existing project.",
),
improve_all_mode: bool = typer.Option(
False,
"--improve-all-experimental",
help="Improve files_dict from existing project, without manually choosing which files to improve, using vector store (EXPERIMENTAL).",
),
lite_mode: bool = typer.Option(
False,
"--lite",
Expand Down Expand Up @@ -156,9 +139,6 @@ def main(
"""
logging.basicConfig(level=logging.DEBUG if verbose else logging.INFO)
#
if improve_all_mode and not improve_mode:
print("Vector improve mode implies improve mode, setting improve_mode=True")
improve_mode = True

if improve_mode:
assert not (
Expand Down Expand Up @@ -192,18 +172,7 @@ def main(
else:
execution_fn = execute_entrypoint

if improve_all_mode and optional_deps_importable:
from gpt_engineer.tools.experimental.experimental_steps import (
improve_automatic_file_selection,
)

improve_fn = improve_automatic_file_selection
elif improve_all_mode:
raise ImportError(
"The experimental improve_all_mode is selected, but the optional dependencies to use it are not installed. Please run 'poetry install --with experimental'"
)
else:
improve_fn = improve
improve_fn = improve

preprompts_path = get_preprompts_path(use_custom_preprompts, Path(project_path))
preprompts_holder = PrepromptsHolder(preprompts_path)
Expand All @@ -221,10 +190,7 @@ def main(

store = FileStore(project_path)
if improve_mode:
if improve_all_mode:
files_dict = store.download()
else:
files_dict = ask_for_files(project_path)
files_dict = ask_for_files(project_path)
files_dict = agent.improve(files_dict, prompt)
else:
files_dict = agent.init(prompt)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gpt-engineer"
version = "0.2.2"
version = "0.2.3"
description = "Specify what you want it to build, the AI asks for clarification, and then builds it."
authors = ["Anton Osika <anton.osika@gmail.com>"]
license = "MIT"
Expand Down

0 comments on commit 80f9477

Please sign in to comment.