From a57a45ab49c05e24ba07671bf53aff0542b61506 Mon Sep 17 00:00:00 2001 From: Mery-Sanz Date: Wed, 18 Jun 2025 07:38:39 +0000 Subject: [PATCH] remove warning --- src/cai/util.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/cai/util.py b/src/cai/util.py index ddf92545..8385d9a5 100644 --- a/src/cai/util.py +++ b/src/cai/util.py @@ -557,7 +557,15 @@ class CostTracker: self.model_pricing_cache[model_name] = (input_cost_per_token, output_cost_per_token) return input_cost_per_token, output_cost_per_token except Exception as e: - print(f" WARNING: Error fetching model pricing: {str(e)}") + # Check if it's a network connectivity issue by testing a simple connection + try: + import requests + test_response = requests.get("https://aliasrobotics.com/", timeout=1) + # The pricing URL failed + print(f" WARNING: Error fetching model pricing: {str(e)}") + except Exception: + # No internet connection, silently skip the warning + pass # Default to zero cost if no pricing found (local/free models) default_pricing = (0.0, 0.0)