Skip to main content

bitrouter_core/models/language/
usage.rs

1use crate::models::shared::types::JsonValue;
2
3/// Represents the token usage information for a language model call.
4#[derive(Debug, Clone)]
5pub struct LanguageModelUsage {
6    pub input_tokens: LanguageModelInputTokens,
7    pub output_tokens: LanguageModelOutputTokens,
8    pub raw: Option<JsonValue>,
9}
10
11/// Represents the token usage information for the input to a language model call.
12#[derive(Debug, Clone)]
13pub struct LanguageModelInputTokens {
14    pub total: Option<u32>,
15    pub no_cache: Option<u32>,
16    pub cache_read: Option<u32>,
17    pub cache_write: Option<u32>,
18}
19
20/// Represents the token usage information for the output from a language model call.
21#[derive(Debug, Clone)]
22pub struct LanguageModelOutputTokens {
23    pub total: Option<u32>,
24    pub text: Option<u32>,
25    pub reasoning: Option<u32>,
26}