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:
Paul Gauthier 2023-05-17 15:20:52 -07:00
parent fc1dac4ac3
commit bca4674e07

View file

@ -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: