-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_brain_fix.py
More file actions
53 lines (41 loc) · 1.51 KB
/
test_brain_fix.py
File metadata and controls
53 lines (41 loc) · 1.51 KB
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
#!/usr/bin/env python3
"""Test the brain fixes for encoding and method name issues"""
import asyncio
import sys
from pathlib import Path
# Add parent directory to path
parent_dir = Path(__file__).parent
sys.path.insert(0, str(parent_dir))
async def test_brain():
try:
# Test imports
from core.brain import AutumnBrain
from core.memory import AutumnMemory
from config.personality import AutumnPersonality
print("✓ Imports successful")
# Initialize components
memory = AutumnMemory()
await memory.initialize()
print("✓ Memory initialized")
personality = AutumnPersonality()
print("✓ Personality initialized")
# Initialize brain
brain = AutumnBrain(memory, personality)
await brain.initialize()
print("✓ Brain initialized")
# Test simple query
response = await brain.process("Hello")
print(f"✓ Query processed: {response[:50]}...")
# Test math query
response = await brain.process("What is 2 + 2?")
print(f"✓ Math query processed: {response[:50]}...")
# Cleanup
await brain.shutdown()
print("✓ Brain shutdown")
print("\n🎉 All tests passed! Brain fixes working correctly!")
except Exception as e:
print(f"❌ Error: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
asyncio.run(test_brain())