| import sys |
| import os |
| from pathlib import Path |
|
|
| |
| sys.path.insert(0, str(Path(__file__).parent.resolve())) |
|
|
| def run_cross_verification(): |
| print("==================================================") |
| print("[*] RUNNING COMPREHENSIVE CROSS-VERIFICATION TESTS") |
| print("==================================================") |
|
|
| |
| from config import Config, build_system_prompt |
| print("1. [Config] R2 Configured:", Config.r2_configured()) |
| print(" [Config] LLM Base URL:", Config.LLM_BASE_URL) |
| print(" [Config] LLM Model:", Config.LLM_MODEL) |
| |
| |
| from r2_manager import R2MemoryManager |
| r2 = R2MemoryManager() |
| print("2. [R2Manager] Connection status:", r2.is_connected) |
| state = r2.load_state() |
| memory = r2.load_memory() |
| print(" [R2Manager] State loaded status:", state.get("status")) |
| print(" [R2Manager] Memory entries count:", len(memory.get("entries", []))) |
| |
| |
| from agent import HermesAgent |
| agent = HermesAgent() |
| boot_msg = agent.boot() |
| print("3. [Agent] Boot message:", boot_msg.encode('ascii', 'ignore').decode('ascii')) |
| assert agent.booted is True, "Agent must be booted" |
| |
| prompt = agent.get_system_prompt() |
| assert "System Architecture & Environment" in prompt |
| print(" [Agent] System prompt rendered successfully (Length:", len(prompt), "chars)") |
|
|
| |
| mock_history = [("Hello", "Hi there!"), ("What is your status?", "I am ready.")] |
| reply = agent.chat("Are you working?", mock_history) |
| print("4. [Agent] Chat response preview:", reply[:100].encode('ascii', 'ignore').decode('ascii')) |
|
|
| |
| from app import demo |
| print("5. [Gradio App] Demo component initialized successfully!") |
|
|
| print("\n==================================================") |
| print("[+] ALL CROSS-VERIFICATION TESTS PASSED CLEANLY!") |
| print("==================================================") |
|
|
| if __name__ == "__main__": |
| run_cross_verification() |
|
|