Add debug logging for Supabase environment variables
Browse files- CHANGELOG.md +5 -0
- utils/supabase_client.py +4 -0
CHANGELOG.md
CHANGED
|
@@ -49,6 +49,11 @@
|
|
| 49 |
- Added comprehensive logging (success, error, quota exceeded)
|
| 50 |
- Added token aggregation from all sub-agents
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
- **GenerationAgent (agents/generation_agent.py)**
|
| 53 |
- Added token usage extraction from OpenAI response
|
| 54 |
- Returns usage info in response dict
|
|
|
|
| 49 |
- Added comprehensive logging (success, error, quota exceeded)
|
| 50 |
- Added token aggregation from all sub-agents
|
| 51 |
|
| 52 |
+
### Fixed
|
| 53 |
+
- **Supabase Client Debug Logging**
|
| 54 |
+
- Added debug output to show SUPABASE_URL and SUPABASE_KEY values during initialization
|
| 55 |
+
- Helps troubleshoot environment variable loading issues on HF Spaces
|
| 56 |
+
|
| 57 |
- **GenerationAgent (agents/generation_agent.py)**
|
| 58 |
- Added token usage extraction from OpenAI response
|
| 59 |
- Returns usage info in response dict
|
utils/supabase_client.py
CHANGED
|
@@ -25,6 +25,10 @@ class SupabaseClient:
|
|
| 25 |
self.supabase_url = supabase_url or os.getenv('SUPABASE_URL')
|
| 26 |
self.supabase_key = supabase_key or os.getenv('SUPABASE_KEY')
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
if not self.supabase_url or not self.supabase_key:
|
| 29 |
print("WARNING: Supabase credentials not configured. Logging will be disabled.")
|
| 30 |
self.client = None
|
|
|
|
| 25 |
self.supabase_url = supabase_url or os.getenv('SUPABASE_URL')
|
| 26 |
self.supabase_key = supabase_key or os.getenv('SUPABASE_KEY')
|
| 27 |
|
| 28 |
+
# Debug logging
|
| 29 |
+
print(f"SupabaseClient: SUPABASE_URL from env: {self.supabase_url[:50] if self.supabase_url else 'None'}")
|
| 30 |
+
print(f"SupabaseClient: SUPABASE_KEY from env: {'[SET]' if self.supabase_key else 'None'}")
|
| 31 |
+
|
| 32 |
if not self.supabase_url or not self.supabase_key:
|
| 33 |
print("WARNING: Supabase credentials not configured. Logging will be disabled.")
|
| 34 |
self.client = None
|