StockSense-AI / debug_env.py
PROSTLE's picture
fix: expose dependencies to system PATH and add robust diagnostics for LLM proxy
2adc8b6
raw
history blame contribute delete
785 Bytes
import os
import sys
import json
# Add backend to path
_BACKEND = os.path.join(os.getcwd(), "backend")
if _BACKEND not in sys.path:
sys.path.insert(0, _BACKEND)
print("--- OpenEnv Debug ---")
print(f"API_BASE_URL: {os.getenv('API_BASE_URL')}")
print(f"API_KEY: {'[PRESENT]' if os.getenv('API_KEY') else '[MISSING]'}")
print(f"HF_TOKEN: {'[PRESENT]' if os.getenv('HF_TOKEN') else '[MISSING]'}")
print(f"MODEL_NAME: {os.getenv('MODEL_NAME')}")
try:
from llm_proxy import get_llm_client
client = get_llm_client()
print(f"LLM Mode: {client.mode}")
if client.mode == "proxy":
print(f"Proxy URL: {client.api_base_url}")
print(f"Model: {client.model_name}")
except Exception as e:
print(f"Error initializing proxy: {e}")
print("--- End Debug ---")