{
  "slug": "hf-discussions-accepts-image-video-and-audio-attachments-9e5590cf9150",
  "title": "hf discussions accepts image, video, and audio attachments",
  "tools": [
    "hf"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-10-22T12:38:29.000Z",
  "announced_at": "2026-10-22T12:38:29.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When creating or updating a Hub discussion or pull request with media, upload each file with `--attach` and use its returned URL in the body; matching `![alt](./file)` references are replaced, and other files are appended. For Python, call `HfApi.upload_attachment(path)` and embed its returned URL.",
    "examples": [
      "hf discussions create <owner>/<repo> --title \"Fix rendering\" --pr --body \"Before: ![Before the fix](./before.png)\" --attach ./before.png --attach \"./after.png#After the fix\"",
      "from huggingface_hub import HfApi\napi = HfApi()\nurl = api.upload_attachment(\"<path-to-media-file>\")\napi.comment_discussion(\"<owner>/<repo>\", <discussion-number>, f\"![alt]({url})\")"
    ],
    "gotchas": [
      "Version: v2.3.0",
      "--attach FILE[#alt text]: Repeatable attachment file path; optional `#alt text` supplies image alt text.",
      "--pr: Create a pull request with `hf discussions create`.",
      "HfApi.upload_attachment(path): path (required): Local media file path; the method returns a URL for embedding.",
      "HfApi.comment_discussion(repo_id, discussion_num, comment) (required): Repository ID, discussion number, and comment body; the example embeds the returned attachment URL in the body.",
      "Prerequisite: Use `huggingface_hub` v2.3.0 or later for the documented change.",
      "`HfApi.upload_attachment(path)` uploads an image, video, or audio file.",
      "CLI attachment behavior applies to `hf discussions create` (including `--pr`), `comment`, and `edit."
    ]
  },
  "why_it_matters": "Attach media when creating or updating a Hub discussion or pull request with a description or comment.",
  "before": "The release note says this required calling an undocumented Hub endpoint by hand.",
  "sources": [
    "https://github.com/huggingface/huggingface_hub/releases/tag/v2.3.0"
  ],
  "rank": 0.99038,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "daily-20261026-04",
    "verdict_id": "daily-20261026-04:daily-20261026-04-7f4a3a12c406ef63-0:gate",
    "evidence_hash": "6dc90518a7acecf17ddfbc5a4497873b768b578cdadfe0e7c7933230b82d9011"
  },
  "review": {
    "draft_hash": "5c12f85093e5b7ad8a50dabdc6bcb642b8be66e25ba0614a268abae7cbd81264",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-22T12:38:29.000Z",
    "decision": "daily-20261026-04:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.99 >= 0.9; 2 needed) and Jev gave 0.80 (>= 0.6 needed)."
  }
}
