Download test_all_providers.py from C2MV/letxinet: direct link, hf CLI and curl.
- Browser
- Download file 686 Bytes
-
https://huggingface.co/spaces/C2MV/letxinet/resolve/main/test_all_providers.py
- Command line
-
hf download hf://spaces/C2MV/letxinet/test_all_providers.py
-
curl -L -o test_all_providers.py https://huggingface.co/spaces/C2MV/letxinet/resolve/main/test_all_providers.py
686 Bytes
| import asyncio | |
| import sys | |
| sys.path.insert(0, ".") | |
| from backend.tools.search_engine import PROVIDERS | |
| async def test_provider(name, func): | |
| query = "cancer" | |
| try: | |
| results = await func(query, limit=2) | |
| print(f"✅ {name:15}: {len(results)} results") | |
| except Exception as e: | |
| print(f"❌ {name:15}: ERROR - {str(e)}") | |
| async def main(): | |
| print("Testing all providers in backend.tools.search_engine.PROVIDERS...\n") | |
| tasks = [] | |
| for name, func in PROVIDERS.items(): | |
| tasks.append(test_provider(name, func)) | |
| await asyncio.gather(*tasks) | |
| if __name__ == "__main__": | |
| sys.stdout.reconfigure(encoding='utf-8') | |
| asyncio.run(main()) | |