import requests import json import time def test_quality_fixed_api(): """Test the new quality-fixed API""" test_scenes = [ "A car driving through a city at night with neon lights", "A person dancing in a room with colorful lighting effects", "A mountain landscape with sunset and trees" ] print("๐Ÿงช TESTING QUALITY-FIXED API OUTPUTS...") print("=" * 60) for scene in test_scenes: try: response = requests.post( "http://localhost:8003/describe/scene", json={ "scene_description": scene, "enhance_adjectives": True, "adjective_density": 0.6, "grammar_constraint": True }, timeout=10 ) if response.status_code == 200: result = response.json() print(f"๐ŸŽฏ INPUT: {scene}") print(f"๐ŸŽจ OUTPUT: {result['enhanced_description']}") print(f"โฑ๏ธ TIME: {result['processing_time']:.2f}ms") print("โ”€" * 50) else: print(f"โŒ Failed for: {scene}") except Exception as e: print(f"๐Ÿ’ฅ Error: {e}") if __name__ == "__main__": test_quality_fixed_api()