Spaces:
Runtime error
Runtime error
Add initial project structure with environment configuration, README, and core functionality
5606ca5 Download sql_agent.py from MukeshKapoor25/rca_sqlagent: direct link, hf CLI and curl.
- Browser
- Download file 502 Bytes
-
https://huggingface.co/spaces/MukeshKapoor25/rca_sqlagent/resolve/main/sql_agent.py
- Command line
-
hf download hf://spaces/MukeshKapoor25/rca_sqlagent/sql_agent.py
-
curl -L -o sql_agent.py https://huggingface.co/spaces/MukeshKapoor25/rca_sqlagent/resolve/main/sql_agent.py
502 Bytes
| from agent_core import get_sql_agent | |
| def main(): | |
| db_chain = get_sql_agent(verbose=True) | |
| print("Welcome to the RCA SQL Agent! Type your question (or 'exit' to quit):") | |
| while True: | |
| user_input = input("\n> ") | |
| if user_input.lower() in ("exit", "quit"): | |
| break | |
| try: | |
| result = db_chain.invoke(user_input) | |
| print("\nResult:\n", result) | |
| except Exception as e: | |
| print("Error:", e) | |
| if __name__ == "__main__": | |
| main() | |