Spaces:
Running
Running
Download console/src/lib/ingestContract.mjs from Leon4gr45/brain: direct link, hf CLI and curl.
- Browser
- Download file 306 Bytes
-
https://huggingface.co/spaces/Leon4gr45/brain/resolve/main/console/src/lib/ingestContract.mjs
- Command line
-
hf download hf://spaces/Leon4gr45/brain/console/src/lib/ingestContract.mjs
-
curl -L -o ingestContract.mjs https://huggingface.co/spaces/Leon4gr45/brain/resolve/main/console/src/lib/ingestContract.mjs
306 Bytes
| export function requireAcceptedTask(status, payload) { | |
| const id = payload?.task_id; | |
| if (status !== 202 || typeof id !== "string" || ["", "none", "null"].includes(id.trim().toLowerCase())) { | |
| throw new Error("INGESTION_CONTRACT_ERROR: expected HTTP 202 with a non-empty task_id"); | |
| } | |
| return id; | |
| } | |