产品多源确认

condense-json 1.0发布:用替换表压缩JSON重复文本

condense-json 1.0

精选理由

Simon Willison给他的condense-json发了1.0,能把JSON里重复的字符串换成短引用,省存储空间,配合LLM日志用正好。

condense-json 1.0正式发布,这是一个拥有1.

正文

5年历史的Python库。它通过replacements对象将JSON中重复出现的字符串替换为{$r:.

..

}语法,并可用uncondense_json()还原。开发者Simon Willison表示,该库用于压缩LLM生成的SQLite日志,相关实现见PR #1586。

此次1.0版本应用了合理且无破坏性的修复,属于稳定版发布。

原文 · Simon Willison’s Weblog

condense-json 1.0

Release: condense-json 1.0 I'm trying to get braver at releasing 1.0 versions. This little library is a year and a half old now - I've applied some sensible and non-disruptive fixes and shipped the big 1.0 for it. Here's an example of what it can do, lifted from the README: { "foo" : { "bar" : { "string" : " This is a string with foxes in it " , "nested" : { "more" : [ " Here is a string " , " another with foxes in it too " ] } } } } Combine that with a replacements object: { "1" : " with foxes in it " } And condense_json(input_json, replacements) produces the following: { "foo" : { "bar" : { "string" : { "$r" : [ " This is a string " , { "$" : " 1 " }]}, "nested" : { "more" : [ " Here is a string " , { "$r" : [ " another " , { "$" : " 1 " }, " too " ]}] } } } } It scans for strings or substrings that are present in that replacements object and replaces those with a special {"$r": ...} syntax in the output. You can reverse the effect with uncondense_json(condensed, replacements) . The idea is to make it easier to store JSON that includes duplicated data from other related structures. I use it to save space in the SQLite logs generated by LLM - see PR #1586 for the latest iteration of that. Tags: json , projects , python , llm

产业坐标与信源核验

本条情报归属 AITOP「产品」核心追踪栏目。涉及核心实体与技术议题包括:condense-json、Python、LLM、JSON压缩,读者可通过下方标签进入对应专题页查阅历史脉络与关联对比。

信源核验说明:本文原始线索采编自「Simon Willison’s Weblog」,经 AITOP 多维评分管线结构化提炼。截至目前,全网已有 4 家独立信源对该事件进行交叉印证与跟进报道(含 Viking、IT之家、Geek 等),属于近期高关注度行业信号。

发现摘要或翻译有误? 告诉我们