mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2026-01-03 01:46:08 +01:00
Fixes
This commit is contained in:
@@ -90,7 +90,7 @@ class Project:
|
||||
|
||||
def get_all_coded_files(self):
|
||||
files = File.select().where(File.app_id == self.args['app_id'])
|
||||
files = self.get_files([file.path + file.name for file in files])
|
||||
files = self.get_files([file.path + '/' + file.name for file in files])
|
||||
return files
|
||||
|
||||
def get_files(self, files):
|
||||
@@ -110,6 +110,10 @@ class Project:
|
||||
return files_with_content
|
||||
|
||||
def save_file(self, data):
|
||||
# TODO fix this in prompts
|
||||
if ' ' in data['name'] or '.' not in data['name']:
|
||||
data['name'] = data['path'].rsplit('/', 1)[1]
|
||||
|
||||
data['path'], data['full_path'] = self.get_full_file_path(data['path'], data['name'])
|
||||
update_file(data['full_path'], data['content'])
|
||||
|
||||
@@ -122,10 +126,7 @@ class Project:
|
||||
|
||||
def get_full_file_path(self, file_path, file_name):
|
||||
file_path = file_path.replace('./', '', 1)
|
||||
if ' ' in file_name or '.' not in file_name:
|
||||
file_name = ''
|
||||
else:
|
||||
file_path = file_path.rsplit(file_name, 1)[0]
|
||||
file_path = file_path.rsplit(file_name, 1)[0]
|
||||
|
||||
if file_path.endswith('/'):
|
||||
file_path = file_path.rstrip('/')
|
||||
@@ -133,7 +134,7 @@ class Project:
|
||||
if file_name.startswith('/'):
|
||||
file_name = file_name[1:]
|
||||
|
||||
if not file_path.startswith('/'):
|
||||
if not file_path.startswith('/') and file_path != '':
|
||||
file_path = '/' + file_path
|
||||
|
||||
if file_name != '':
|
||||
@@ -189,5 +190,5 @@ class Project:
|
||||
|
||||
if answer in cbs:
|
||||
return cbs[answer]()
|
||||
elif answer != '' and answer != 'continue':
|
||||
elif answer != '':
|
||||
return answer
|
||||
|
||||
@@ -89,7 +89,7 @@ class Developer(Agent):
|
||||
|
||||
elif step['type'] == 'human_intervention':
|
||||
user_feedback = self.project.ask_for_human_intervention('I need your help! Can you try debugging this yourself and let me take over afterwards? Here are the details about the issue:', step['human_intervention_description'])
|
||||
if user_feedback is not None:
|
||||
if user_feedback is not None and user_feedback != 'continue':
|
||||
debug(convo, user_input=user_feedback, issue_description=step['human_intervention_description'])
|
||||
|
||||
if test_command is not None and ('check_if_fixed' not in step or step['check_if_fixed']):
|
||||
@@ -117,7 +117,7 @@ class Developer(Agent):
|
||||
'Can you check if the app works?\nIf you want to run the app, ' + colored('just type "r" and press ENTER', 'yellow', attrs=['bold']),
|
||||
cbs={ 'r': lambda: run_command_until_success(self.run_command, None, iteration_convo, force=True) })
|
||||
|
||||
if user_feedback == 'DONE':
|
||||
if user_feedback == 'continue':
|
||||
return True
|
||||
|
||||
if user_feedback is not None:
|
||||
|
||||
Reference in New Issue
Block a user