{"record":{"id":"cac3b94c2999302f","repo":"headroomlabs-ai/headroom","slug":"failed-to-download-bfcl-dataset-data-file-e","errorCode":null,"errorMessage":"Failed to download BFCL dataset '{data_file}': {e}","messagePattern":"Failed to download BFCL dataset '(.+?)': (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"headroom/evals/datasets.py","lineNumber":601,"sourceCode":"    Args:\n        n: Number of samples to load\n        category: BFCL category\n\n    Returns:\n        EvalSuite with BFCL cases\n    \"\"\"\n    import urllib.request\n\n    base_url = \"https://huggingface.co/datasets/gorilla-llm/Berkeley-Function-Calling-Leaderboard/resolve/main\"\n    data_file = f\"BFCL_v3_{category}.json\"\n    gt_file = f\"possible_answer/BFCL_v3_{category}.json\"\n\n    # Download questions + function schemas (JSONL)\n    try:\n        raw = urllib.request.urlopen(f\"{base_url}/{data_file}\").read().decode(\"utf-8\")  # nosec B310\n        items = [json.loads(line) for line in raw.strip().split(\"\\n\") if line.strip()]\n    except Exception as e:\n        raise ValueError(f\"Failed to download BFCL dataset '{data_file}': {e}\") from e\n\n    # Download ground truth (JSONL, keyed by id)\n    gt_by_id: dict[str, str] = {}\n    try:\n        gt_raw = urllib.request.urlopen(f\"{base_url}/{gt_file}\").read().decode(\"utf-8\")  # nosec B310\n        for line in gt_raw.strip().split(\"\\n\"):\n            if line.strip():\n                obj = json.loads(line)\n                gt_by_id[obj[\"id\"]] = json.dumps(obj.get(\"ground_truth\", []))\n    except Exception:\n        pass  # Ground truth is optional\n\n    cases: list[EvalCase] = []\n    for i, item in enumerate(items):\n        if i >= n:\n            break\n\n        item_id = item.get(\"id\", f\"bfcl_{category}_{i}\")","sourceCodeStart":583,"sourceCodeEnd":619,"githubUrl":"https://github.com/headroomlabs-ai/headroom/blob/322425c43bffde1ed0b64fecf3cf5951565dd82b/headroom/evals/datasets.py#L583-L619","documentation":"Error \"Failed to download BFCL dataset '{data_file}': {e}\" thrown in headroomlabs-ai/headroom.","triggerScenarios":"Raised when downloading a BFCL (Berkeley Function Calling Leaderboard) dataset file fails, typically a network error, moved URL, or blocked request.","commonSituations":"See trigger scenarios.","solutions":["Check network connectivity and retry the BFCL dataset download","Verify the BFCL data file URL/path '{data_file}' is correct and still published","If the download is blocked, download the file manually and place it in the expected cache directory","Inspect the underlying exception {e} for HTTP status details (403/404 indicate a moved or gated file)"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"322425c43bffde1ed0b64fecf3cf5951565dd82b","analyzedAt":"2026-08-15T01:03:05.481Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}