Skip to content

Commit 3f2de17

Browse files
authored
collab: Set cached token values when initially creating lifetime usage records (#18865)
This PR fixes an issue where we weren't setting the cached token fields when initially creating a lifetime usage record. Release Notes: - N/A
1 parent 77bf2ad commit 3f2de17

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/collab/src/llm/db/queries/usages.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,10 @@ impl LlmDatabase {
382382
user_id: ActiveValue::set(user_id),
383383
model_id: ActiveValue::set(model.id),
384384
input_tokens: ActiveValue::set(input_token_count as i64),
385+
cache_creation_input_tokens: ActiveValue::set(
386+
cache_creation_input_tokens as i64,
387+
),
388+
cache_read_input_tokens: ActiveValue::set(cache_read_input_tokens as i64),
385389
output_tokens: ActiveValue::set(output_token_count as i64),
386390
..Default::default()
387391
}

0 commit comments

Comments
 (0)