Spaces:
Paused

File size: 1,714 Bytes
65f8a38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import asyncio
import os
import sys

# Ensure windows compatibility
if sys.platform == 'win32':
    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

from uuid import uuid4
from langchain_core.messages import HumanMessage
from agents.nexus_master import get_nexus_app

async def main():
    print("Testing Nexus Master Agent Compilation...")
    try:
        app = get_nexus_app(is_agent=True)
        print("Nexus Graph Compiled Successfully!")
        
        # Test state initialization schema correctness
        print("Testing state schema...")
        thread_id = uuid4()
        initial_state = {
            "messages": [HumanMessage(content="Hello Nexus!")],
            "workspace_id": uuid4(),
            "user_role": "admin",
            "is_agent": True,
            "user_name": "Test User",
            "user_id": uuid4(),
            "sources": [],
            "current_tool_output": "",
            "pending_actions": [],
            "action_approved": False,
            "vision_context": [],
            "ticket_id": None,
            "thread_id": thread_id,
            "target_user_id": None,
            "target_status": None,
            "internal_summary": "",
            "ticket_context": "",
            "ai_gist": {}
        }
        
        # Running the initializer node directly to check logic
        from agents.nexus_master import nexus_initializer
        res = await nexus_initializer(initial_state)
        print("Initializer Result Keys:", res.keys())
        print("Initializer current_tool_output:", res.get("current_tool_output"))
        
    except Exception as e:
        print("ERROR:", e)

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