Spaces:
Running
Running
Ibrahim Kabore
v2.0: Gradio 5 migration, knowledge base consolidation, intelligence upgrades
dea2eaa | import os | |
| import logging | |
| from langfuse import Langfuse | |
| from aibrahim.config import CONFIG | |
| logging.basicConfig(level=logging.INFO) | |
| logger = logging.getLogger("auth_check") | |
| def check_auth(): | |
| logger.info("Checking Langfuse Auth directly...") | |
| pk = CONFIG.langfuse_public_key | |
| sk = CONFIG.langfuse_secret_key | |
| host = CONFIG.langfuse_host | |
| logger.info(f"Using Host: {host}") | |
| logger.info(f"Using PK: {pk[:10]}...") | |
| try: | |
| # Initialize client explicitly | |
| langfuse = Langfuse( | |
| public_key=pk, | |
| secret_key=sk, | |
| host=host | |
| ) | |
| # Auth check | |
| is_valid = langfuse.auth_check() | |
| if is_valid: | |
| logger.info("✅ SUCCESS: Keys are valid and accepted by Langfuse API.") | |
| else: | |
| logger.error("❌ FAILURE: Langfuse API rejected the keys (Auth Check returned False).") | |
| except Exception as e: | |
| logger.error(f"❌ ERROR calling auth_check: {e}") | |
| if __name__ == "__main__": | |
| check_auth() | |