Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

所有重要更改都将记录在此文件中。

## [3.4.2] - 2026-06-18

### 集成

- 新增 SillyTavern 世界书预览、导入与导入历史接口,可将世界书条目写入现有学习审查、黑话和知识图谱数据。
- WebUI 世界书导入不再接受请求传入的服务端路径,避免通过 `json_path`/`worldbook_path` 读取任意本地文件。
- 世界书导入器支持顶层数组格式 payload,并补充对应回归测试。

### 版本

- 将插件发布版本号提升至 `3.4.2`。

## [3.4.0] - 2026-06-14

### 自学习中枢
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

让 AstrBot 在群聊中持续采集、学习、审查并注入上下文,使 Bot 逐步具备表达风格、群组黑话、社交关系、长期记忆和人格演化能力。

[![Version](https://img.shields.io/badge/version-3.4.1-blue.svg)](https://github.com/NickCharlie/astrbot_plugin_self_learning)
[![Version](https://img.shields.io/badge/version-3.4.2-blue.svg)](https://github.com/NickCharlie/astrbot_plugin_self_learning)
[![License](https://img.shields.io/badge/license-AGPL--3.0-green.svg)](LICENSE)
[![AstrBot](https://img.shields.io/badge/AstrBot-%3E%3D4.11.4-orange.svg)](https://github.com/Soulter/AstrBot)
[![Python](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/)
Expand Down
2 changes: 1 addition & 1 deletion README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<br>

[![Version](https://img.shields.io/badge/version-3.4.1-blue.svg)](https://github.com/NickCharlie/astrbot_plugin_self_learning) [![License](https://img.shields.io/badge/license-AGPL--3.0-green.svg)](LICENSE) [![AstrBot](https://img.shields.io/badge/AstrBot-%3E%3D4.11.4-orange.svg)](https://github.com/Soulter/AstrBot) [![Python](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/)
[![Version](https://img.shields.io/badge/version-3.4.2-blue.svg)](https://github.com/NickCharlie/astrbot_plugin_self_learning) [![License](https://img.shields.io/badge/license-AGPL--3.0-green.svg)](LICENSE) [![AstrBot](https://img.shields.io/badge/AstrBot-%3E%3D4.11.4-orange.svg)](https://github.com/Soulter/AstrBot) [![Python](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/)

[Features](#what-we-can-do) · [Quick Start](#quick-start) · [Web UI](#visual-management-interface) · [Community](#community) · [Contributing](CONTRIBUTING.md)

Expand Down
32 changes: 32 additions & 0 deletions docs/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ GET /api/hub/v1/status
### Self Learning

- `GET /api/integrations/status`
- `POST /api/integrations/worldbook/preview`
- `POST /api/integrations/worldbook/import`
- `GET /api/integrations/worldbook/imports`
- `GET /api/hub/v1/manifest`
- `GET /api/hub/v1/status`
- `POST /api/hub/v1/context`
Expand All @@ -198,6 +201,35 @@ GET /api/hub/v1/status
- `GET /api/jargon/list`
- `GET /api/style_learning/content_text`

## SillyTavern 世界书导入

Self Learning 支持导入 SillyTavern 世界书 JSON。导入器接受标准格式:

```json
{
"name": "世界书名称",
"entries": {
"0": {
"key": ["关键词"],
"secondaryKeys": ["辅助关键词"],
"content": "设定正文",
"constant": false,
"order": 100,
"insertion_order": 0
}
}
}
```

`entries` 也可以是数组。当前导入路径复用现有表:

- `content` 写入 `persona_update_reviews`,作为 `worldbook_entry` 待审记忆。
- `key` 和 `secondaryKeys` 写入 `jargon` 候选池。
- 世界书条目、关键词及触发关系写入 `kg_entities` 和 `kg_relations`。

导入历史通过 `GET /api/integrations/worldbook/imports` 从审查记录
metadata 聚合,不需要额外迁移表。

### LivingMemory

Self Learning 不再调用 LivingMemory 的 Page 图谱 API。Dashboard 的
Expand Down
48 changes: 48 additions & 0 deletions docs/webui-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ $env:ASTRBOT_ENABLE_WEB_DEP_INSTALL="false"
| 方法 | 路径 | 说明 |
| --- | --- | --- |
| GET | `/api/integrations/status` | 获取 Self Learning、LivingMemory、Group Chat Plus 的委托状态、面板入口和开发 API 列表 |
| POST | `/api/integrations/worldbook/preview` | 预览 SillyTavern 世界书 JSON,可传 `payload`、`json_text` 或 `json_path` |
| POST | `/api/integrations/worldbook/import` | 导入 SillyTavern 世界书到人格待审记忆、黑话候选和知识图谱 |
| GET | `/api/integrations/worldbook/imports` | 从人格审查元数据读取最近世界书导入历史 |

返回字段:

Expand All @@ -93,6 +96,51 @@ $env:ASTRBOT_ENABLE_WEB_DEP_INSTALL="false"

详见 [功能融合](integrations.md)。

### SillyTavern 世界书导入

预览:

```http
POST /api/integrations/worldbook/preview
```

```json
{
"payload": {
"name": "世界书名称",
"entries": {
"0": {
"key": ["关键词"],
"secondaryKeys": ["辅助关键词"],
"content": "设定正文",
"constant": false,
"order": 100,
"insertion_order": 0
}
}
}
}
```

导入:

```json
{
"payload": {},
"default_group_id": "global",
"import_memories": true,
"import_jargons": true,
"import_knowledge_graph": true,
"include_disabled": false
}
```

导入器兼容 `entries` 为对象或数组。`content` 会进入
`persona_update_reviews` 待审队列;`key` 和 `secondaryKeys`
会进入 `jargon` 候选;知识图谱会写入世界书条目节点、关键词节点和
`触发关键词` 关系。导入历史不新增表,来自 `worldbook_entry`
人格审查记录的 metadata。

## Self Learning Hub API

蓝图: `webui/blueprints/hub.py`
Expand Down
2 changes: 1 addition & 1 deletion metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "astrbot_plugin_self_learning"
author: "NickMo, EterUltimate"
display_name: "self-learning"
description: "SELF LEARNING 自主学习插件 — 让 AI 聊天机器人自主学习对话风格、理解群组黑话、管理社交关系与好感度、自适应人格演化,像真人一样自然对话。(使用前必须手动备份人格数据)"
version: "3.4.1"
version: "3.4.2"
repo: "https://github.com/NickCharlie/astrbot_plugin_self_learning"
tags:
- "自学习"
Expand Down
1 change: 1 addition & 0 deletions services/integration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"MaiBotQualityMonitor": ".maibot_adapters",
"MaiBotEnhancedLearningManager": ".maibot_enhanced_learning_manager",
"MaiBotLearningImporter": ".maibot_learning_importer",
"WorldBookImporter": ".worldbook_importer",
"ExemplarLibrary": ".exemplar_library",
"KnowledgeGraphManager": ".knowledge_graph_manager",
"LightRAGKnowledgeManager": ".lightrag_knowledge_manager",
Expand Down
Loading
Loading