Spaces:
Sleeping
Sleeping
| """Verify simple agent works without LangChain.""" | |
| print("Testing simple agent import...") | |
| try: | |
| from simple_agent import simple_agent | |
| print("β Simple agent imported successfully") | |
| print(f" - Has API key: {bool(simple_agent.api_key)}") | |
| print(f" - Has SerpApi key: {bool(simple_agent.serpapi_key)}") | |
| print() | |
| print("Testing extraction logic...") | |
| category, budget = simple_agent._extract_info("i need a mobile under 6k") | |
| print(f"β Extraction works: category={category}, budget={budget}") | |
| print() | |
| print("Testing database...") | |
| from database import db, Platform | |
| user = db.get_user(Platform.TELEGRAM, "test_user_999") | |
| print(f"β Database works: user={'found' if user else 'not found'}") | |
| print() | |
| print("="*60) | |
| print("π All checks passed!") | |
| print("="*60) | |
| print() | |
| print("Your simple agent is ready to use.") | |
| print() | |
| print("β οΈ IMPORTANT: You MUST restart the server!") | |
| print() | |
| print("Steps:") | |
| print("1. Press CTRL+C in the terminal running the bot") | |
| print("2. Run: .\\clear_cache.ps1 (optional but recommended)") | |
| print("3. Run: python main.py --mode all") | |
| print("4. Test: Send 'i need a mobile under 6k' to your bot") | |
| print() | |
| except ImportError as e: | |
| print(f"β Import failed: {e}") | |
| print() | |
| print("This might be a LangChain dependency issue.") | |
| print("The simple_agent should NOT import LangChain.") | |
| print() | |
| print("Check simple_agent.py and remove any LangChain imports.") | |
| except Exception as e: | |
| print(f"β Error: {e}") | |
| import traceback | |
| traceback.print_exc() | |