File size: 1,042 Bytes
b2501a8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""

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)