MCPcopy Index your code
hub / github.com/AI45Lab/Code / test_llm_cost_record_fields

Function test_llm_cost_record_fields

core/src/telemetry.rs:615–632  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

613
614 #[test]
615 fn test_llm_cost_record_fields() {
616 let record = LlmCostRecord {
617 model: "gpt-4o".to_string(),
618 provider: "openai".to_string(),
619 prompt_tokens: 500,
620 completion_tokens: 200,
621 total_tokens: 700,
622 cost_usd: None,
623 timestamp: chrono::Utc::now(),
624 session_id: None,
625 };
626 assert_eq!(
627 record.total_tokens,
628 record.prompt_tokens + record.completion_tokens
629 );
630 assert!(record.cost_usd.is_none());
631 assert!(record.session_id.is_none());
632 }
633
634 #[test]
635 fn test_attribute_keys_are_unique() {

Callers

nothing calls this directly

Calls 1

nowFunction · 0.85

Tested by

no test coverage detected