mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 18:54:59 +00:00
aider: Added a log_only parameter to tool() to allow emitting only to the log.
# Context: USER: add a log_only=False param to tool() which only emits to the log, not to the scren ASSISTANT: ```python aider/io.py <<<<<<< ORIGINAL def tool(self, *messages): if messages: hist = " ".join(messages) hist = f"{hist.strip()}" self.append_chat_history(hist, linebreak=True, blockquote=True) messages = list(map(Text, messages)) self.console.print(*messages) ======= def tool(self, *messages, log_only=False): if messages: hist = " ".join(messages) hist = f"{hist.strip()}" self.append_chat_history(hist, linebreak=True, blockquote=True) if not log_only: messages = list(map(Text, messages)) self.console.print(*messages) >>>>>>> UPDATED ```
This commit is contained in:
parent
fc1dac4ac3
commit
bca4674e07
1 changed files with 4 additions and 3 deletions
|
@ -193,14 +193,15 @@ class InputOutput:
|
|||
message = Text(message)
|
||||
self.console.print(message, style="red")
|
||||
|
||||
def tool(self, *messages):
|
||||
def tool(self, *messages, log_only=False):
|
||||
if messages:
|
||||
hist = " ".join(messages)
|
||||
hist = f"{hist.strip()}"
|
||||
self.append_chat_history(hist, linebreak=True, blockquote=True)
|
||||
|
||||
messages = list(map(Text, messages))
|
||||
self.console.print(*messages)
|
||||
if not log_only:
|
||||
messages = list(map(Text, messages))
|
||||
self.console.print(*messages)
|
||||
|
||||
def append_chat_history(self, text, linebreak=False, blockquote=False):
|
||||
if blockquote:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue