File size: 1,585 Bytes
0c6718b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""
Test reasoning display in conversation logging.
"""

import sys
import os
from dotenv import load_dotenv

# Load environment variables
load_dotenv()

# Add project root to path
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))

from src.core.simplified_medical_app import SimplifiedMedicalApp

def test_reasoning_display():
    """Test reasoning display with indicators."""
    print("🧪 Testing Reasoning Display")
    print("=" * 50)
    
    # Create app instance
    app = SimplifiedMedicalApp()
    
    # Test messages with different classifications
    test_messages = [
        "Привіт!",  # Should be GREEN
        "Я дуже хвилююся і не можу спати",  # Should be YELLOW with reasoning
        "Мені здається, що все безнадійно і немає сенсу жити"  # Should be YELLOW/RED with reasoning
    ]
    
    history = []
    
    for i, message in enumerate(test_messages, 1):
        print(f"\n--- Test {i}: '{message}' ---")
        
        # Process message
        new_history, status = app.process_message(message, history)
        history = new_history
        
        # Print the response with reasoning
        if history:
            last_response = history[-1]["content"]
            print("Response with reasoning:")
            print(last_response[:400] + "..." if len(last_response) > 400 else last_response)
        
        print(f"Spiritual State: {app.spiritual_state.spiritual_state.value}")

if __name__ == "__main__":
    test_reasoning_display()