这几天被这个 TOON 格式刷屏了: 它是一种紧凑、可读性强的 JSON 表示格式,专为 LLM(大型语言模型)提示设计,作为 JSON 的无损替代品,Token 使用可以 减少 30-60%。 提供了 CLI 工具可以进行转化 JSON 是这样的: { "users": [ { "id": 1, "name": "Alice", "role": "admin" }, { "id": 2, "name": "Bob", "role": "user" } ] } 它折叠为 users[2]{id,name,role}: 1,Alice,admin 2,Bob,user 类似 CSV,但是添加了 YAML 类似的缩进等等。 有个很好的网站: 可以比较不同格式的 token 消耗,对比 JSON / YAML / TOON /CSV 最后获胜的是 CSV.... 当然只适合于简单数据,假如嵌套复杂数据 CSV 就有困难了
71.68K
213
The content on this page is provided by third parties. Unless otherwise stated, OKX is not the author of the cited article(s) and does not claim any copyright in the materials. The content is provided for informational purposes only and does not represent the views of OKX. It is not intended to be an endorsement of any kind and should not be considered investment advice or a solicitation to buy or sell digital assets. To the extent generative AI is utilized to provide summaries or other information, such AI generated content may be inaccurate or inconsistent. Please read the linked article for more details and information. OKX is not responsible for content hosted on third party sites. Digital asset holdings, including stablecoins and NFTs, involve a high degree of risk and can fluctuate greatly. You should carefully consider whether trading or holding digital assets is suitable for you in light of your financial condition.