mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2026-01-05 19:00:22 +01:00
Added callback to ask_for_human_intervention
This commit is contained in:
@@ -170,7 +170,7 @@ class Project:
|
||||
delete_unconnected_steps_from(self.checkpoints['last_command_run'], 'previous_step')
|
||||
delete_unconnected_steps_from(self.checkpoints['last_user_input'], 'previous_step')
|
||||
|
||||
def ask_for_human_intervention(self, message, description=None):
|
||||
def ask_for_human_intervention(self, message, description=None, cbs={}):
|
||||
print(colored(message, "yellow"))
|
||||
if description is not None:
|
||||
print(description)
|
||||
@@ -181,6 +181,9 @@ class Project:
|
||||
'Once you are ready, type "continue" to continue.',
|
||||
)
|
||||
|
||||
if answer in cbs:
|
||||
return cbs[answer]()
|
||||
|
||||
if answer != '' and answer != 'continue':
|
||||
confirmation = styled_text(
|
||||
self,
|
||||
|
||||
@@ -120,7 +120,9 @@ class Developer(Agent):
|
||||
|
||||
def continue_development(self):
|
||||
while True:
|
||||
user_feedback = self.project.ask_for_human_intervention('Can you check if all this works?')
|
||||
user_feedback = self.project.ask_for_human_intervention(
|
||||
'Can you check if all this works? If you want to run the app, just type "r" and press ENTER',
|
||||
cbs={ 'r': lambda: run_command_until_success(self.run_command, None, iteration_convo, force=True) })
|
||||
|
||||
if user_feedback == 'DONE':
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user