| import os | |
| import sys | |
| # Add the parent directory to sys.path to ensure we can import 'app' | |
| # Assuming this script is run from backend/scripts/ or backend/ | |
| sys.path.append(os.path.join(os.path.dirname(__file__), '..')) | |
| from app.config import config | |
| from app.reasoning import reasoning_engine | |
| def test_openrouter(): | |
| print(f"Testing OpenRouter with model: {config.LLM_MODEL}") | |
| print(f"API Key present: {bool(config.OPENROUTER_API_KEY)}") | |
| try: | |
| response = reasoning_engine._chat([ | |
| {"role": "user", "content": "Hello, are you working?"} | |
| ]) | |
| print(f"Response: {response}") | |
| except Exception as e: | |
| print(f"Error: {e}") | |
| if __name__ == "__main__": | |
| test_openrouter() | |