| import sys | |
| import os | |
| import time | |
| sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))) | |
| from backend.app.reasoning import reasoning_engine | |
| def test_heavy_load(): | |
| print("Testing Audio Script Generation with Heavy Load...") | |
| # Simulate heavy context ~5000 words | |
| context = ["Artificial Intelligence (AI) in healthcare is a rapidly evolving field... " * 500] | |
| start_time = time.time() | |
| try: | |
| script = reasoning_engine.generate_content("audio", context) | |
| end_time = time.time() | |
| print(f"Time taken: {end_time - start_time:.2f} seconds") | |
| if "Error" in script: | |
| print("FAILED: Logic returned error message") | |
| print(script) | |
| else: | |
| print("SUCCESS: Script generated") | |
| print(f"Script Length: {len(script)} chars") | |
| except Exception as e: | |
| print(f"EXCEPTION: {e}") | |
| if __name__ == "__main__": | |
| test_heavy_load() | |