mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
feat: add self.event() to calculate_and_show_tokens_and_cost
This commit is contained in:
parent
4129065d6c
commit
57ce0dca67
1 changed files with 8 additions and 0 deletions
|
@ -1411,6 +1411,14 @@ class Coder:
|
||||||
f" Cost: ${format_cost(cost)} request, ${format_cost(self.total_cost)} session."
|
f" Cost: ${format_cost(cost)} request, ${format_cost(self.total_cost)} session."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.event("token_usage",
|
||||||
|
prompt_tokens=prompt_tokens,
|
||||||
|
completion_tokens=completion_tokens,
|
||||||
|
total_tokens=prompt_tokens + completion_tokens,
|
||||||
|
cost=cost,
|
||||||
|
total_cost=self.total_cost,
|
||||||
|
model=self.main_model.name)
|
||||||
|
|
||||||
def get_multi_response_content(self, final=False):
|
def get_multi_response_content(self, final=False):
|
||||||
cur = self.multi_response_content or ""
|
cur = self.multi_response_content or ""
|
||||||
new = self.partial_response_content or ""
|
new = self.partial_response_content or ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue