From de02038a7e25f4edeb3d2992a53be6debd193664 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 5 Jul 2023 21:08:49 -0700 Subject: [PATCH] remove ref to quoted_file --- aider/commands.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/aider/commands.py b/aider/commands.py index e3b3ee441..dfa54509f 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -9,7 +9,7 @@ import git import tiktoken from prompt_toolkit.completion import Completion -from aider import prompts, utils +from aider import prompts class Commands: @@ -117,8 +117,10 @@ class Commands: # files for fname in self.coder.abs_fnames: relative_fname = self.coder.get_rel_fname(fname) - quoted = utils.quoted_file(fname, relative_fname) - tokens = len(self.tokenizer.encode(quoted)) + content = self.io.read_text(fname) + # approximate + content = "```\n" + content + "```\n" + tokens = len(self.tokenizer.encode(content)) res.append((tokens, f"{relative_fname}", "use /drop to drop from chat")) self.io.tool_output("Approximate context window usage, in tokens:")