File size: 1,268 Bytes
5c429d4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import requests
import json

def test_intelligence():
    url = "http://localhost:8000/api/search/intelligence"
    payload = {
        "url": "https://mohrek.com/",
        "max_pages": 1,
        "api_keys": {
            "groq": "test_key",
            "openai": "test_key"
        }
    }
    
    print(f"Testing Intelligence Engine for: {payload['url']}")
    try:
        r = requests.post(url, json=payload)
        res = r.json()
        
        if not res.get('ok'):
            print(f"❌ Error: {res.get('error')}")
            return
            
        report = res['report']
        print(f"✅ Report Synchronized")
        print(f"Intent Top: {report['intent_analysis']['top_intent']}")
        print(f"Entities: {json.dumps(report['entities'], indent=2)}")
        print(f"Gaps: {report['content_gaps']}")
        
        # Check if AbayaNoir is still hardcoded
        if "Abaya" in str(report['entities']) or "Abaya" in str(report['content_gaps']):
            print("⚠️ WARNING: Hardcoded 'AbayaNoir' values still present!")
        else:
            print("✨ Success: AI/Dynamic content detected.")
            
    except Exception as e:
        print(f"❌ Connection failed: {e}")

if __name__ == "__main__":
    test_intelligence()