建議大家升級一下openclaw網頁抓取邏輯升級: 在所有 HTTP 請求中統一添加 Accept: text/markdown, text/html header。 原理:Cloudflare 推出了 Markdown for Agents 功能,啟用了該功能的網站會在 AI agent 請求時直接返回 Markdown 格式內容,token 消耗比 HTML 減少約 80%。不支持的網站會正常返回 HTML,不受影響。 具體改動: 1. 找到 所有 Agent 中涉及網頁抓取的代碼(fetch、axios、request 等 HTTP 調用) 2. 在請求 header 中統一加上:Accept: text/markdown, text/html 3. 在響應處理中加一層判斷: - 如果 content-type 是 text/markdown → 直接使用,跳過 HTML 解析 - 如果 content-type 是 text/html → 走原有 HTML 解析邏輯 4. 如果響應中有 x-markdown-tokens header,記錄到日誌(方便未來做 token 預算估算) 改動後運行測試,找一個 Cloudflare 託管的網站驗證,確認能收到 Markdown 響應。

Cloudflare
@Cloudflare
Time to consider not just human visitors, but to treat agents as first-class citizens. Cloudflare’s network now supports real-time content conversion to Markdown at the source using content negotiation headers.
https://cfl.re/4ksZQ1S
來自推特
免責聲明:以上內容僅為作者觀點,不代表Followin的任何立場,不構成與Followin相關的任何投資建議。
喜歡
收藏
評論
分享





