From ea5ccf5d40d5f96d76f3002728d8ca889b5d3e4c Mon Sep 17 00:00:00 2001 From: SerenNoble Date: Sun, 21 Jun 2026 18:40:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20aipet=20=E8=AE=B0=E5=BF=86=E8=AE=BE?= =?UTF-8?q?=E4=B8=BA=E9=BB=98=E8=AE=A4=EF=BC=88changelog=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=B3=A8=E5=86=8C=EF=BC=8C=E6=8D=A2=E6=9C=BA=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E7=94=9F=E6=95=88=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增 202606211000.sql:往 ai_model_config 插入 Memory_aipet 实例 (type=aipet, db_path=./data/xiaozhi_memory.db, retrieval_mode=fts5) 并设为默认记忆,其余 Memory 配置置为非默认。 aipet provider 运行时自动加载 xiaozhi-memory 框架(FTS5 检索)。 Liquibase 随 web 镜像启动自动执行,新部署无需手动配置记忆。 Co-Authored-By: Claude --- .../main/resources/db/changelog/202606211000.sql | 16 ++++++++++++++++ .../db/changelog/db.changelog-master.yaml | 7 +++++++ 2 files changed, 23 insertions(+) create mode 100644 main/manager-api/src/main/resources/db/changelog/202606211000.sql diff --git a/main/manager-api/src/main/resources/db/changelog/202606211000.sql b/main/manager-api/src/main/resources/db/changelog/202606211000.sql new file mode 100644 index 000000000..c510804ea --- /dev/null +++ b/main/manager-api/src/main/resources/db/changelog/202606211000.sql @@ -0,0 +1,16 @@ +-- 注册 aipet 记忆实例并设为默认(FTS5 本地记忆,运行时由 core/providers/memory/aipet 自动加载 xiaozhi-memory 框架) +-- 先把其他 Memory 配置置为非默认 +UPDATE `ai_model_config` SET `is_default` = 0 WHERE `model_type` = 'Memory'; + +-- 插入 aipet 实例(config_json 字段对齐 aipet.py:db_path / retrieval_mode) +INSERT INTO `ai_model_config` + (`id`, `model_type`, `model_code`, `model_name`, `is_default`, `is_enabled`, `config_json`, `sort`, `creator`, `create_date`, `updater`, `update_date`) +VALUES ( + 'Memory_aipet', 'Memory', 'aipet', 'AIPet本地记忆(FTS5)', 1, 1, + JSON_OBJECT('type', 'aipet', 'db_path', './data/xiaozhi_memory.db', 'retrieval_mode', 'fts5'), + 10, 1, NOW(), 1, NOW() +) +ON DUPLICATE KEY UPDATE + `is_default` = VALUES(`is_default`), + `is_enabled` = VALUES(`is_enabled`), + `config_json` = VALUES(`config_json`); diff --git a/main/manager-api/src/main/resources/db/changelog/db.changelog-master.yaml b/main/manager-api/src/main/resources/db/changelog/db.changelog-master.yaml index 61622e18e..62cad54fb 100755 --- a/main/manager-api/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/main/manager-api/src/main/resources/db/changelog/db.changelog-master.yaml @@ -655,3 +655,10 @@ databaseChangeLog: - sqlFile: encoding: utf8 path: classpath:db/changelog/202606191200.sql + - changeSet: + id: 202606211000 + author: aipet + changes: + - sqlFile: + encoding: utf8 + path: classpath:db/changelog/202606211000.sql