mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 03:05:00 +00:00
refactor: Modify URL scraping and message handling in commands
This commit is contained in:
parent
b3d13e44b2
commit
77cb64958e
1 changed files with 6 additions and 4 deletions
|
@ -158,12 +158,14 @@ class Commands:
|
||||||
)
|
)
|
||||||
|
|
||||||
content = self.scraper.scrape(url) or ""
|
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 += [
|
||||||
self.coder.cur_messages.append(dict(role="assistant", content=content))
|
dict(role="user", content=content),
|
||||||
|
dict(role="assistant", content="Ok."),
|
||||||
|
]
|
||||||
|
|
||||||
def is_command(self, inp):
|
def is_command(self, inp):
|
||||||
return inp[0] in "/!"
|
return inp[0] in "/!"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue