Download agent.py from Punisher2444/Final_Assignment_Template: direct link, hf CLI and curl.
- Browser
- Download file 326 Bytes
-
https://huggingface.co/spaces/Punisher2444/Final_Assignment_Template/resolve/main/agent.py
- Command line
-
hf download hf://spaces/Punisher2444/Final_Assignment_Template/agent.py
-
curl -L -o agent.py https://huggingface.co/spaces/Punisher2444/Final_Assignment_Template/resolve/main/agent.py
326 Bytes
| from agent_config import create_agent | |
| class BasicAgent: | |
| def __init__(self): | |
| print("BasicAgent initialized.") | |
| self.agent = create_agent() | |
| def __call__(self, question: str) -> str: | |
| try: | |
| return self.agent.run(question) | |
| except Exception as e: | |
| return f"Error: {e}" | |