MCPcopy Create free account
hub / github.com/ccusage/ccusage / is_assistant_message

Function is_assistant_message

rust/crates/ccusage/src/adapter/codebuff/parser.rs:127–134  ·  view source on GitHub ↗
(message: &serde_json::Map<String, Value>)

Source from the content-addressed store, hash-verified

125}
126
127fn is_assistant_message(message: &serde_json::Map<String, Value>) -> bool {
128 matches!(
129 string_field(message, "variant")
130 .or_else(|| string_field(message, "role"))
131 .as_deref(),
132 Some("ai" | "agent" | "assistant")
133 )
134}
135
136fn extract_assistant_usage(message: &serde_json::Map<String, Value>) -> AssistantUsage {
137 let mut usage = AssistantUsage::default();

Callers 1

load_chat_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected