Simon Willison·· 15 天前AI 评分29
LLM 0.37.3 发布,修复 Homebrew 新版 SQLite 导致的日志问题
llm 0.37.3
AI 导读
LLM 发布 0.37.3 修复版本,主要解决 Homebrew 最新 SQLite 3.54.1 导致的日志代码故障。SQLite 3.54.1 修正了 json_object 嵌套子查询返回 SQL 文本而非 JSON 的行为,使 LLM 原有查询结果从 {"a":[1]} 变为 {"a":"[1]"}。规避方式是在子查询外再包一层 json()。
正文
A bug fix release for LLM, mainly to cover a problem with the most recent Homebrew package of the software.
Homebrew now ships the latest SQLite, 3.54.1, which includes a fix that broke LLM's logging code.
Short version: in SQLite 3.54.0 the following SQL:
select json_object('a', (select json_array(1)))
Returns this:
{"a":[1]}
But in 3.54.1 the same query returns this:
{"a":"[1]"}
According to D. Richard Hipp:
That was a bug fix. Per the documentation, (SELECT json_array(...)) returns SQL text, not JSON. Hence the 3.54.1 behavior is correct and 3.54.0 was a bug.
The workaround looks like this:
select json_object('a', json((select json_array(1))))
来源:Simon Willison · simonwillison.net