Spaces:
Paused
Paused
Download agent_zero_framework/python/api/pause.py from Oldmangrizzz/Agent-Node: direct link, hf CLI and curl.
- Browser
- Download file 566 Bytes
-
https://huggingface.co/spaces/Oldmangrizzz/Agent-Node/resolve/main/agent_zero_framework/python/api/pause.py
- Command line
-
hf download hf://spaces/Oldmangrizzz/Agent-Node/agent_zero_framework/python/api/pause.py
-
curl -L -o pause.py https://huggingface.co/spaces/Oldmangrizzz/Agent-Node/resolve/main/agent_zero_framework/python/api/pause.py
566 Bytes
| from python.helpers.api import ApiHandler, Request, Response | |
| class Pause(ApiHandler): | |
| async def process(self, input: dict, request: Request) -> dict | Response: | |
| # input data | |
| paused = input.get("paused", False) | |
| ctxid = input.get("context", "") | |
| # context instance - get or create | |
| context = self.use_context(ctxid) | |
| context.paused = paused | |
| return { | |
| "message": "Agent paused." if paused else "Agent unpaused.", | |
| "pause": paused, | |
| } | |