# -*- coding: utf-8 -*- """ Simple test for מראות model generation without Gradio interface Tests the improved model generation logic """ import os # Force lightweight model for testing os.environ["FORCE_LIGHT_MODEL"] = "1" from app import MirautrApp from conversation_manager import ConversationManager def test_model_generation(): """Test the model generation without Gradio interface""" print("🧪 Testing מראות model generation...") # Initialize app app = MirautrApp() # Create conversation manager and state conv_manager = ConversationManager() state = conv_manager.create_new_session() # Set up a test conversation state = conv_manager.set_initial_context(state, "current_challenge", "אני מתמודד עם לחצים בעבודה") state = conv_manager.set_selected_part(state, "הקול הביקורתי", "דנה", None, None) # Test message test_message = "אני מרגיש שאני לא מספיק טוב בעבודה" print(f"\n📝 Test input: {test_message}") print(f"🎭 Selected part: {state.selected_part}") print(f"👤 Persona name: {state.persona_name}") # Generate response response = app.generate_response(test_message, state) print(f"\n🤖 Generated response:") print(f" {response}") # Test another part print("\n" + "="*50) state = conv_manager.set_selected_part(state, "הילד/ה הפנימית", "עדן", None, None) test_message2 = "אני פוחד שאני לא מספיק חכם" print(f"📝 Test input: {test_message2}") print(f"🎭 Selected part: {state.selected_part}") print(f"👤 Persona name: {state.persona_name}") response2 = app.generate_response(test_message2, state) print(f"\n🤖 Generated response:") print(f" {response2}") print("\n✅ Model generation test completed!") if __name__ == "__main__": test_model_generation()