mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2026-01-01 09:00:01 +01:00
A couple of fixes
This commit is contained in:
@@ -33,8 +33,8 @@ class Developer(Agent):
|
||||
|
||||
def implement_task(self, sibling_tasks, current_task_index, parent_task=None):
|
||||
print(colored('-------------------------', 'green', attrs=['bold']))
|
||||
print(colored(f"Implementing task {current_task_index + 1}...\n", "green"))
|
||||
print(colored(sibling_tasks[current_task_index]['description'], 'green'))
|
||||
print(colored(f"Implementing task {current_task_index + 1}...\n", "green", attrs=['bold']))
|
||||
print(colored(sibling_tasks[current_task_index]['description'], 'green', attrs=['bold']))
|
||||
print(colored('-------------------------', 'green', attrs=['bold']))
|
||||
|
||||
convo_dev_task = AgentConvo(self)
|
||||
@@ -133,8 +133,8 @@ class Developer(Agent):
|
||||
},
|
||||
'send_convo': True
|
||||
})
|
||||
|
||||
if not llm_response == 'DONE':
|
||||
|
||||
if llm_response != 'DONE':
|
||||
installation_commands = self.convo_os_specific_tech.send_message('development/env_setup/unsuccessful_installation.prompt',
|
||||
{ 'technology': technology }, EXECUTE_COMMANDS)
|
||||
if installation_commands is not None:
|
||||
|
||||
@@ -153,6 +153,9 @@ def stream_gpt_completion(data, req_type):
|
||||
|
||||
try:
|
||||
json_line = load_data_to_json(line)
|
||||
if 'error' in json_line:
|
||||
logger.error(f'Error in LLM response: {json_line}')
|
||||
raise ValueError(f'Error in LLM response: {json_line["error"]["message"]}')
|
||||
if json_line['choices'][0]['finish_reason'] == 'function_call':
|
||||
function_calls['arguments'] = load_data_to_json(function_calls['arguments'])
|
||||
return return_result({'function_calls': function_calls});
|
||||
|
||||
@@ -146,7 +146,7 @@ def replace_functions(obj):
|
||||
return obj
|
||||
|
||||
def fix_json_newlines(s):
|
||||
pattern = r'("(?:\\.|[^"\\])*")'
|
||||
pattern = r'("(?:\\\\n|\\.|[^"\\])*")'
|
||||
|
||||
def replace_newlines(match):
|
||||
return match.group(1).replace('\n', '\\n')
|
||||
|
||||
Reference in New Issue
Block a user