()
| 300 | |
| 301 | #[tokio::test] |
| 302 | async fn test_cost_estimation() { |
| 303 | graphbit_core::init().expect("Failed to initialize GraphBit"); |
| 304 | |
| 305 | let usage = LlmUsage::new(1000, 500); |
| 306 | let response = LlmResponse::new("Test response", "gpt-3.5-turbo").with_usage(usage); |
| 307 | |
| 308 | let cost = response.estimate_cost(0.001, 0.002); // $0.001 per input token, $0.002 per output token |
| 309 | assert_eq!(cost, 2.0); // 1000 * 0.001 + 500 * 0.002 = 1.0 + 1.0 = 2.0 |
| 310 | } |
| 311 | |
| 312 | // Real API integration tests (require environment variables) |
| 313 | #[tokio::test] |
nothing calls this directly
no test coverage detected