From 77cb64958eeb6e54004cfc33e5cc2239295351b7 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 8 Nov 2024 14:23:55 -0800 Subject: [PATCH] refactor: Modify URL scraping and message handling in commands --- aider/commands.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aider/commands.py b/aider/commands.py index b48379b9e..f701fba8d 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -158,12 +158,14 @@ class Commands: ) content = self.scraper.scrape(url) or "" - content = f"{url}:\n\n" + content + content = f"Here is the content of {url}:\n\n" + content - self.io.tool_output("... done.") + self.io.tool_output("... added to chat.") - # Add the content to cur_messages as a faux assistant reply - self.coder.cur_messages.append(dict(role="assistant", content=content)) + self.coder.cur_messages += [ + dict(role="user", content=content), + dict(role="assistant", content="Ok."), + ] def is_command(self, inp): return inp[0] in "/!"