Spaces:
Paused
Paused
Download backend/api/registry.py from Kyoiske/GOAT-Evolution: direct link, hf CLI and curl.
- Browser
- Download file 559 Bytes
-
https://huggingface.co/spaces/Kyoiske/GOAT-Evolution/resolve/main/backend/api/registry.py
- Command line
-
hf download hf://spaces/Kyoiske/GOAT-Evolution/backend/api/registry.py
-
curl -L -o registry.py https://huggingface.co/spaces/Kyoiske/GOAT-Evolution/resolve/main/backend/api/registry.py
559 Bytes
| from __future__ import annotations | |
| from fastapi import APIRouter, HTTPException | |
| from backend.core.registry import registry | |
| router = APIRouter() | |
| async def list_registry(): | |
| return registry.get_all() | |
| async def emergent_registry(): | |
| return registry.get_emergent() | |
| async def get_entry(attack_id: str): | |
| for entry in registry.get_all(): | |
| if entry.get("attack_id") == attack_id: | |
| return entry | |
| raise HTTPException(status_code=404, detail="Entry not found") | |