Skip to content

Commit

Permalink
Add Default trait to TokenUsage struct
Browse files Browse the repository at this point in the history
  • Loading branch information
scald committed Nov 25, 2024
1 parent 0f7e89b commit 5532b50
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/providers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,13 @@ pub use openai::OpenAIProvider;
use serde::Serialize;

#[derive(Debug, Clone, Serialize)]
#[derive(Default)]
pub struct TokenUsage {
pub prompt_tokens: usize,
pub completion_tokens: usize,
pub total_tokens: usize,
}

impl Default for TokenUsage {
fn default() -> Self {
Self {
prompt_tokens: 0,
completion_tokens: 0,
total_tokens: 0,
}
}
}

#[derive(Debug, Clone, Copy)]
pub enum AIProvider {
Expand Down

0 comments on commit 5532b50

Please sign in to comment.