File size: 2,024 Bytes
24f95f0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import asyncio
import json
import logging
import os
import sys

# Configure logging
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(name)s — %(message)s")
logger = logging.getLogger("VERIFY")

# Add backend and app to path
sys.path.append(os.path.join(os.getcwd(), "backend"))
sys.path.append(os.path.join(os.getcwd(), "backend", "app"))

async def verify():
    logger.info("--- JANUS LITE VERIFICATION START ---")
    
    try:
        from app.graph import get_compiled_graph
        from app.config import HUGGINGFACE_API_KEY, HUGGINGFACE_MODEL, PRIMARY_PROVIDER
        
        logger.info(f"Configuration: Primary={PRIMARY_PROVIDER}")
        
        graph = get_compiled_graph()
        
        # Simple Lite Query
        user_input = "Hello, introduce yourself briefly."
        
        initial_state = {
            "user_input": user_input,
            "complexity": "low",
            "replan_count": 0,
            "context": {}
        }
        
        logger.info("Executing Graph (Lite Mode)...")
        final_state = await graph.ainvoke(initial_state)
        
        logger.info("Graph Execution COMPLETE.")
        
        # Validation
        result = final_state.get("final", {})
        response = result.get("response", "")
        
        print("\n" + "="*50)
        print("LITE VERIFICATION RESULTS")
        print("="*50)
        
        if "<think>" in response:
            print("[PASS] Reasoning Transparency detected.")
        else:
            print("[FAIL] Reasoning Transparency MISSING.")
            
        if "I " in response or "Me " in response or "My " in response:
            print("[PASS] Unified Persona detected.")
        else:
            print("[FAIL] Unified Persona MISSING.")
            
        print("-" * 30)
        print("RESPONSE:")
        print(response)
        print("-" * 30)
        
    except Exception as e:
        logger.error(f"Verification FAILED: {e}")

if __name__ == "__main__":
    asyncio.run(verify())