mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
![]() # Aider chat conversation: USER: add a tqdm to `summarize_chat_history_markdown` loop ASSISTANT: ```diff --- aider/history.py +++ aider/history.py @@ ... @@ from aider.sendchat import simple_send_with_retries +from tqdm import tqdm class ChatSummary: def __init__(self, model=None, max_tokens=1024): @@ ... @@ def summarize_chat_history_markdown(self, text): messages = [] assistant = [] + lines = text.splitlines(keepends=True) + for line in tqdm(lines, desc="Summarizing chat history"): - for line in text.splitlines(keepends=True): if line.startswith("# "): continue if line.startswith(">"): continue if line.startswith("#### /"): continue if line.startswith("#### "): if assistant: assistant = "".join(assistant) if assistant.strip(): messages.append(dict(role="assistant", content=assistant)) assistant = [] content = line[5:] if content.strip() and content.strip() != "<blank>": messages.append(dict(role="user", content=line[5:])) continue assistant.append(line) summary = self.summarize(messages[-40:]) return summary ``` This diff adds the `tqdm` progress bar to the `summarize_chat_history_markdown` method in the `aider/history.py` file. It wraps the loop that processes the chat history lines with `tqdm`, providing a description for the progress bar. |
||
---|---|---|
.. | ||
coders | ||
queries | ||
__init__.py | ||
args.py | ||
commands.py | ||
diffs.py | ||
dump.py | ||
gui.py | ||
history.py | ||
io.py | ||
main.py | ||
mdstream.py | ||
models.py | ||
prompts.py | ||
repo.py | ||
repomap.py | ||
scrape.py | ||
sendchat.py | ||
utils.py | ||
versioncheck.py | ||
voice.py |