mirror of
https://github.com/aljazceru/dev-gpt.git
synced 2025-12-21 07:34:20 +01:00
fix: prompt optimizations
This commit is contained in:
@@ -248,6 +248,13 @@ def update_client_line_in_file(file_path, host):
|
||||
file.write(replaced_content)
|
||||
|
||||
|
||||
def remove_after_stderr(relevant_lines):
|
||||
for index, line in enumerate(relevant_lines):
|
||||
if '--- Captured stderr call ----' in line:
|
||||
return relevant_lines[:index]
|
||||
return relevant_lines
|
||||
|
||||
|
||||
def process_error_message(error_message):
|
||||
lines = error_message.split('\n')
|
||||
|
||||
@@ -263,6 +270,8 @@ def process_error_message(error_message):
|
||||
if last_matching_line_index is not None:
|
||||
relevant_lines = lines[last_matching_line_index:]
|
||||
|
||||
relevant_lines = remove_after_stderr(relevant_lines)
|
||||
|
||||
response = '\n'.join(relevant_lines[-25:]).strip()
|
||||
|
||||
# the following code tests the case that the docker file is corrupted and can not be parsed
|
||||
|
||||
Reference in New Issue
Block a user