Spaces:
Sleeping
Sleeping
| """ | |
| Quick Test Script for Multi-Model Fallback System | |
| This script tests the AI suggestion generation with fallback | |
| """ | |
| import os | |
| os.environ['GEMINI_API'] = 'test_key' # Set a test key | |
| os.environ['NVIDIA_API_KEY'] = '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' | |
| from app import generate_ai_suggestions_with_fallback | |
| # Test parameters | |
| test_crop = "RICE" | |
| test_parameters = { | |
| "Nitrogen": 90, | |
| "Phosphorus": 42, | |
| "Potassium": 43, | |
| "Temperature": 20.87, | |
| "Humidity": 82.00, | |
| "pH": 6.50, | |
| "Rainfall": 202.93, | |
| "Location": "Maharashtra, India" | |
| } | |
| print("="*60) | |
| print("🧪 TESTING MULTI-MODEL FALLBACK SYSTEM") | |
| print("="*60) | |
| print(f"\nTest Crop: {test_crop}") | |
| print(f"Test Parameters: {test_parameters}") | |
| print("\n" + "="*60) | |
| # Run the test | |
| result = generate_ai_suggestions_with_fallback(test_crop, test_parameters) | |
| print("\n" + "="*60) | |
| print("📊 RESULT:") | |
| print("="*60) | |
| print(result) | |
| print("\n" + "="*60) | |
| print("✅ Test completed!") | |
| print("="*60) | |