mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
Fixed bug with cost computations when --no-steam in effect #475
This commit is contained in:
parent
a1a2cf7ac2
commit
72e6cb901c
2 changed files with 3 additions and 2 deletions
|
@ -706,7 +706,8 @@ class Coder:
|
||||||
tokens = f"{prompt_tokens} prompt tokens, {completion_tokens} completion tokens"
|
tokens = f"{prompt_tokens} prompt tokens, {completion_tokens} completion tokens"
|
||||||
if self.main_model.prompt_price:
|
if self.main_model.prompt_price:
|
||||||
cost = prompt_tokens * self.main_model.prompt_price / 1000
|
cost = prompt_tokens * self.main_model.prompt_price / 1000
|
||||||
cost += completion_tokens * self.main_model.completion_price / 1000
|
if self.main_model.completion_price:
|
||||||
|
cost += completion_tokens * self.main_model.completion_price / 1000
|
||||||
tokens += f", ${cost:.6f} cost"
|
tokens += f", ${cost:.6f} cost"
|
||||||
self.total_cost += cost
|
self.total_cost += cost
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ class ModelInfo:
|
||||||
name: str
|
name: str
|
||||||
max_context_tokens: int
|
max_context_tokens: int
|
||||||
prompt_price: float
|
prompt_price: float
|
||||||
completions_price: float
|
completion_price: float
|
||||||
edit_format: str
|
edit_format: str
|
||||||
always_available: bool = False
|
always_available: bool = False
|
||||||
use_repo_map: bool = False
|
use_repo_map: bool = False
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue