Skip to content

Commit

Permalink
Update AgentConvo.py
Browse files Browse the repository at this point in the history
  • Loading branch information
isthatpratik committed Oct 12, 2023
1 parent bd79a77 commit 65269b5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pilot/helpers/AgentConvo.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ def replace_files(self):
def replace_file_content(self, message, file_path, new_content):
escaped_file_path = re.escape(file_path)

# Escape any \U in the file path
escaped_file_path = escaped_file_path.replace("\\U", "\\\\U")

pattern = rf'\*\*{{ {escaped_file_path} }}\*\*\n```\n(.*?)\n```'

new_section_content = f'**{{ {file_path} }}**\n```\n{new_content}\n```'
Expand Down

0 comments on commit 65269b5

Please sign in to comment.