mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2025-12-26 16:57:23 +01:00
Merge branch 'main' into fix/fix-tests
# Conflicts: # pilot/helpers/Project.py
This commit is contained in:
@@ -31,7 +31,7 @@ I've broken down the idea behind GPT Pilot and how it works in the following blo
|
||||
|
||||
**[[Part 1/3] High-level concepts + GPT Pilot workflow until the coding part](https://blog.pythagora.ai/2023/08/23/430/)**
|
||||
|
||||
**_[Part 2/3] GPT Pilot coding workflow (COMING UP)_**
|
||||
**_[[Part 2/3] GPT Pilot coding workflow](https://blog.pythagora.ai/2023/09/04/gpt-pilot-coding-workflow-part-2-3/)_**
|
||||
|
||||
**_[Part 3/3] Other important concepts and future plans (COMING UP)_**
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@ class Project:
|
||||
# if development_plan is not None:
|
||||
# self.development_plan = development_plan
|
||||
|
||||
|
||||
def start(self):
|
||||
"""
|
||||
Start the project.
|
||||
@@ -123,7 +122,8 @@ class Project:
|
||||
if should_overwrite_files == 'n':
|
||||
break
|
||||
elif should_overwrite_files == 'y':
|
||||
FileSnapshot.delete().where(FileSnapshot.app == self.app and FileSnapshot.development_step == self.skip_until_dev_step).execute()
|
||||
FileSnapshot.delete().where(
|
||||
FileSnapshot.app == self.app and FileSnapshot.development_step == self.skip_until_dev_step).execute()
|
||||
self.save_files_snapshot(self.skip_until_dev_step)
|
||||
break
|
||||
# TODO END
|
||||
@@ -235,11 +235,11 @@ class Project:
|
||||
# update_file(data['full_path'], data['content'])
|
||||
#
|
||||
# (File.insert(app=self.app, path=data['path'], name=data['name'], full_path=data['full_path'])
|
||||
# .on_conflict(
|
||||
# conflict_target=[File.app, File.name, File.path],
|
||||
# preserve=[],
|
||||
# update={ 'name': data['name'], 'path': data['path'], 'full_path': data['full_path'] })
|
||||
# .execute())
|
||||
# .on_conflict(
|
||||
# conflict_target=[File.app, File.name, File.path],
|
||||
# preserve=[],
|
||||
# update={'name': data['name'], 'path': data['path'], 'full_path': data['full_path']})
|
||||
# .execute())
|
||||
|
||||
def get_full_file_path(self, file_path: str, file_name: str) -> Tuple[str, str]:
|
||||
|
||||
@@ -339,16 +339,16 @@ class Project:
|
||||
|
||||
def ask_for_human_intervention(self, message, description=None, cbs={}, convo=None, is_root_task=False):
|
||||
answer = ''
|
||||
question = yellow_bold(message)
|
||||
|
||||
if description is not None:
|
||||
question += '\n' + '-' * 100 + '\n' + white_bold(description) + '\n' + '-' * 100 + '\n'
|
||||
|
||||
if convo is not None:
|
||||
reset_branch_id = convo.save_branch()
|
||||
|
||||
while answer != 'continue':
|
||||
if description is not None:
|
||||
print('\n' + '-'*100 + '\n' +
|
||||
white_bold(description) +
|
||||
'\n' + '-'*100 + '\n')
|
||||
|
||||
answer = ask_user(self, yellow_bold(message),
|
||||
answer = ask_user(self, question,
|
||||
require_some_input=False,
|
||||
hint='If something is wrong, tell me or type "continue" to continue.')
|
||||
|
||||
@@ -356,11 +356,11 @@ class Project:
|
||||
if answer in cbs:
|
||||
return cbs[answer](convo)
|
||||
elif answer != '':
|
||||
return { 'user_input': answer }
|
||||
return {'user_input': answer}
|
||||
except TokenLimitError as e:
|
||||
if is_root_task and answer not in cbs and answer != '':
|
||||
convo.load_branch(reset_branch_id)
|
||||
return { 'user_input': answer }
|
||||
return {'user_input': answer}
|
||||
else:
|
||||
raise e
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ def ask_for_main_app_definition(project):
|
||||
def ask_user(project, question: str, require_some_input=True, hint: str = None):
|
||||
while True:
|
||||
if hint is not None:
|
||||
print(hint, type='hint')
|
||||
print(yellow(hint), type='hint')
|
||||
answer = styled_text(project, question)
|
||||
|
||||
logger.info('Q: %s', question)
|
||||
|
||||
Reference in New Issue
Block a user