From 9b6abe1b737b7a3903c958b79c9191ff170cf2dc Mon Sep 17 00:00:00 2001 From: JianFeeeee Date: Thu, 24 Sep 2026 13:00:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(docs):=20=E4=B8=AD=E6=96=87=E6=90=9C?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E8=8B=B1=E6=96=87=E6=B3=A8=E9=87=8A=E7=9A=84?= =?UTF-8?q?=20API=20=E2=80=94=E2=80=94=20=E8=A1=A5=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E8=AF=8D=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 问题(实测) SDK 里 100 个有摘要的符号中 **66 个是英文注释**,例如: RegisterTool registers a tool that the LLM can call. 于是搜「注册工具」——中文受众最自然的问法——**RegisterTool 得分 0,一条都搜不到**。 更糟的是逐字匹配把噪声顶上来了:搜「注册工具」返回 24 条,排第一的是 `SetToolBlocks`(描述里有「工具」二字),`RegisterTool` 根本不在列表里。 ## 修法 不改源码注释(那会让代码与文档脱节),而是在检索索引上加一层**人工标注的 中文功能词**:`tools/apidoc/keywords.json`。 - `rules`:按符号名前缀/子串批量覆盖(`Register*` 全带「注册」,`*Memory*` 带「记忆」) - `symbols`:逐符号补充(重点 API、或规则覆盖不到的) 词只进 `api-index.json` 的 `g` 字段,**不影响页面展示**;检索结果里会显示 (「为何命中」),读者能理解排序依据。 同时把中文逐字匹配从主信号降为**弱信号**(要求 60% 以上字符命中)—— 它正是噪声来源:凡是含「工具」二字的说明都会被「注册工具」匹上。 ## 结果 | 查询 | 修改前 | 修改后 | |---|---|---| | 注册工具 | 24 条,RegisterTool 缺席 | **7 条,RegisterTool 第一** | | 崩溃 | 1 条 | 2 条(SetAutoRestart + AutoRestart)| | InjectText | 7 条(含重复)| 6 条 | | memory.recall | 1 条 | 1 条(不变)| 顺带修掉索引重复:接口会同时作为 `type` 符号与接口本身被加两次 (`MemoryAPI` 等 11 个各重复一条)。现在接口只走接口那条路径,索引 200 → 189 条。 keywords.json 是**可选**的:读不到只警告不中断,检索退化为原行为。 --- docs/api/channels.md | 12 - docs/api/events.md | 12 - docs/api/lifecycle.md | 21 - docs/api/llm.md | 10 - docs/api/memory.md | 71 +- docs/api/settings.md | 8 - docs/assets/api-index.json | 1376 ++++++++++++++++++++++-------- docs/javascripts/api-search.js | 25 +- docs/stylesheets/extra.css | 8 + tools/apidoc/gensite/keywords.go | 94 ++ tools/apidoc/gensite/main.go | 58 +- tools/apidoc/keywords.json | 159 ++++ 12 files changed, 1368 insertions(+), 486 deletions(-) create mode 100644 tools/apidoc/gensite/keywords.go create mode 100644 tools/apidoc/keywords.json diff --git a/docs/api/channels.md b/docs/api/channels.md index 878ee53..ea308df 100644 --- a/docs/api/channels.md +++ b/docs/api/channels.md @@ -268,18 +268,6 @@ const ContextPolicyPrune `plugin.go:45` -### `IOInjector` - -```go -type IOInjector interface { InjectInterruptText(source, channel, text string) InjectText(source, channel, text string) InjectTextNoMemory(source, channel, text string) // I … -``` - -IOInjector provides methods for injecting input and interrupts into the agent pipeline. -All methods accept (source, channel) where channel is the target output channel -for routing the agent's response. - -`plugin.go:220` - ### `PluginSDK.InjectInputMedia` ```go diff --git a/docs/api/events.md b/docs/api/events.md index 462b669..8dead3c 100644 --- a/docs/api/events.md +++ b/docs/api/events.md @@ -44,18 +44,6 @@ EventHandler processes a system event. `plugin.go:273` -### `EventSubscriber` - -```go -type EventSubscriber interface { Subscribe(eventType EventType, handler EventHandler) func() } -``` - -EventSubscriber allows plugins to subscribe to kernel events. -This is a restricted interface: plugins can subscribe but the kernel -controls which events are delivered. - -`plugin.go:278` - ### `EventType` ```go diff --git a/docs/api/lifecycle.md b/docs/api/lifecycle.md index 30530f6..310d945 100644 --- a/docs/api/lifecycle.md +++ b/docs/api/lifecycle.md @@ -89,16 +89,6 @@ AutoRestart 返回插件是否允许自动重启。 `plugin.go:791` -### `Plugin` - -```go -type Plugin interface { Name() string Start(sdk *PluginSDK) error Stop() error } -``` - -Plugin is the interface every plugin must implement. - -`plugin.go:13` - ### `PluginSDK.PluginMgr` ```go @@ -110,17 +100,6 @@ May be nil if the host did not wire it. `plugin.go:653` -### `PluginMgrAPI` - -```go -type PluginMgrAPI interface { // ReloadOne 重载单个插件(停止后重新加载)。 ReloadOne(name string) error // ListLoadedPlugins 列出已加载插件。 ListLoa … -``` - -PluginMgrAPI 提供插件管理能力(外部插件可调用)。 -由 bridge 注入 dispatch 实现,走 C ABI CORE_PLUGIN_RELOAD_ONE 等。 - -`plugin.go:284` - ### `PluginSDK.PluginName` ```go diff --git a/docs/api/llm.md b/docs/api/llm.md index ac91d83..b1f29a2 100644 --- a/docs/api/llm.md +++ b/docs/api/llm.md @@ -48,13 +48,3 @@ LLM returns the LLM provider API (may be nil if not available). `plugin.go:432` -### `LLMAPI` - -```go -type LLMAPI interface { ListSources() []string SetSource(name string) error CurrentSource() string } -``` - -LLMAPI provides access to the LLM provider manager. - -`llm.go:4` - diff --git a/docs/api/memory.md b/docs/api/memory.md index ca351c9..5b0f8fd 100644 --- a/docs/api/memory.md +++ b/docs/api/memory.md @@ -238,16 +238,6 @@ DocMemory returns the document memory API (may be nil if not available). `plugin.go:418` -### `DocMemoryAPI` - -```go -type DocMemoryAPI interface { Query(text string, topK int) []*Doc Insert(doc *Doc) error // InsertWithMedia 写入文档并关联媒体。attachments 里带 Data 的会落进 … -``` - -DocMemoryAPI provides access to the document vector store. - -`memory.go:74` - ### `Entity` ```go @@ -258,22 +248,6 @@ Entity represents a named entity in the knowledge graph. `memory.go:13` -### `PluginSDK.Knowledge` - -```go -func (s *PluginSDK) Knowledge() KnowledgeAPI -``` - -Knowledge returns the knowledge store API (may be nil if not available). - -**示例插件里的真实用法** - -| 插件 | 位置 | 代码 | -|---|---|---| -| [`recoverydiag`](../examples/index.md#recoverydiag) | `example/recoverydiag/plugin.go:978` | `if p.sdk != nil && p.sdk.Knowledge() != nil {` | - -`plugin.go:425` - ### `Knowledge` ```go @@ -290,15 +264,21 @@ Knowledge represents a knowledge entry. `knowledge.go:11` -### `KnowledgeAPI` +### `PluginSDK.Knowledge` ```go -type KnowledgeAPI interface { Search(query string, topK int) ([]*Knowledge, error) Add(name, content string) error List() ([]string, error) } +func (s *PluginSDK) Knowledge() KnowledgeAPI ``` -KnowledgeAPI provides access to the knowledge store. +Knowledge returns the knowledge store API (may be nil if not available). -`knowledge.go:4` +**示例插件里的真实用法** + +| 插件 | 位置 | 代码 | +|---|---|---| +| [`recoverydiag`](../examples/index.md#recoverydiag) | `example/recoverydiag/plugin.go:978` | `if p.sdk != nil && p.sdk.Knowledge() != nil {` | + +`plugin.go:425` ### `MediaAttachment` @@ -330,16 +310,6 @@ Memory returns the graph memory API (may be nil if not available). `plugin.go:404` -### `MemoryAPI` - -```go -type MemoryAPI interface { Recall(query []string, depth int) ([]Entity, []Relation, error) Commit(triples []Triple) error Introspect() (map[string]interface{}, error) Merg … -``` - -MemoryAPI provides access to the graph memory (entity-relation store). - -`memory.go:4` - ### `PersonProfile` ```go @@ -370,17 +340,6 @@ Social returns the social graph API (may be nil if not available). `plugin.go:439` -### `SocialAPI` - -```go -type SocialAPI interface { GetPerson(name string) (*PersonProfile, error) GetTrait(name, trait string) (string, bool) GetRelations(name string) ([]SocialRelation, error) G … -``` - -SocialAPI provides read-only access to the social graph (person profiles and relationships). -External plugins can query person traits and social networks but cannot modify them. - -`memory.go:100` - ### `SocialRelation` ```go @@ -409,16 +368,6 @@ TextMemory returns the text memory API (may be nil if not available). `plugin.go:411` -### `TextMemoryAPI` - -```go -type TextMemoryAPI interface { Append(evt TextEvent) error } -``` - -TextMemoryAPI provides access to chronological text event storage. - -`memory.go:43` - ### `Triple` ```go diff --git a/docs/api/settings.md b/docs/api/settings.md index b3c031d..0364f05 100644 --- a/docs/api/settings.md +++ b/docs/api/settings.md @@ -195,11 +195,3 @@ sett 在 New 时一次性写入且无 setter,故不需要加锁。 `plugin.go:401` -### `SettingsAPI` - -```go -type SettingsAPI interface { // Get reads the plugin's own config value (config_ table). Get(key string) (interface{}, error) // Set writes a config value to the plugi … -``` - -`settings.go:3` - diff --git a/docs/assets/api-index.json b/docs/assets/api-index.json index 70f2232..bc060eb 100644 --- a/docs/assets/api-index.json +++ b/docs/assets/api-index.json @@ -19,7 +19,10 @@ "p": "memory", "b": false, "f": "knowledge.go", - "l": 6 + "l": 6, + "g": [ + "添加知识" + ] }, { "n": "Append", @@ -30,7 +33,10 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 44 + "l": 44, + "g": [ + "追加文本" + ] }, { "n": "AudioURL", @@ -52,7 +58,13 @@ "p": "lifecycle", "b": false, "f": "plugin.go", - "l": 791 + "l": 791, + "g": [ + "自动重启", + "崩溃自愈", + "故障恢复", + "查询是否自动重启" + ] }, { "n": "CapAudio", @@ -63,7 +75,10 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 331 + "l": 331, + "g": [ + "音频能力" + ] }, { "n": "CapFile", @@ -74,7 +89,10 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 329 + "l": 329, + "g": [ + "文件能力" + ] }, { "n": "CapImage", @@ -85,7 +103,10 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 330 + "l": 330, + "g": [ + "图片能力" + ] }, { "n": "CapStructured", @@ -96,7 +117,10 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 332 + "l": 332, + "g": [ + "结构化能力" + ] }, { "n": "CapText", @@ -107,7 +131,10 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 328 + "l": 328, + "g": [ + "文本能力" + ] }, { "n": "ChannelDef", @@ -118,7 +145,12 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 139 + "l": 139, + "g": [ + "通道", + "频道", + "通道定义" + ] }, { "n": "Commit", @@ -129,7 +161,11 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 6 + "l": 6, + "g": [ + "写入记忆", + "提交三元组" + ] }, { "n": "ConfigDef", @@ -140,7 +176,10 @@ "p": "settings", "b": false, "f": "settings.go", - "l": 50 + "l": 50, + "g": [ + "配置项定义" + ] }, { "n": "ContentBlock", @@ -151,7 +190,12 @@ "p": "tools", "b": false, "f": "plugin.go", - "l": 850 + "l": 850, + "g": [ + "多模态内容块", + "图片块", + "音频块" + ] }, { "n": "ContextPolicyNone", @@ -162,7 +206,12 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 44 + "l": 44, + "g": [ + "策略", + "不裁剪上下文", + "默认裁剪策略" + ] }, { "n": "ContextPolicyPrune", @@ -173,7 +222,12 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 45 + "l": 45, + "g": [ + "策略", + "裁剪上下文", + "归档丢弃" + ] }, { "n": "CurrentSource", @@ -184,7 +238,10 @@ "p": "llm", "b": false, "f": "llm.go", - "l": 7 + "l": 7, + "g": [ + "当前模型来源" + ] }, { "n": "DataDir", @@ -195,7 +252,10 @@ "p": "settings", "b": false, "f": "settings.go", - "l": 25 + "l": 25, + "g": [ + "数据目录" + ] }, { "n": "Defs", @@ -206,7 +266,10 @@ "p": "settings", "b": false, "f": "settings.go", - "l": 40 + "l": 40, + "g": [ + "配置定义列表" + ] }, { "n": "Doc", @@ -217,7 +280,11 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 89 + "l": 89, + "g": [ + "文档", + "文档对象" + ] }, { "n": "DocMemory", @@ -228,7 +295,12 @@ "p": "memory", "b": false, "f": "plugin.go", - "l": 418 + "l": 418, + "g": [ + "记忆", + "内存", + "文档" + ] }, { "n": "DocMemoryAPI", @@ -241,17 +313,6 @@ "f": "", "l": 0 }, - { - "n": "DocMemoryAPI", - "s": "type DocMemoryAPI interface { Query(text string, topK int) []*Doc Insert(doc *Doc) error // InsertWithMedia 写入文档并关联媒体。attachments 里带 Data 的会落进 …", - "d": "DocMemoryAPI provides access to the document vector store.", - "k": "type", - "r": "", - "p": "memory", - "b": false, - "f": "memory.go", - "l": 74 - }, { "n": "Dump", "s": "Dump() map[string]interface{}", @@ -261,7 +322,10 @@ "p": "settings", "b": false, "f": "settings.go", - "l": 43 + "l": 43, + "g": [ + "导出配置" + ] }, { "n": "Entity", @@ -272,7 +336,11 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 13 + "l": 13, + "g": [ + "实体", + "记忆主体" + ] }, { "n": "Event", @@ -283,7 +351,11 @@ "p": "events", "b": false, "f": "plugin.go", - "l": 265 + "l": 265, + "g": [ + "事件", + "订阅" + ] }, { "n": "EventAgentLLMChain", @@ -294,7 +366,11 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 252 + "l": 252, + "g": [ + "事件", + "订阅" + ] }, { "n": "EventAgentOutput", @@ -305,7 +381,11 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 251 + "l": 251, + "g": [ + "事件", + "订阅" + ] }, { "n": "EventContentDelta", @@ -316,7 +396,11 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 261 + "l": 261, + "g": [ + "事件", + "订阅" + ] }, { "n": "EventHandler", @@ -327,7 +411,11 @@ "p": "events", "b": false, "f": "plugin.go", - "l": 273 + "l": 273, + "g": [ + "事件", + "订阅" + ] }, { "n": "EventRawInput", @@ -338,7 +426,11 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 250 + "l": 250, + "g": [ + "事件", + "订阅" + ] }, { "n": "EventReasoning", @@ -349,7 +441,11 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 254 + "l": 254, + "g": [ + "事件", + "订阅" + ] }, { "n": "EventReasoningDelta", @@ -360,7 +456,11 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 260 + "l": 260, + "g": [ + "事件", + "订阅" + ] }, { "n": "EventStage", @@ -371,18 +471,13 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 255 - }, - { - "n": "EventSubscriber", - "s": "type EventSubscriber interface { Subscribe(eventType EventType, handler EventHandler) func() }", - "d": "EventSubscriber allows plugins to subscribe to kernel events.", - "k": "type", - "r": "", - "p": "events", - "b": false, - "f": "plugin.go", - "l": 278 + "l": 255, + "g": [ + "事件", + "订阅", + "阶段", + "钩子" + ] }, { "n": "EventSubscriber", @@ -404,7 +499,11 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 256 + "l": 256, + "g": [ + "事件", + "订阅" + ] }, { "n": "EventToolCall", @@ -415,7 +514,12 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 253 + "l": 253, + "g": [ + "事件", + "订阅", + "工具" + ] }, { "n": "EventType", @@ -426,7 +530,11 @@ "p": "events", "b": false, "f": "plugin.go", - "l": 247 + "l": 247, + "g": [ + "事件", + "订阅" + ] }, { "n": "Events", @@ -437,7 +545,13 @@ "p": "events", "b": true, "f": "plugin.go", - "l": 446 + "l": 446, + "g": [ + "事件", + "订阅", + "事件订阅", + "监听事件" + ] }, { "n": "Get", @@ -448,7 +562,10 @@ "p": "settings", "b": false, "f": "settings.go", - "l": 5 + "l": 5, + "g": [ + "读取配置" + ] }, { "n": "GetCore", @@ -459,7 +576,10 @@ "p": "settings", "b": false, "f": "settings.go", - "l": 14 + "l": 14, + "g": [ + "读核心配置" + ] }, { "n": "GetNetwork", @@ -470,7 +590,10 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 104 + "l": 104, + "g": [ + "查关系网" + ] }, { "n": "GetPerson", @@ -481,7 +604,10 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 101 + "l": 101, + "g": [ + "查人物" + ] }, { "n": "GetPlugin", @@ -492,7 +618,10 @@ "p": "settings", "b": false, "f": "settings.go", - "l": 28 + "l": 28, + "g": [ + "读插件配置" + ] }, { "n": "GetRelations", @@ -503,7 +632,10 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 103 + "l": 103, + "g": [ + "查关系" + ] }, { "n": "GetTrait", @@ -514,18 +646,10 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 102 - }, - { - "n": "IOInjector", - "s": "type IOInjector interface { InjectInterruptText(source, channel, text string) InjectText(source, channel, text string) InjectTextNoMemory(source, channel, text string) // I …", - "d": "IOInjector provides methods for injecting input and interrupts into the agent pipeline.", - "k": "type", - "r": "", - "p": "channels", - "b": false, - "f": "plugin.go", - "l": 220 + "l": 102, + "g": [ + "查特征" + ] }, { "n": "IOInjector", @@ -558,7 +682,15 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 701 + "l": 701, + "g": [ + "注入输入", + "投喂输入", + "模拟用户输入", + "媒体", + "图片", + "音频" + ] }, { "n": "InjectInputMedia", @@ -569,7 +701,15 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 230 + "l": 230, + "g": [ + "注入输入", + "投喂输入", + "模拟用户输入", + "媒体", + "图片", + "音频" + ] }, { "n": "InjectInputMediaOpts", @@ -580,7 +720,15 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 740 + "l": 740, + "g": [ + "注入输入", + "投喂输入", + "模拟用户输入", + "媒体", + "图片", + "音频" + ] }, { "n": "InjectInputMediaOpts", @@ -591,7 +739,15 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 241 + "l": 241, + "g": [ + "注入输入", + "投喂输入", + "模拟用户输入", + "媒体", + "图片", + "音频" + ] }, { "n": "InjectInputMediaSync", @@ -602,7 +758,15 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 231 + "l": 231, + "g": [ + "注入输入", + "投喂输入", + "模拟用户输入", + "媒体", + "图片", + "音频" + ] }, { "n": "InjectInputMediaSync", @@ -613,18 +777,15 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 707 - }, - { - "n": "InjectInputMediaSyncOpts", - "s": "InjectInputMediaSyncOpts(source, channel, text string, blocks []ContentBlock, opts InjectOptions) string", - "d": "", - "k": "method", - "r": "IOInjector", - "p": "channels", - "b": false, - "f": "plugin.go", - "l": 242 + "l": 707, + "g": [ + "注入输入", + "投喂输入", + "模拟用户输入", + "媒体", + "图片", + "音频" + ] }, { "n": "InjectInputMediaSyncOpts", @@ -635,7 +796,34 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 747 + "l": 747, + "g": [ + "注入输入", + "投喂输入", + "模拟用户输入", + "媒体", + "图片", + "音频" + ] + }, + { + "n": "InjectInputMediaSyncOpts", + "s": "InjectInputMediaSyncOpts(source, channel, text string, blocks []ContentBlock, opts InjectOptions) string", + "d": "", + "k": "method", + "r": "IOInjector", + "p": "channels", + "b": false, + "f": "plugin.go", + "l": 242, + "g": [ + "注入输入", + "投喂输入", + "模拟用户输入", + "媒体", + "图片", + "音频" + ] }, { "n": "InjectInputSync", @@ -646,7 +834,12 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 226 + "l": 226, + "g": [ + "注入输入", + "投喂输入", + "模拟用户输入" + ] }, { "n": "InjectInputSync", @@ -657,7 +850,12 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 692 + "l": 692, + "g": [ + "注入输入", + "投喂输入", + "模拟用户输入" + ] }, { "n": "InjectInputSyncOpts", @@ -668,7 +866,12 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 240 + "l": 240, + "g": [ + "注入输入", + "投喂输入", + "模拟用户输入" + ] }, { "n": "InjectInputSyncOpts", @@ -679,18 +882,12 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 731 - }, - { - "n": "InjectInterruptMedia", - "s": "func (s *PluginSDK) InjectInterruptMedia(source, channel, text string, blocks []ContentBlock)", - "d": "InjectInterruptMedia 注入带媒体内容块的中断,可抢占当前 LLM 处理。", - "k": "method", - "r": "PluginSDK", - "p": "channels", - "b": false, - "f": "plugin.go", - "l": 764 + "l": 731, + "g": [ + "注入输入", + "投喂输入", + "模拟用户输入" + ] }, { "n": "InjectInterruptMedia", @@ -701,7 +898,36 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 232 + "l": 232, + "g": [ + "中断注入", + "插话", + "打断", + "抢占", + "媒体", + "图片", + "音频" + ] + }, + { + "n": "InjectInterruptMedia", + "s": "func (s *PluginSDK) InjectInterruptMedia(source, channel, text string, blocks []ContentBlock)", + "d": "InjectInterruptMedia 注入带媒体内容块的中断,可抢占当前 LLM 处理。", + "k": "method", + "r": "PluginSDK", + "p": "channels", + "b": false, + "f": "plugin.go", + "l": 764, + "g": [ + "中断注入", + "插话", + "打断", + "抢占", + "媒体", + "图片", + "音频" + ] }, { "n": "InjectInterruptMediaOpts", @@ -712,7 +938,16 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 756 + "l": 756, + "g": [ + "中断注入", + "插话", + "打断", + "抢占", + "媒体", + "图片", + "音频" + ] }, { "n": "InjectInterruptMediaOpts", @@ -723,18 +958,16 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 243 - }, - { - "n": "InjectInterruptText", - "s": "InjectInterruptText(source, channel, text string)", - "d": "", - "k": "method", - "r": "IOInjector", - "p": "channels", - "b": false, - "f": "plugin.go", - "l": 221 + "l": 243, + "g": [ + "中断注入", + "插话", + "打断", + "抢占", + "媒体", + "图片", + "音频" + ] }, { "n": "InjectInterruptText", @@ -745,18 +978,30 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 673 + "l": 673, + "g": [ + "中断注入", + "插话", + "打断", + "抢占" + ] }, { - "n": "InjectInterruptTextOpts", - "s": "func (s *PluginSDK) InjectInterruptTextOpts(source, channel, text string, opts InjectOptions)", - "d": "InjectInterruptTextOpts 注入可抢占当前处理的中断文本。", + "n": "InjectInterruptText", + "s": "InjectInterruptText(source, channel, text string)", + "d": "", "k": "method", - "r": "PluginSDK", + "r": "IOInjector", "p": "channels", "b": false, "f": "plugin.go", - "l": 724 + "l": 221, + "g": [ + "中断注入", + "插话", + "打断", + "抢占" + ] }, { "n": "InjectInterruptTextOpts", @@ -767,7 +1012,30 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 239 + "l": 239, + "g": [ + "中断注入", + "插话", + "打断", + "抢占" + ] + }, + { + "n": "InjectInterruptTextOpts", + "s": "func (s *PluginSDK) InjectInterruptTextOpts(source, channel, text string, opts InjectOptions)", + "d": "InjectInterruptTextOpts 注入可抢占当前处理的中断文本。", + "k": "method", + "r": "PluginSDK", + "p": "channels", + "b": false, + "f": "plugin.go", + "l": 724, + "g": [ + "中断注入", + "插话", + "打断", + "抢占" + ] }, { "n": "InjectOptions", @@ -778,18 +1046,12 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 98 - }, - { - "n": "InjectText", - "s": "func (s *PluginSDK) InjectText(source, channel, text string)", - "d": "InjectText injects a text message into the agent pipeline.", - "k": "method", - "r": "PluginSDK", - "p": "channels", - "b": false, - "f": "plugin.go", - "l": 679 + "l": 98, + "g": [ + "注入选项", + "是否记入记忆", + "是否裁剪上下文" + ] }, { "n": "InjectText", @@ -800,18 +1062,30 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 222 + "l": 222, + "g": [ + "注入文本", + "注入消息", + "投喂输入", + "灌入内容" + ] }, { - "n": "InjectTextNoMemory", - "s": "func (s *PluginSDK) InjectTextNoMemory(source, channel, text string)", - "d": "InjectTextNoMemory injects a text message without generating memory.", + "n": "InjectText", + "s": "func (s *PluginSDK) InjectText(source, channel, text string)", + "d": "InjectText injects a text message into the agent pipeline.", "k": "method", "r": "PluginSDK", "p": "channels", "b": false, "f": "plugin.go", - "l": 685 + "l": 679, + "g": [ + "注入文本", + "注入消息", + "投喂输入", + "灌入内容" + ] }, { "n": "InjectTextNoMemory", @@ -822,18 +1096,34 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 223 + "l": 223, + "g": [ + "注入文本", + "注入消息", + "投喂输入", + "灌入内容", + "记忆", + "内存" + ] }, { - "n": "InjectTextOpts", - "s": "func (s *PluginSDK) InjectTextOpts(source, channel, text string, opts InjectOptions)", - "d": "InjectTextOpts 注入文本到 agent,并在这一次注入上声明记忆与裁剪行为。", + "n": "InjectTextNoMemory", + "s": "func (s *PluginSDK) InjectTextNoMemory(source, channel, text string)", + "d": "InjectTextNoMemory injects a text message without generating memory.", "k": "method", "r": "PluginSDK", "p": "channels", "b": false, "f": "plugin.go", - "l": 714 + "l": 685, + "g": [ + "注入文本", + "注入消息", + "投喂输入", + "灌入内容", + "记忆", + "内存" + ] }, { "n": "InjectTextOpts", @@ -844,7 +1134,30 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 238 + "l": 238, + "g": [ + "注入文本", + "注入消息", + "投喂输入", + "灌入内容" + ] + }, + { + "n": "InjectTextOpts", + "s": "func (s *PluginSDK) InjectTextOpts(source, channel, text string, opts InjectOptions)", + "d": "InjectTextOpts 注入文本到 agent,并在这一次注入上声明记忆与裁剪行为。", + "k": "method", + "r": "PluginSDK", + "p": "channels", + "b": false, + "f": "plugin.go", + "l": 714, + "g": [ + "注入文本", + "注入消息", + "投喂输入", + "灌入内容" + ] }, { "n": "InputChannelRegistrar", @@ -855,7 +1168,11 @@ "p": "bridge", "b": false, "f": "plugin.go", - "l": 314 + "l": 314, + "g": [ + "通道", + "频道" + ] }, { "n": "Insert", @@ -866,7 +1183,10 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 76 + "l": 76, + "g": [ + "插入文档" + ] }, { "n": "InsertWithMedia", @@ -877,7 +1197,13 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 81 + "l": 81, + "g": [ + "媒体", + "图片", + "音频", + "插入带媒体文档" + ] }, { "n": "Introspect", @@ -888,7 +1214,11 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 7 + "l": 7, + "g": [ + "查看记忆", + "记忆概览" + ] }, { "n": "IsPluginDisabled", @@ -899,7 +1229,10 @@ "p": "lifecycle", "b": false, "f": "plugin.go", - "l": 290 + "l": 290, + "g": [ + "查插件是否被禁用" + ] }, { "n": "IsResponded", @@ -921,7 +1254,11 @@ "p": "memory", "b": false, "f": "knowledge.go", - "l": 11 + "l": 11, + "g": [ + "知识库", + "知识" + ] }, { "n": "Knowledge", @@ -932,7 +1269,11 @@ "p": "memory", "b": false, "f": "plugin.go", - "l": 425 + "l": 425, + "g": [ + "知识库", + "知识" + ] }, { "n": "KnowledgeAPI", @@ -945,17 +1286,6 @@ "f": "", "l": 0 }, - { - "n": "KnowledgeAPI", - "s": "type KnowledgeAPI interface { Search(query string, topK int) ([]*Knowledge, error) Add(name, content string) error List() ([]string, error) }", - "d": "KnowledgeAPI provides access to the knowledge store.", - "k": "type", - "r": "", - "p": "memory", - "b": false, - "f": "knowledge.go", - "l": 4 - }, { "n": "LLM", "s": "func (s *PluginSDK) LLM() LLMAPI", @@ -967,17 +1297,6 @@ "f": "plugin.go", "l": 432 }, - { - "n": "LLMAPI", - "s": "type LLMAPI interface { ListSources() []string SetSource(name string) error CurrentSource() string }", - "d": "LLMAPI provides access to the LLM provider manager.", - "k": "type", - "r": "", - "p": "llm", - "b": false, - "f": "llm.go", - "l": 4 - }, { "n": "LLMAPI", "s": "type LLMAPI interface", @@ -998,7 +1317,10 @@ "p": "memory", "b": false, "f": "knowledge.go", - "l": 7 + "l": 7, + "g": [ + "列出" + ] }, { "n": "List", @@ -1009,7 +1331,10 @@ "p": "settings", "b": false, "f": "settings.go", - "l": 11 + "l": 11, + "g": [ + "列出" + ] }, { "n": "ListCore", @@ -1020,7 +1345,10 @@ "p": "settings", "b": false, "f": "settings.go", - "l": 20 + "l": 20, + "g": [ + "列出核心配置" + ] }, { "n": "ListLoadedPlugins", @@ -1031,7 +1359,10 @@ "p": "lifecycle", "b": false, "f": "plugin.go", - "l": 288 + "l": 288, + "g": [ + "已加载插件列表" + ] }, { "n": "ListPersons", @@ -1042,7 +1373,10 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 105 + "l": 105, + "g": [ + "列出人物" + ] }, { "n": "ListPlugin", @@ -1053,7 +1387,10 @@ "p": "settings", "b": false, "f": "settings.go", - "l": 34 + "l": 34, + "g": [ + "列出插件配置" + ] }, { "n": "ListSources", @@ -1064,7 +1401,10 @@ "p": "llm", "b": false, "f": "llm.go", - "l": 5 + "l": 5, + "g": [ + "列出模型来源" + ] }, { "n": "Lock", @@ -1086,7 +1426,13 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 58 + "l": 58, + "g": [ + "媒体", + "图片", + "音频", + "媒体附件" + ] }, { "n": "MemItem", @@ -1108,7 +1454,11 @@ "p": "memory", "b": false, "f": "plugin.go", - "l": 404 + "l": 404, + "g": [ + "记忆", + "内存" + ] }, { "n": "MemoryAPI", @@ -1121,17 +1471,6 @@ "f": "", "l": 0 }, - { - "n": "MemoryAPI", - "s": "type MemoryAPI interface { Recall(query []string, depth int) ([]Entity, []Relation, error) Commit(triples []Triple) error Introspect() (map[string]interface{}, error) Merg …", - "d": "MemoryAPI provides access to the graph memory (entity-relation store).", - "k": "type", - "r": "", - "p": "memory", - "b": false, - "f": "memory.go", - "l": 4 - }, { "n": "MergeEntities", "s": "MergeEntities(source, target string) (int, error)", @@ -1141,7 +1480,10 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 8 + "l": 8, + "g": [ + "合并实体" + ] }, { "n": "Name", @@ -1152,7 +1494,10 @@ "p": "lifecycle", "b": false, "f": "plugin.go", - "l": 14 + "l": 14, + "g": [ + "名称" + ] }, { "n": "OutputChannelRegistrar", @@ -1163,7 +1508,11 @@ "p": "bridge", "b": false, "f": "plugin.go", - "l": 317 + "l": 317, + "g": [ + "通道", + "频道" + ] }, { "n": "OutputChannelUnregistrar", @@ -1174,7 +1523,11 @@ "p": "bridge", "b": false, "f": "plugin.go", - "l": 324 + "l": 324, + "g": [ + "通道", + "频道" + ] }, { "n": "PersonProfile", @@ -1185,18 +1538,10 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 109 - }, - { - "n": "Plugin", - "s": "type Plugin interface { Name() string Start(sdk *PluginSDK) error Stop() error }", - "d": "Plugin is the interface every plugin must implement.", - "k": "type", - "r": "", - "p": "lifecycle", - "b": false, - "f": "plugin.go", - "l": 13 + "l": 109, + "g": [ + "人物画像" + ] }, { "n": "Plugin", @@ -1218,18 +1563,13 @@ "p": "lifecycle", "b": false, "f": "plugin.go", - "l": 653 - }, - { - "n": "PluginMgrAPI", - "s": "type PluginMgrAPI interface { // ReloadOne 重载单个插件(停止后重新加载)。 ReloadOne(name string) error // ListLoadedPlugins 列出已加载插件。 ListLoa …", - "d": "PluginMgrAPI 提供插件管理能力(外部插件可调用)。", - "k": "type", - "r": "", - "p": "lifecycle", - "b": false, - "f": "plugin.go", - "l": 284 + "l": 653, + "g": [ + "插件管理", + "重载插件", + "禁用插件", + "插件管理器" + ] }, { "n": "PluginMgrAPI", @@ -1251,7 +1591,10 @@ "p": "lifecycle", "b": false, "f": "plugin.go", - "l": 397 + "l": 397, + "g": [ + "插件名" + ] }, { "n": "PluginSDK", @@ -1273,7 +1616,10 @@ "p": "settings", "b": false, "f": "settings.go", - "l": 46 + "l": 46, + "g": [ + "插件配置" + ] }, { "n": "PriorityL1", @@ -1284,7 +1630,11 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 123 + "l": 123, + "g": [ + "优先级", + "中断级别" + ] }, { "n": "PriorityL2", @@ -1295,7 +1645,11 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 124 + "l": 124, + "g": [ + "优先级", + "中断级别" + ] }, { "n": "PriorityL3", @@ -1306,7 +1660,11 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 125 + "l": 125, + "g": [ + "优先级", + "中断级别" + ] }, { "n": "PriorityL4", @@ -1317,7 +1675,11 @@ "p": "channels", "b": true, "f": "plugin.go", - "l": 127 + "l": 127, + "g": [ + "优先级", + "中断级别" + ] }, { "n": "Purge", @@ -1328,7 +1690,12 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 9 + "l": 9, + "g": [ + "清除", + "删除记忆", + "清除记忆" + ] }, { "n": "Query", @@ -1339,7 +1706,10 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 75 + "l": 75, + "g": [ + "查询文档" + ] }, { "n": "RLock", @@ -1372,7 +1742,13 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 5 + "l": 5, + "g": [ + "召回", + "检索记忆", + "召回记忆", + "查记忆" + ] }, { "n": "RecallPolicyAuto", @@ -1383,7 +1759,14 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 65 + "l": 65, + "g": [ + "策略", + "召回", + "检索记忆", + "自动召回", + "默认召回" + ] }, { "n": "RecallPolicyNone", @@ -1394,7 +1777,14 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 64 + "l": 64, + "g": [ + "策略", + "召回", + "检索记忆", + "不召回", + "关闭召回" + ] }, { "n": "RegisterDef", @@ -1405,7 +1795,12 @@ "p": "settings", "b": false, "f": "settings.go", - "l": 37 + "l": 37, + "g": [ + "注册配置项", + "声明配置", + "配置定义" + ] }, { "n": "RegisterInputChannel", @@ -1416,7 +1811,15 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 561 + "l": 561, + "g": [ + "注册输入通道", + "收消息", + "接收消息", + "外部消息源", + "通道", + "频道" + ] }, { "n": "RegisterOnRemoveHandler", @@ -1427,7 +1830,13 @@ "p": "lifecycle", "b": false, "f": "plugin.go", - "l": 826 + "l": 826, + "g": [ + "卸载回调", + "删除清理", + "插件卸载", + "onRemove" + ] }, { "n": "RegisterOutputChannel", @@ -1438,7 +1847,15 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 528 + "l": 528, + "g": [ + "注册输出通道", + "发消息", + "投递消息", + "输出目的地", + "通道", + "频道" + ] }, { "n": "RegisterPluginAPI", @@ -1449,7 +1866,11 @@ "p": "lifecycle", "b": false, "f": "plugin.go", - "l": 502 + "l": 502, + "g": [ + "注册插件接口", + "暴露接口" + ] }, { "n": "RegisterStage", @@ -1460,7 +1881,16 @@ "p": "stages", "b": false, "f": "plugin.go", - "l": 467 + "l": 467, + "g": [ + "注册阶段", + "阶段钩子", + "挂钩子", + "干预流程", + "管道钩子", + "阶段", + "钩子" + ] }, { "n": "RegisterStopHandler", @@ -1471,7 +1901,12 @@ "p": "lifecycle", "b": false, "f": "plugin.go", - "l": 801 + "l": 801, + "g": [ + "停止回调", + "关闭清理", + "插件停止" + ] }, { "n": "RegisterTool", @@ -1482,7 +1917,18 @@ "p": "tools", "b": false, "f": "plugin.go", - "l": 453 + "l": 453, + "g": [ + "注册工具", + "添加工具", + "暴露工具", + "工具定义", + "让模型调用", + "工具", + "怎么注册工具", + "工具怎么加", + "自定义工具" + ] }, { "n": "Relation", @@ -1493,7 +1939,11 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 20 + "l": 20, + "g": [ + "关系", + "三元组关系" + ] }, { "n": "ReloadOne", @@ -1504,7 +1954,10 @@ "p": "lifecycle", "b": false, "f": "plugin.go", - "l": 286 + "l": 286, + "g": [ + "重载单个插件" + ] }, { "n": "Remove", @@ -1515,7 +1968,10 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 82 + "l": 82, + "g": [ + "删除文档" + ] }, { "n": "RunOnRemoveHandlers", @@ -1548,7 +2004,10 @@ "p": "misc", "b": false, "f": "plugin.go", - "l": 10 + "l": 10, + "g": [ + "SDK 版本" + ] }, { "n": "Search", @@ -1559,7 +2018,10 @@ "p": "memory", "b": false, "f": "knowledge.go", - "l": 5 + "l": 5, + "g": [ + "搜索知识" + ] }, { "n": "Set", @@ -1570,7 +2032,12 @@ "p": "settings", "b": false, "f": "settings.go", - "l": 8 + "l": 8, + "g": [ + "设置", + "装配", + "写入配置" + ] }, { "n": "SetAutoRestart", @@ -1581,7 +2048,16 @@ "p": "lifecycle", "b": false, "f": "plugin.go", - "l": 784 + "l": 784, + "g": [ + "设置", + "装配", + "自动重启", + "崩溃自愈", + "故障恢复", + "崩溃后重启", + "是否自动重启" + ] }, { "n": "SetCore", @@ -1592,7 +2068,12 @@ "p": "settings", "b": false, "f": "settings.go", - "l": 17 + "l": 17, + "g": [ + "设置", + "装配", + "写核心配置" + ] }, { "n": "SetDocMemoryAPI", @@ -1603,7 +2084,14 @@ "p": "bridge", "b": false, "f": "plugin.go", - "l": 614 + "l": 614, + "g": [ + "设置", + "装配", + "记忆", + "内存", + "文档" + ] }, { "n": "SetEventSubscriber", @@ -1614,7 +2102,13 @@ "p": "bridge", "b": true, "f": "plugin.go", - "l": 638 + "l": 638, + "g": [ + "设置", + "装配", + "事件", + "订阅" + ] }, { "n": "SetIOInjector", @@ -1625,7 +2119,11 @@ "p": "bridge", "b": false, "f": "plugin.go", - "l": 595 + "l": 595, + "g": [ + "设置", + "装配" + ] }, { "n": "SetInputChannelRegistrar", @@ -1636,7 +2134,13 @@ "p": "bridge", "b": false, "f": "plugin.go", - "l": 588 + "l": 588, + "g": [ + "设置", + "装配", + "通道", + "频道" + ] }, { "n": "SetKnowledgeAPI", @@ -1647,7 +2151,13 @@ "p": "bridge", "b": false, "f": "plugin.go", - "l": 620 + "l": 620, + "g": [ + "设置", + "装配", + "知识库", + "知识" + ] }, { "n": "SetLLMAPI", @@ -1658,7 +2168,11 @@ "p": "bridge", "b": false, "f": "plugin.go", - "l": 626 + "l": 626, + "g": [ + "设置", + "装配" + ] }, { "n": "SetMemoryAPI", @@ -1669,7 +2183,13 @@ "p": "bridge", "b": false, "f": "plugin.go", - "l": 602 + "l": 602, + "g": [ + "设置", + "装配", + "记忆", + "内存" + ] }, { "n": "SetOutputChannelRegistrar", @@ -1680,7 +2200,13 @@ "p": "bridge", "b": false, "f": "plugin.go", - "l": 574 + "l": 574, + "g": [ + "设置", + "装配", + "通道", + "频道" + ] }, { "n": "SetOutputChannelUnregistrar", @@ -1691,7 +2217,13 @@ "p": "bridge", "b": true, "f": "plugin.go", - "l": 581 + "l": 581, + "g": [ + "设置", + "装配", + "通道", + "频道" + ] }, { "n": "SetPlugin", @@ -1702,7 +2234,12 @@ "p": "settings", "b": false, "f": "settings.go", - "l": 31 + "l": 31, + "g": [ + "设置", + "装配", + "写插件配置" + ] }, { "n": "SetPluginMgrAPI", @@ -1713,7 +2250,14 @@ "p": "bridge", "b": false, "f": "plugin.go", - "l": 645 + "l": 645, + "g": [ + "设置", + "装配", + "插件管理", + "重载插件", + "禁用插件" + ] }, { "n": "SetSocialAPI", @@ -1724,7 +2268,14 @@ "p": "bridge", "b": false, "f": "plugin.go", - "l": 632 + "l": 632, + "g": [ + "设置", + "装配", + "社交", + "关系", + "联系人" + ] }, { "n": "SetSource", @@ -1735,7 +2286,12 @@ "p": "llm", "b": false, "f": "llm.go", - "l": 6 + "l": 6, + "g": [ + "设置", + "装配", + "切换模型" + ] }, { "n": "SetTextMemoryAPI", @@ -1746,18 +2302,13 @@ "p": "bridge", "b": false, "f": "plugin.go", - "l": 608 - }, - { - "n": "SetToolBlocks", - "s": "SetToolBlocks(blocks []ContentBlock)", - "d": "SetToolBlocks 插件工具注入多模态内容块(image_url/audio_url),内核在下一条", - "k": "method", - "r": "IOInjector", - "p": "channels", - "b": false, - "f": "plugin.go", - "l": 229 + "l": 608, + "g": [ + "设置", + "装配", + "记忆", + "内存" + ] }, { "n": "SetToolBlocks", @@ -1768,7 +2319,34 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 772 + "l": 772, + "g": [ + "设置", + "装配", + "工具", + "工具返回图片", + "多模态返回", + "让模型看图" + ] + }, + { + "n": "SetToolBlocks", + "s": "SetToolBlocks(blocks []ContentBlock)", + "d": "SetToolBlocks 插件工具注入多模态内容块(image_url/audio_url),内核在下一条", + "k": "method", + "r": "IOInjector", + "p": "channels", + "b": false, + "f": "plugin.go", + "l": 229, + "g": [ + "设置", + "装配", + "工具", + "工具返回图片", + "多模态返回", + "让模型看图" + ] }, { "n": "Settings", @@ -1779,7 +2357,11 @@ "p": "settings", "b": false, "f": "plugin.go", - "l": 401 + "l": 401, + "g": [ + "设置", + "装配" + ] }, { "n": "SettingsAPI", @@ -1792,17 +2374,6 @@ "f": "", "l": 0 }, - { - "n": "SettingsAPI", - "s": "type SettingsAPI interface { // Get reads the plugin's own config value (config_\u003cname\u003e table). Get(key string) (interface{}, error) // Set writes a config value to the plugi …", - "d": "", - "k": "type", - "r": "", - "p": "settings", - "b": false, - "f": "settings.go", - "l": 3 - }, { "n": "Social", "s": "func (s *PluginSDK) Social() SocialAPI", @@ -1812,18 +2383,12 @@ "p": "memory", "b": false, "f": "plugin.go", - "l": 439 - }, - { - "n": "SocialAPI", - "s": "type SocialAPI interface { GetPerson(name string) (*PersonProfile, error) GetTrait(name, trait string) (string, bool) GetRelations(name string) ([]SocialRelation, error) G …", - "d": "SocialAPI provides read-only access to the social graph (person profiles and relationships).", - "k": "type", - "r": "", - "p": "memory", - "b": false, - "f": "memory.go", - "l": 100 + "l": 439, + "g": [ + "社交", + "关系", + "联系人" + ] }, { "n": "SocialAPI", @@ -1845,7 +2410,13 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 116 + "l": 116, + "g": [ + "社交", + "关系", + "联系人", + "社交关系" + ] }, { "n": "Stage", @@ -1856,7 +2427,13 @@ "p": "stages", "b": false, "f": "plugin.go", - "l": 26 + "l": 26, + "g": [ + "阶段", + "钩子", + "阶段名", + "管线阶段" + ] }, { "n": "StageAfterOutput", @@ -1867,7 +2444,11 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 35 + "l": 35, + "g": [ + "阶段", + "钩子" + ] }, { "n": "StageAfterToolcall", @@ -1878,7 +2459,12 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 33 + "l": 33, + "g": [ + "阶段", + "钩子", + "工具" + ] }, { "n": "StageBeforeOutput", @@ -1889,7 +2475,11 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 34 + "l": 34, + "g": [ + "阶段", + "钩子" + ] }, { "n": "StageBeforeToolcall", @@ -1900,7 +2490,12 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 32 + "l": 32, + "g": [ + "阶段", + "钩子", + "工具" + ] }, { "n": "StageContext", @@ -1911,7 +2506,13 @@ "p": "stages", "b": false, "f": "plugin.go", - "l": 148 + "l": 148, + "g": [ + "阶段", + "钩子", + "阶段上下文", + "读写消息" + ] }, { "n": "StageHandler", @@ -1922,7 +2523,12 @@ "p": "stages", "b": false, "f": "plugin.go", - "l": 23 + "l": 23, + "g": [ + "阶段", + "钩子", + "阶段处理函数" + ] }, { "n": "StageOnInput", @@ -1933,7 +2539,11 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 29 + "l": 29, + "g": [ + "阶段", + "钩子" + ] }, { "n": "StagePostAction", @@ -1944,7 +2554,11 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 31 + "l": 31, + "g": [ + "阶段", + "钩子" + ] }, { "n": "StagePreAction", @@ -1955,7 +2569,11 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 30 + "l": 30, + "g": [ + "阶段", + "钩子" + ] }, { "n": "StageRegistrar", @@ -1966,7 +2584,11 @@ "p": "stages", "b": false, "f": "plugin.go", - "l": 308 + "l": 308, + "g": [ + "阶段", + "钩子" + ] }, { "n": "StageScope", @@ -1977,7 +2599,13 @@ "p": "stages", "b": false, "f": "plugin.go", - "l": 294 + "l": 294, + "g": [ + "阶段", + "钩子", + "阶段作用域", + "只看自己的调用" + ] }, { "n": "StageScopeGlobal", @@ -1988,7 +2616,11 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 298 + "l": 298, + "g": [ + "阶段", + "钩子" + ] }, { "n": "StageScopeOwnTools", @@ -1999,7 +2631,12 @@ "p": "constants", "b": false, "f": "plugin.go", - "l": 301 + "l": 301, + "g": [ + "阶段", + "钩子", + "工具" + ] }, { "n": "Start", @@ -2010,7 +2647,10 @@ "p": "lifecycle", "b": false, "f": "plugin.go", - "l": 15 + "l": 15, + "g": [ + "启动" + ] }, { "n": "Stats", @@ -2021,7 +2661,10 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 83 + "l": 83, + "g": [ + "统计" + ] }, { "n": "Stop", @@ -2032,7 +2675,11 @@ "p": "lifecycle", "b": false, "f": "plugin.go", - "l": 16 + "l": 16, + "g": [ + "停止", + "关闭" + ] }, { "n": "Subscribe", @@ -2054,7 +2701,11 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 65 + "l": 65, + "g": [ + "事件", + "订阅" + ] }, { "n": "TextMemory", @@ -2065,18 +2716,11 @@ "p": "memory", "b": false, "f": "plugin.go", - "l": 411 - }, - { - "n": "TextMemoryAPI", - "s": "type TextMemoryAPI interface { Append(evt TextEvent) error }", - "d": "TextMemoryAPI provides access to chronological text event storage.", - "k": "type", - "r": "", - "p": "memory", - "b": false, - "f": "memory.go", - "l": 43 + "l": 411, + "g": [ + "记忆", + "内存" + ] }, { "n": "TextMemoryAPI", @@ -2098,7 +2742,11 @@ "p": "tools", "b": false, "f": "plugin.go", - "l": 186 + "l": 186, + "g": [ + "工具", + "工具调用" + ] }, { "n": "ToolDef", @@ -2109,7 +2757,13 @@ "p": "tools", "b": false, "f": "plugin.go", - "l": 203 + "l": 203, + "g": [ + "工具", + "工具定义", + "工具描述", + "参数表" + ] }, { "n": "ToolHandler", @@ -2120,7 +2774,12 @@ "p": "tools", "b": false, "f": "plugin.go", - "l": 20 + "l": 20, + "g": [ + "工具", + "工具实现", + "处理函数" + ] }, { "n": "ToolRegistrar", @@ -2131,7 +2790,10 @@ "p": "bridge", "b": false, "f": "plugin.go", - "l": 305 + "l": 305, + "g": [ + "工具" + ] }, { "n": "ToolResult", @@ -2142,7 +2804,12 @@ "p": "tools", "b": false, "f": "plugin.go", - "l": 194 + "l": 194, + "g": [ + "工具", + "工具结果", + "返回值" + ] }, { "n": "Triple", @@ -2153,7 +2820,10 @@ "p": "memory", "b": false, "f": "memory.go", - "l": 31 + "l": 31, + "g": [ + "三元组" + ] }, { "n": "Unlock", @@ -2175,7 +2845,13 @@ "p": "misc", "b": true, "f": "plugin.go", - "l": 539 + "l": 539, + "g": [ + "通道", + "频道", + "注销输出通道", + "删除通道" + ] }, { "n": "ValidContextPolicy", @@ -2186,7 +2862,11 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 49 + "l": 49, + "g": [ + "策略", + "校验裁剪策略" + ] }, { "n": "ValidRecallPolicy", @@ -2197,6 +2877,12 @@ "p": "channels", "b": false, "f": "plugin.go", - "l": 69 + "l": 69, + "g": [ + "策略", + "召回", + "检索记忆", + "校验召回策略" + ] } ] diff --git a/docs/javascripts/api-search.js b/docs/javascripts/api-search.js index 0df45a2..489f146 100644 --- a/docs/javascripts/api-search.js +++ b/docs/javascripts/api-search.js @@ -65,6 +65,17 @@ else if (name.indexOf(ql) === 0) s += 600; else if (name.indexOf(ql) > 0) s += 350; + // 中文检索关键词(keywords.json 产出,字段 g)。 + // 为什么需要:SDK 里 66/100 个符号是英文注释(`RegisterTool registers a + // tool that the LLM can call.`),懂中文的人搜「注册工具」会一条都找不到。 + // 关键词命中给较高权重(仅次于名称精确命中),因为它就是为「按功能找」准备的。 + var kws = item.g || []; + for (var ki = 0; ki < kws.length; ki++) { + var kw = String(kws[ki]).toLowerCase(); + if (kw === ql) { s += 480; break; } + if (kw.indexOf(ql) >= 0) { s += 300; break; } + } + // 限定符:PluginSDK.RegisterTool / IOInjector.InjectText。 // 额外支持「去掉 API/SDK 后缀」与「去掉点号」两种写法, // 因为读者习惯写 `memory.recall`(RPC 名),而 Go 名是 `MemoryAPI.Recall`。 @@ -94,13 +105,17 @@ } // 中文按字匹配:中文没有词边界,逐字命中比整串更实用。 + // 注意只把它当作**弱信号**:光靠逐字会把「注册工具」匹到凡是含「工具」 + // 字样的任何东西(实测 ContextPolicyNone 的说明里有「工具调用」也会命中)。 + // 所以阈值卡在 60% 以上才算有效命中。 if (/[\u4e00-\u9fa5]/.test(q)) { var hit = 0; + var hay = desc + " " + kws.join(" "); for (var i = 0; i < q.length; i++) { - if (desc.indexOf(q[i]) >= 0) hit++; + if (hay.indexOf(q[i]) >= 0) hit++; } - if (hit === q.length) s += 100; // 全部字都出现 - else s += hit * 8; + var ratio = hit / q.length; + if (ratio >= 0.6) s += Math.round(hit * 6); } // 公开 API 略优先于「仅内置」——后者通常是噪声。 @@ -173,6 +188,10 @@ var d = el("span", "api-desc", it.d); li.appendChild(d); } + // 关键词是给检索用的;显示出来能让读者明白“为什么这条被匹配到”。 + if (it.g && it.g.length) { + li.appendChild(el("span", "api-kw", it.g.slice(0, 6).join(" · "))); + } if (it.f) { li.appendChild(el("span", "api-loc", it.f + (it.l ? ":" + it.l : ""))); } diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index c2864a1..e923d74 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -71,6 +71,14 @@ color: var(--md-default-fg-color--light); } +/* 「为何命中」的中文关键词(keywords.json 产出)。 */ +.api-kw { + flex-basis: 100%; + font-size: 0.7rem; + color: var(--md-accent-fg-color); + opacity: 0.9; +} + .api-loc { flex-basis: 100%; font-size: 0.68rem; diff --git a/tools/apidoc/gensite/keywords.go b/tools/apidoc/gensite/keywords.go new file mode 100644 index 0000000..a549317 --- /dev/null +++ b/tools/apidoc/gensite/keywords.go @@ -0,0 +1,94 @@ +package main + +import ( + "encoding/json" + "fmt" + "os" + "path/filepath" + "strings" +) + +// 中文检索关键词。 +// +// 问题:SDK 里 100 个有摘要的符号中 **66 个是英文注释** +// (`RegisterTool registers a tool that the LLM can call.`), +// 于是搜「注册工具」找不到 RegisterTool —— 而受众主要是中文。 +// +// 解法不是翻译源码注释(那会让代码与文档脱节),而是给检索索引补一层 +// **人工标注的功能词**:不影响页面展示,只让中文能搜到。 +// +// 词表在 tools/apidoc/keywords.json。规则用「前缀 → 词」批量覆盖 +// (Register* 全带「注册」),少数重点符号再逐条补充。 +type keywordTable struct { + Rules []keywordRule `json:"rules"` + Symbols map[string][]string `json:"symbols"` +} + +type keywordRule struct { + // Prefix 匹配符号名前缀;Contains 匹配名字里是否含该子串。二选一。 + Prefix string `json:"prefix,omitempty"` + Contains string `json:"contains,omitempty"` + Words []string `json:"words"` +} + +// loadKeywords 读词表。找不到就返回空表(不报错中断)—— +// 检索关键词是**增强**,缺失时退化为原行为,不该让构建失败。 +func loadKeywords() (*keywordTable, error) { + path := keywordPath() + data, err := os.ReadFile(path) + if err != nil { + return &keywordTable{}, err + } + var t keywordTable + if err := json.Unmarshal(data, &t); err != nil { + return &keywordTable{}, fmt.Errorf("解析 %s: %w", path, err) + } + return &t, nil +} + +// lookup 返回某符号的中文检索词(可能为空)。 +func (t *keywordTable) lookup(name, docBrief string) []string { + if t == nil { + return nil + } + seen := map[string]bool{} + var out []string + add := func(ws []string) { + for _, w := range ws { + w = strings.TrimSpace(w) + if w == "" || seen[w] { + continue + } + seen[w] = true + out = append(out, w) + } + } + for _, r := range t.Rules { + if r.Prefix != "" && strings.HasPrefix(name, r.Prefix) { + add(r.Words) + } + if r.Contains != "" && strings.Contains(name, r.Contains) { + add(r.Words) + } + } + add(t.Symbols[name]) + return out +} + +// keywordPath 找 keywords.json:可执行文件旁 → 源码目录 → 工作目录。 +func keywordPath() string { + candidates := []string{} + if exe, err := os.Executable(); err == nil { + candidates = append(candidates, filepath.Join(filepath.Dir(exe), "keywords.json")) + } + candidates = append(candidates, + filepath.Join("tools", "apidoc", "keywords.json"), + "keywords.json", + ) + for _, c := range candidates { + if _, err := os.Stat(c); err == nil { + return c + } + } + return candidates[0] +} diff --git a/tools/apidoc/gensite/main.go b/tools/apidoc/gensite/main.go index 7ea6159..78d64d1 100644 --- a/tools/apidoc/gensite/main.go +++ b/tools/apidoc/gensite/main.go @@ -180,7 +180,7 @@ func main() { log.Fatal(err) } - // 先收集所有待渲染的符号名,再扫 example/ 取真实用法。 + // 收集所有待渲染的符号名,再扫 example/ 取真实用法。 want := map[string]bool{} for _, s := range pkg.Symbols { if s.Exported { @@ -192,25 +192,41 @@ func main() { } usages := scanUsages(*exDir, want) + // 中文检索关键词(弥补英文注释搜不到中文的问题)。 + kw, err := loadKeywords() + if err != nil { + log.Printf("警告:未加载中文检索关键词(%v),中文检索将只能命中中文注释", err) + } + used := map[string]bool{} var index []indexEntry for _, sec := range sections { + // 本节的接口(先算出来,下面要用它排除重复的 type 符号)。 + var ifaces []Interface + ifaceNames := map[string]bool{} + for _, it := range pkg.Interfaces { + if sec.Match(Symbol{Kind: "type", Name: it.Name}) { + ifaces = append(ifaces, it) + ifaceNames[it.Name] = true + } + } + var picked []Symbol for _, s := range pkg.Symbols { if !s.Exported || !sec.Match(s) || used[key(s)] { continue } + // 接口已作为 ifaces 单独渲染(带方法表),这里跳过它的 `type` + // 符号,否则同一个接口会既出现在符号区、又出现在接口区, + // 检索索引里也会出现两条。 + if s.Kind == "type" && ifaceNames[s.Name] { + used[key(s)] = true + continue + } picked = append(picked, s) used[key(s)] = true } - // 该章节涉及的接口(其方法单独列在接口下,避免重复)。 - var ifaces []Interface - for _, it := range pkg.Interfaces { - if sec.Match(Symbol{Kind: "type", Name: it.Name}) { - ifaces = append(ifaces, it) - } - } if len(picked) == 0 && len(ifaces) == 0 { continue } @@ -224,6 +240,7 @@ func main() { N: s.Name, S: s.Signature, D: s.DocBrief, K: s.Kind, R: s.Recv, P: sec.File, B: s.BuiltinOnly, F: s.File, L: s.Line, + G: kw.lookup(s.Name, s.DocBrief), }) } // 接口本身与其方法也要进索引。此前只加了顶层符号,导致 @@ -238,6 +255,7 @@ func main() { N: m.Name, S: m.Signature, D: m.DocBrief, K: "method", R: it.Name, P: sec.File, B: m.BuiltinOnly, F: m.File, L: m.Line, + G: kw.lookup(m.Name, m.DocBrief), }) } } @@ -253,6 +271,7 @@ func main() { index = append(index, indexEntry{ N: c.Name, S: "const " + c.Name, D: c.DocBrief, K: "const", P: "constants", F: c.File, L: c.Line, + G: kw.lookup(c.Name, c.DocBrief), }) } } @@ -300,6 +319,14 @@ type indexEntry struct { B bool `json:"b"` // 仅内置 F string `json:"f"` // 源文件 L int `json:"l"` // 行号 + // G 是中文检索关键词(同义词/功能词)。 + // + // 为什么需要:SDK 里 100 个有摘要的符号中 **66 个是英文注释** + // (`RegisterTool registers a tool that the LLM can call.`), + // 于是搜「注册工具」根本找不到 RegisterTool —— 而中文是主要受众。 + // 这些词由 tools/apidoc/keywords.json 维护,不改源码注释, + // 也不依赖机器翻译。 + G []string `json:"g,omitempty"` } func key(s Symbol) string { @@ -522,16 +549,19 @@ func renderExamples(usages map[string][]Usage) string { return b.String() } -// dedupeIndex 按「接收者.名称」去重。无接收者的用「类别.名称」。 -// 同名但不同接收者(如 MemoryAPI.Recall 与 IOInjector.InjectText)都保留。 +// dedupeIndex 按「接收者.名称.类别」去重。 +// +// 为什么带类别:接口会被两条路径加进索引——一次作为 `type` 符号(来自 +// pkg.Symbols),一次作为接口本身(来自 pkg.Interfaces)。两者名字相同、 +// 接收者都为空,只用「名称」做键漏不掉;带上类别才能区分(并且保留两条 +// 也不算错,但会让结果重复,所以统一按 kind 去重)。 +// +// 同名但不同接收者的(如 MemoryAPI.Recall 与 IOInjector.InjectText)都保留。 func dedupeIndex(in []indexEntry) []indexEntry { seen := map[string]bool{} out := in[:0] for _, e := range in { - k := e.R + "." + e.N - if e.R == "" { - k = e.K + "." + e.N - } + k := e.K + "|" + e.R + "." + e.N if seen[k] { continue } diff --git a/tools/apidoc/keywords.json b/tools/apidoc/keywords.json new file mode 100644 index 0000000..ac0c6f8 --- /dev/null +++ b/tools/apidoc/keywords.json @@ -0,0 +1,159 @@ +{ + "_doc": [ + "中文检索关键词:只影响**检索**,不影响页面展示。", + "", + "背景:SDK 里 100 个有摘要的符号中 66 个是英文注释,中文搜不到。", + "例如 `RegisterTool registers a tool that the LLM can call.` —— 搜「注册工具」命中 0。", + "", + "规则:", + " rules[].prefix 符号名前缀匹配(如 Register 开头的都带「注册」)", + " rules[].contains 符号名含该子串即匹配", + " symbols[名] 逐符号补充(用于重点 API 或规则覆盖不到的)", + "", + "写法要求:词要贴近读者会敲的字,宁多勿少;不必去重,代码会去。", + "注意别把词撒太宽(如给所有 Get* 都加「查询」会让结果变噪)。" + ], + + "rules": [ + { "prefix": "RegisterTool", "words": ["注册工具", "添加工具", "暴露工具", "工具定义", "让模型调用"] }, + { "prefix": "RegisterStage", "words": ["注册阶段", "阶段钩子", "挂钩子", "干预流程", "管道钩子"] }, + { "prefix": "RegisterInputChannel", "words": ["注册输入通道", "收消息", "接收消息", "外部消息源"] }, + { "prefix": "RegisterOutputChannel", "words": ["注册输出通道", "发消息", "投递消息", "输出目的地"] }, + { "prefix": "RegisterPluginAPI", "words": ["注册插件接口", "暴露接口"] }, + { "prefix": "RegisterStopHandler", "words": ["停止回调", "关闭清理", "插件停止"] }, + { "prefix": "RegisterOnRemoveHandler", "words": ["卸载回调", "删除清理", "插件卸载", "onRemove"] }, + { "prefix": "RegisterDef", "words": ["注册配置项", "声明配置", "配置定义"] }, + + { "prefix": "InjectText", "words": ["注入文本", "注入消息", "投喂输入", "灌入内容"] }, + { "prefix": "InjectInterrupt", "words": ["中断注入", "插话", "打断", "抢占"] }, + { "prefix": "InjectInput", "words": ["注入输入", "投喂输入", "模拟用户输入"] }, + { "prefix": "InjectMedia", "words": ["注入媒体", "发图片", "发音频"] }, + + { "prefix": "Set", "words": ["设置", "装配"] }, + + { "contains": "AutoRestart", "words": ["自动重启", "崩溃自愈", "故障恢复"] }, + { "contains": "Priority", "words": ["优先级", "中断级别"] }, + { "contains": "Policy", "words": ["策略"] }, + { "contains": "Memory", "words": ["记忆", "内存"] }, + { "contains": "Knowledge", "words": ["知识库", "知识"] }, + { "contains": "Recall", "words": ["召回", "检索记忆"] }, + { "contains": "Media", "words": ["媒体", "图片", "音频"] }, + { "contains": "Channel", "words": ["通道", "频道"] }, + { "contains": "Event", "words": ["事件", "订阅"] }, + { "contains": "Stage", "words": ["阶段", "钩子"] }, + { "contains": "Tool", "words": ["工具"] }, + { "contains": "Doc", "words": ["文档"] }, + { "contains": "Social", "words": ["社交", "关系", "联系人"] }, + { "contains": "Purge", "words": ["清除", "删除记忆"] }, + { "contains": "PluginMgr", "words": ["插件管理", "重载插件", "禁用插件"] } + ], + + "symbols": { + "RegisterTool": ["怎么注册工具", "工具怎么加", "自定义工具"], + "UnregisterOutputChannel": ["注销输出通道", "删除通道"], + "SetToolBlocks": ["工具返回图片", "多模态返回", "让模型看图"], + "ContentBlock": ["多模态内容块", "图片块", "音频块"], + "SetAutoRestart": ["崩溃后重启", "是否自动重启"], + "AutoRestart": ["查询是否自动重启"], + + "ToolDef": ["工具定义", "工具描述", "参数表"], + "ToolHandler": ["工具实现", "处理函数"], + "ToolCall": ["工具调用"], + "ToolResult": ["工具结果", "返回值"], + + "Stage": ["阶段名", "管线阶段"], + "StageHandler": ["阶段处理函数"], + "StageContext": ["阶段上下文", "读写消息"], + "StageScope": ["阶段作用域", "只看自己的调用"], + + "InjectOptions": ["注入选项", "是否记入记忆", "是否裁剪上下文"], + "ContextPolicyNone": ["不裁剪上下文", "默认裁剪策略"], + "ContextPolicyPrune": ["裁剪上下文", "归档丢弃"], + "RecallPolicyNone": ["不召回", "关闭召回"], + "RecallPolicyAuto": ["自动召回", "默认召回"], + + "MemoryAPI": ["图记忆接口", "三元组记忆"], + "TextMemoryAPI": ["文本记忆接口", "事件流水"], + "DocMemoryAPI": ["文档记忆接口", "文档向量"], + "KnowledgeAPI": ["知识库接口"], + "LLMAPI": ["调用模型接口", "LLM 接口"], + "SocialAPI": ["社交接口", "人物画像"], + "SettingsAPI": ["配置接口"], + "IOInjector": ["注入器接口", "投喂输入"], + "PluginMgrAPI": ["插件管理接口"], + "EventSubscriber": ["事件订阅接口"], + "Plugin": ["插件接口", "插件契约"], + + "Entity": ["实体", "记忆主体"], + "Relation": ["关系", "三元组关系"], + "Triple": ["三元组"], + "Doc": ["文档对象"], + "MediaAttachment": ["媒体附件"], + "ConfigDef": ["配置项定义"], + "ChannelDef": ["通道定义"], + "PersonProfile": ["人物画像"], + "SocialRelation": ["社交关系"], + + "Recall": ["召回记忆", "查记忆"], + "Commit": ["写入记忆", "提交三元组"], + "Introspect": ["查看记忆", "记忆概览"], + "MergeEntities": ["合并实体"], + "Purge": ["清除记忆", "删除记忆"], + "Insert": ["插入文档"], + "InsertWithMedia": ["插入带媒体文档"], + "Query": ["查询文档"], + "Remove": ["删除文档"], + "Stats": ["统计"], + "Append": ["追加文本"], + "Add": ["添加知识"], + "Search": ["搜索知识"], + "List": ["列出"], + "Get": ["读取配置"], + "Set": ["写入配置"], + "Defs": ["配置定义列表"], + "Dump": ["导出配置"], + "Plugins": ["插件配置"], + + "PluginName": ["插件名"], + "PluginStop": ["停止插件"], + "PluginStart": ["启动插件"], + "Start": ["启动"], + "Stop": ["停止", "关闭"], + "Name": ["名称"], + "Events": ["事件订阅", "监听事件"], + "PluginMgr": ["插件管理器", "重载插件"], + "ReloadOne": ["重载单个插件"], + "ReloadPlugins": ["重载全部插件"], + "ListLoadedPlugins": ["已加载插件列表"], + "ListDisabledPlugins": ["已禁用插件列表"], + "IsPluginDisabled": ["查插件是否被禁用"], + "DisablePlugin": ["禁用插件"], + "EnablePlugin": ["启用插件"], + "RemovePlugin": ["卸载插件", "删除插件"], + + "GetPerson": ["查人物"], + "GetTrait": ["查特征"], + "GetRelations": ["查关系"], + "GetNetwork": ["查关系网"], + "ListPersons": ["列出人物"], + "CurrentSource": ["当前模型来源"], + "ListSources": ["列出模型来源"], + "SetSource": ["切换模型"], + "DataDir": ["数据目录"], + "GetCore": ["读核心配置"], + "SetCore": ["写核心配置"], + "GetPlugin": ["读插件配置"], + "SetPlugin": ["写插件配置"], + "ListCore": ["列出核心配置"], + "ListPlugin": ["列出插件配置"], + + "CapText": ["文本能力"], + "CapFile": ["文件能力"], + "CapImage": ["图片能力"], + "CapAudio": ["音频能力"], + "CapStructured": ["结构化能力"], + "SDKVersion": ["SDK 版本"], + "ValidContextPolicy": ["校验裁剪策略"], + "ValidRecallPolicy": ["校验召回策略"] + } +}