| import sys | |
| import os | |
| sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))) | |
| from backend.app.reasoning import reasoning_engine | |
| def test_script_gen(): | |
| print("Testing Audio Script Generation...") | |
| context = ["Artificial Intelligence is transforming healthcare by improving diagnostic accuracy."] | |
| try: | |
| script = reasoning_engine.generate_content("audio", context) | |
| print("--- Generated Script Start ---") | |
| print(script) | |
| print("--- Generated Script End ---") | |
| if "Error" in script: | |
| print("FAILED: Logic returned error message") | |
| elif len(script) < 10: | |
| print("FAILED: Script too short") | |
| else: | |
| print("SUCCESS: Script generated") | |
| except Exception as e: | |
| print(f"EXCEPTION: {e}") | |
| if __name__ == "__main__": | |
| test_script_gen() | |