chore: justify the cast_precision_loss allows with reasons (#1474 slice)
This commit is contained in:
parent
09bcf9fd7a
commit
c819eab947
3 changed files with 40 additions and 10 deletions
|
|
@ -205,7 +205,10 @@ fn read_agent(path: &Path, from: i64) -> rusqlite::Result<AgentAgg> {
|
|||
agg.cache_read = agg.cache_read.saturating_add(cache_read);
|
||||
agg.cache_creation = agg.cache_creation.saturating_add(cache_creation);
|
||||
let p = model_prices(&model);
|
||||
#[allow(clippy::cast_precision_loss)]
|
||||
#[allow(
|
||||
clippy::cast_precision_loss,
|
||||
reason = "token counts stay well under f64's 2^53 exact-integer range, so this cost computation loses no precision"
|
||||
)]
|
||||
{
|
||||
agg.cost += (input as f64 * p.input
|
||||
+ output as f64 * p.output
|
||||
|
|
|
|||
Loading…
Reference in a new issue