From afe50cab3d3528b750d9532b359e766e358a24af Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sun, 28 Jul 2024 15:54:04 -0300 Subject: [PATCH] Update the `calculate_and_show_tokens_and_cost` method to use the `messages` parameter if `completion.usage` is not available. --- aider/coders/base_coder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index e9cbdc4df..862d9290a 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -1137,7 +1137,7 @@ class Coder: if interrupted: raise KeyboardInterrupt - self.calculate_and_show_tokens_and_cost(messages, completion) + self.calculate_and_show_tokens_and_cost(messages, completion) def show_send_output(self, completion): if self.verbose: