跳到正文
Simon Willison·· 22 小时前AI 评分12

LLM 0.37.3 发布,修复 SQLite 3.54.1 导致的日志代码问题

llm 0.37.3

AI 导读

LLM 发布 0.37.3 版本,主要修复最新 Homebrew 包中 SQLite 3.54.1 破坏其日志代码的问题。SQLite 3.54.1 修正了 3.54.0 中 `json_object` 嵌套 `json_array` 子查询返回 JSON 而非 SQL 文本的 bug,导致 LLM 日志异常。规避方式是在子查询外再套一层 `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