Spaces:
Paused
Paused
Download agents/scratch/test_graph.py from 3SCError404/miracle: direct link, hf CLI and curl.
- Browser
- Download file 1.71 kB
-
https://huggingface.co/spaces/3SCError404/miracle/resolve/main/agents/scratch/test_graph.py
- Command line
-
hf download hf://spaces/3SCError404/miracle/agents/scratch/test_graph.py
-
curl -L -o test_graph.py https://huggingface.co/spaces/3SCError404/miracle/resolve/main/agents/scratch/test_graph.py
1.71 kB
| 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()) | |