Spaces:
Running on Zero
Running on Zero
Download Agent/test_query_runner.py from Aniruddha7/QueryLensV2b: direct link, hf CLI and curl.
- Browser
- Download file 809 Bytes
-
https://huggingface.co/spaces/Aniruddha7/QueryLensV2b/resolve/main/Agent/test_query_runner.py
- Command line
-
hf download hf://spaces/Aniruddha7/QueryLensV2b/Agent/test_query_runner.py
-
curl -L -o test_query_runner.py https://huggingface.co/spaces/Aniruddha7/QueryLensV2b/resolve/main/Agent/test_query_runner.py
809 Bytes
| import asyncio | |
| import os | |
| import sys | |
| # Ensure Agent package path is importable | |
| sys.path.insert(0, r"e:/Capstone_Project/text2sql-agent-mcp/Agent") | |
| import backups.agentic_workflow4 as aw | |
| async def run_one(): | |
| # Initialize DB (use the module's configured DB_CONNECTION_URL when available) | |
| db_uri = os.environ.get('DB_CONNECTION_URL') or getattr(aw, 'DB_CONNECTION_URL', None) | |
| await aw.initialize_database(db_uri) | |
| # Run a single question | |
| # Prefix with 're-execute' to force regeneration and bypass any cached error in memory | |
| res = await aw.agentic_query_process('re-execute Who are the top 10 highest-paid employees?') | |
| print('\n--- AGENT OUTPUT START ---') | |
| print(res) | |
| print('--- AGENT OUTPUT END ---') | |
| if __name__ == '__main__': | |
| asyncio.run(run_one()) | |