mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
handle new vars that accumulate tokens/costs for infinite output
This commit is contained in:
parent
c1d4adbebf
commit
8a21eb7804
1 changed files with 11 additions and 6 deletions
|
@ -1425,22 +1425,27 @@ class Coder:
|
|||
self.usage_report = tokens_report
|
||||
|
||||
def show_usage_report(self):
|
||||
if self.usage_report:
|
||||
self.io.tool_output(self.usage_report)
|
||||
self.message_cost = 0.0
|
||||
self.message_tokens_sent = 0
|
||||
self.message_tokens_received = 0
|
||||
if not self.usage_report:
|
||||
return
|
||||
|
||||
self.io.tool_output(self.usage_report)
|
||||
|
||||
prompt_tokens = self.message_tokens_sent
|
||||
completion_tokens = self.message_tokens_received
|
||||
self.event(
|
||||
"message_send",
|
||||
main_model=self.main_model,
|
||||
prompt_tokens=prompt_tokens,
|
||||
completion_tokens=completion_tokens,
|
||||
total_tokens=prompt_tokens + completion_tokens,
|
||||
cost=cost,
|
||||
cost=self.message_cost,
|
||||
total_cost=self.total_cost,
|
||||
)
|
||||
|
||||
self.message_cost = 0.0
|
||||
self.message_tokens_sent = 0
|
||||
self.message_tokens_received = 0
|
||||
|
||||
def get_multi_response_content(self, final=False):
|
||||
cur = self.multi_response_content or ""
|
||||
new = self.partial_response_content or ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue