LLM 0.37.3 修复 SQLite 3.54.1 兼容问题
原标题:llm 0.37.3
38AI 研判分
Simon Willison 的 LLM 命令行工具发布 0.37.3 版本,主要修复 Homebrew 最新打包的 SQLite 3.54.1 导致日志代码报错的问题。根因是 SQLite 修正了子查询返回 JSON 文本而非 JSON 值的行为,官方通过外层包裹 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))))