Files
homeagent-sdk/docs/assets/api-index.json
JianFeeeee 9b6abe1b73 fix(docs): 中文搜不到英文注释的 API —— 补关键词层
## 问题(实测)

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 是**可选**的:读不到只警告不中断,检索退化为原行为。
2026-09-24 13:00:32 +08:00

2889 lines
61 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[
{
"n": "APIRegistrar",
"s": "type APIRegistrar func(name string) error",
"d": "APIRegistrar registers a plugin API for external access.",
"k": "type",
"r": "",
"p": "bridge",
"b": false,
"f": "plugin.go",
"l": 311
},
{
"n": "Add",
"s": "Add(name, content string) error",
"d": "",
"k": "method",
"r": "KnowledgeAPI",
"p": "memory",
"b": false,
"f": "knowledge.go",
"l": 6,
"g": [
"添加知识"
]
},
{
"n": "Append",
"s": "Append(evt TextEvent) error",
"d": "",
"k": "method",
"r": "TextMemoryAPI",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 44,
"g": [
"追加文本"
]
},
{
"n": "AudioURL",
"s": "type AudioURL struct { URL string `json:\"url\"` }",
"d": "",
"k": "type",
"r": "",
"p": "misc",
"b": false,
"f": "plugin.go",
"l": 862
},
{
"n": "AutoRestart",
"s": "func (s *PluginSDK) AutoRestart() bool",
"d": "AutoRestart 返回插件是否允许自动重启。",
"k": "method",
"r": "PluginSDK",
"p": "lifecycle",
"b": false,
"f": "plugin.go",
"l": 791,
"g": [
"自动重启",
"崩溃自愈",
"故障恢复",
"查询是否自动重启"
]
},
{
"n": "CapAudio",
"s": "const CapAudio",
"d": "Output capability flags",
"k": "const",
"r": "",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 331,
"g": [
"音频能力"
]
},
{
"n": "CapFile",
"s": "const CapFile",
"d": "Output capability flags",
"k": "const",
"r": "",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 329,
"g": [
"文件能力"
]
},
{
"n": "CapImage",
"s": "const CapImage",
"d": "Output capability flags",
"k": "const",
"r": "",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 330,
"g": [
"图片能力"
]
},
{
"n": "CapStructured",
"s": "const CapStructured",
"d": "Output capability flags",
"k": "const",
"r": "",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 332,
"g": [
"结构化能力"
]
},
{
"n": "CapText",
"s": "const CapText",
"d": "Output capability flags",
"k": "const",
"r": "",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 328,
"g": [
"文本能力"
]
},
{
"n": "ChannelDef",
"s": "type ChannelDef struct { NoMemory bool `json:\"no_memory,omitempty\"` Cleaner func(string) string `json:\"-\"` ContextPolicy string `json: …",
"d": "ChannelDef 描述通道在记忆计算层的行为,与 ToolDef.NoMemory/Cleaner 语义一致。",
"k": "type",
"r": "",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 139,
"g": [
"通道",
"频道",
"通道定义"
]
},
{
"n": "Commit",
"s": "Commit(triples []Triple) error",
"d": "",
"k": "method",
"r": "MemoryAPI",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 6,
"g": [
"写入记忆",
"提交三元组"
]
},
{
"n": "ConfigDef",
"s": "type ConfigDef struct { Key string `json:\"key\"` Default interface{} `json:\"default,omitempty\"` Type string `json:\"type\"` DisplayName string …",
"d": "ConfigDef describes a configuration field for the WebUI.",
"k": "type",
"r": "",
"p": "settings",
"b": false,
"f": "settings.go",
"l": 50,
"g": [
"配置项定义"
]
},
{
"n": "ContentBlock",
"s": "type ContentBlock struct { Type string `json:\"type\"` Text string `json:\"text,omitempty\"` ImageURL *ImageURL `json:\"image_url,omitempty\"` AudioURL *AudioURL `jso …",
"d": "ContentBlock 是多模态内容块(OpenAI 格式:text/image_url/audio_url)。",
"k": "type",
"r": "",
"p": "tools",
"b": false,
"f": "plugin.go",
"l": 850,
"g": [
"多模态内容块",
"图片块",
"音频块"
]
},
{
"n": "ContextPolicyNone",
"s": "const ContextPolicyNone",
"d": "上下文策略:决定一次工具调用/输入/注入是否依据其内容裁剪上下文。",
"k": "const",
"r": "",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 44,
"g": [
"策略",
"不裁剪上下文",
"默认裁剪策略"
]
},
{
"n": "ContextPolicyPrune",
"s": "const ContextPolicyPrune",
"d": "上下文策略:决定一次工具调用/输入/注入是否依据其内容裁剪上下文。",
"k": "const",
"r": "",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 45,
"g": [
"策略",
"裁剪上下文",
"归档丢弃"
]
},
{
"n": "CurrentSource",
"s": "CurrentSource() string",
"d": "",
"k": "method",
"r": "LLMAPI",
"p": "llm",
"b": false,
"f": "llm.go",
"l": 7,
"g": [
"当前模型来源"
]
},
{
"n": "DataDir",
"s": "DataDir() string",
"d": "DataDir returns the plugin-specific data directory (guaranteed to exist):",
"k": "method",
"r": "SettingsAPI",
"p": "settings",
"b": false,
"f": "settings.go",
"l": 25,
"g": [
"数据目录"
]
},
{
"n": "Defs",
"s": "Defs(prefix string) []*ConfigDef",
"d": "Defs returns config definitions matching the prefix.",
"k": "method",
"r": "SettingsAPI",
"p": "settings",
"b": false,
"f": "settings.go",
"l": 40,
"g": [
"配置定义列表"
]
},
{
"n": "Doc",
"s": "type Doc struct { ID string `json:\"id\"` Title string `json:\"title\"` Content string `json:\"content\"` Score …",
"d": "Doc represents a document in the document store.",
"k": "type",
"r": "",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 89,
"g": [
"文档",
"文档对象"
]
},
{
"n": "DocMemory",
"s": "func (s *PluginSDK) DocMemory() DocMemoryAPI",
"d": "DocMemory returns the document memory API (may be nil if not available).",
"k": "method",
"r": "PluginSDK",
"p": "memory",
"b": false,
"f": "plugin.go",
"l": 418,
"g": [
"记忆",
"内存",
"文档"
]
},
{
"n": "DocMemoryAPI",
"s": "type DocMemoryAPI interface",
"d": "DocMemoryAPI provides access to the document vector store.",
"k": "interface",
"r": "",
"p": "memory",
"b": false,
"f": "",
"l": 0
},
{
"n": "Dump",
"s": "Dump() map[string]interface{}",
"d": "Dump returns all config values.",
"k": "method",
"r": "SettingsAPI",
"p": "settings",
"b": false,
"f": "settings.go",
"l": 43,
"g": [
"导出配置"
]
},
{
"n": "Entity",
"s": "type Entity struct { Name string `json:\"name\"` Type string `json:\"type\"` MentionCount int `json:\"mention_count\"` }",
"d": "Entity represents a named entity in the knowledge graph.",
"k": "type",
"r": "",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 13,
"g": [
"实体",
"记忆主体"
]
},
{
"n": "Event",
"s": "type Event struct { Type EventType `json:\"type\"` Source string `json:\"source\"` Payload map[string]interface{} `json:\"payload\"` T …",
"d": "Event represents a system event published by the kernel.",
"k": "type",
"r": "",
"p": "events",
"b": false,
"f": "plugin.go",
"l": 265,
"g": [
"事件",
"订阅"
]
},
{
"n": "EventAgentLLMChain",
"s": "const EventAgentLLMChain",
"d": "",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 252,
"g": [
"事件",
"订阅"
]
},
{
"n": "EventAgentOutput",
"s": "const EventAgentOutput",
"d": "",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 251,
"g": [
"事件",
"订阅"
]
},
{
"n": "EventContentDelta",
"s": "const EventContentDelta",
"d": "",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 261,
"g": [
"事件",
"订阅"
]
},
{
"n": "EventHandler",
"s": "type EventHandler func(evt *Event)",
"d": "EventHandler processes a system event.",
"k": "type",
"r": "",
"p": "events",
"b": false,
"f": "plugin.go",
"l": 273,
"g": [
"事件",
"订阅"
]
},
{
"n": "EventRawInput",
"s": "const EventRawInput",
"d": "",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 250,
"g": [
"事件",
"订阅"
]
},
{
"n": "EventReasoning",
"s": "const EventReasoning",
"d": "",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 254,
"g": [
"事件",
"订阅"
]
},
{
"n": "EventReasoningDelta",
"s": "const EventReasoningDelta",
"d": "流式增量事件(token 级):核心 process() 流式化后每收到一个增量块发布。",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 260,
"g": [
"事件",
"订阅"
]
},
{
"n": "EventStage",
"s": "const EventStage",
"d": "",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 255,
"g": [
"事件",
"订阅",
"阶段",
"钩子"
]
},
{
"n": "EventSubscriber",
"s": "type EventSubscriber interface",
"d": "EventSubscriber allows plugins to subscribe to kernel events.",
"k": "interface",
"r": "",
"p": "events",
"b": false,
"f": "",
"l": 0
},
{
"n": "EventSystem",
"s": "const EventSystem",
"d": "",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 256,
"g": [
"事件",
"订阅"
]
},
{
"n": "EventToolCall",
"s": "const EventToolCall",
"d": "",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 253,
"g": [
"事件",
"订阅",
"工具"
]
},
{
"n": "EventType",
"s": "type EventType string",
"d": "EventType identifies the kind of system event.",
"k": "type",
"r": "",
"p": "events",
"b": false,
"f": "plugin.go",
"l": 247,
"g": [
"事件",
"订阅"
]
},
{
"n": "Events",
"s": "func (s *PluginSDK) Events() EventSubscriber",
"d": "Events returns the event subscriber for listening to kernel events (may be nil if not available).",
"k": "method",
"r": "PluginSDK",
"p": "events",
"b": true,
"f": "plugin.go",
"l": 446,
"g": [
"事件",
"订阅",
"事件订阅",
"监听事件"
]
},
{
"n": "Get",
"s": "Get(key string) (interface{}, error)",
"d": "Get reads the plugin's own config value (config_\u003cname\u003e table).",
"k": "method",
"r": "SettingsAPI",
"p": "settings",
"b": false,
"f": "settings.go",
"l": 5,
"g": [
"读取配置"
]
},
{
"n": "GetCore",
"s": "GetCore(key string) (interface{}, error)",
"d": "GetCore reads the core config table.",
"k": "method",
"r": "SettingsAPI",
"p": "settings",
"b": false,
"f": "settings.go",
"l": 14,
"g": [
"读核心配置"
]
},
{
"n": "GetNetwork",
"s": "GetNetwork(name string, depth int) ([]*PersonProfile, error)",
"d": "",
"k": "method",
"r": "SocialAPI",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 104,
"g": [
"查关系网"
]
},
{
"n": "GetPerson",
"s": "GetPerson(name string) (*PersonProfile, error)",
"d": "",
"k": "method",
"r": "SocialAPI",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 101,
"g": [
"查人物"
]
},
{
"n": "GetPlugin",
"s": "GetPlugin(plugin, key string) (interface{}, error)",
"d": "GetPlugin reads another plugin's config table.",
"k": "method",
"r": "SettingsAPI",
"p": "settings",
"b": false,
"f": "settings.go",
"l": 28,
"g": [
"读插件配置"
]
},
{
"n": "GetRelations",
"s": "GetRelations(name string) ([]SocialRelation, error)",
"d": "",
"k": "method",
"r": "SocialAPI",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 103,
"g": [
"查关系"
]
},
{
"n": "GetTrait",
"s": "GetTrait(name, trait string) (string, bool)",
"d": "",
"k": "method",
"r": "SocialAPI",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 102,
"g": [
"查特征"
]
},
{
"n": "IOInjector",
"s": "type IOInjector interface",
"d": "IOInjector provides methods for injecting input and interrupts into the agent pipeline.",
"k": "interface",
"r": "",
"p": "channels",
"b": false,
"f": "",
"l": 0
},
{
"n": "ImageURL",
"s": "type ImageURL struct { URL string `json:\"url\"` Detail string `json:\"detail,omitempty\"` }",
"d": "",
"k": "type",
"r": "",
"p": "misc",
"b": false,
"f": "plugin.go",
"l": 857
},
{
"n": "InjectInputMedia",
"s": "func (s *PluginSDK) InjectInputMedia(source, channel, text string, blocks []ContentBlock)",
"d": "InjectInputMedia 注入带媒体内容块(image_url/audio_url)的输入。",
"k": "method",
"r": "PluginSDK",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 701,
"g": [
"注入输入",
"投喂输入",
"模拟用户输入",
"媒体",
"图片",
"音频"
]
},
{
"n": "InjectInputMedia",
"s": "InjectInputMedia(source, channel, text string, blocks []ContentBlock)",
"d": "",
"k": "method",
"r": "IOInjector",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 230,
"g": [
"注入输入",
"投喂输入",
"模拟用户输入",
"媒体",
"图片",
"音频"
]
},
{
"n": "InjectInputMediaOpts",
"s": "func (s *PluginSDK) InjectInputMediaOpts(source, channel, text string, blocks []ContentBlock, opts InjectOptions)",
"d": "InjectInputMediaOpts 注入带媒体块的输入,并声明记忆/裁剪行为。",
"k": "method",
"r": "PluginSDK",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 740,
"g": [
"注入输入",
"投喂输入",
"模拟用户输入",
"媒体",
"图片",
"音频"
]
},
{
"n": "InjectInputMediaOpts",
"s": "InjectInputMediaOpts(source, channel, text string, blocks []ContentBlock, opts InjectOptions)",
"d": "",
"k": "method",
"r": "IOInjector",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 241,
"g": [
"注入输入",
"投喂输入",
"模拟用户输入",
"媒体",
"图片",
"音频"
]
},
{
"n": "InjectInputMediaSync",
"s": "InjectInputMediaSync(source, channel, text string, blocks []ContentBlock) string",
"d": "",
"k": "method",
"r": "IOInjector",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 231,
"g": [
"注入输入",
"投喂输入",
"模拟用户输入",
"媒体",
"图片",
"音频"
]
},
{
"n": "InjectInputMediaSync",
"s": "func (s *PluginSDK) InjectInputMediaSync(source, channel, text string, blocks []ContentBlock) string",
"d": "InjectInputMediaSync 注入带媒体内容块的输入并同步等待 agent 回复。",
"k": "method",
"r": "PluginSDK",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 707,
"g": [
"注入输入",
"投喂输入",
"模拟用户输入",
"媒体",
"图片",
"音频"
]
},
{
"n": "InjectInputMediaSyncOpts",
"s": "func (s *PluginSDK) InjectInputMediaSyncOpts(source, channel, text string, blocks []ContentBlock, opts InjectOptions) string",
"d": "InjectInputMediaSyncOpts 注入带媒体块的输入并同步等待回复,同时声明记忆/裁剪行为。",
"k": "method",
"r": "PluginSDK",
"p": "channels",
"b": false,
"f": "plugin.go",
"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",
"s": "InjectInputSync(source, channel, text string) string",
"d": "InjectInputSync 注入输入事件并同步等待 agent 回复,返回回复文本(无回复时返回空串)。",
"k": "method",
"r": "IOInjector",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 226,
"g": [
"注入输入",
"投喂输入",
"模拟用户输入"
]
},
{
"n": "InjectInputSync",
"s": "func (s *PluginSDK) InjectInputSync(source, channel, text string) string",
"d": "InjectInputSync injects a text message and synchronously waits for the agent reply,",
"k": "method",
"r": "PluginSDK",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 692,
"g": [
"注入输入",
"投喂输入",
"模拟用户输入"
]
},
{
"n": "InjectInputSyncOpts",
"s": "InjectInputSyncOpts(source, channel, text string, opts InjectOptions) string",
"d": "",
"k": "method",
"r": "IOInjector",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 240,
"g": [
"注入输入",
"投喂输入",
"模拟用户输入"
]
},
{
"n": "InjectInputSyncOpts",
"s": "func (s *PluginSDK) InjectInputSyncOpts(source, channel, text string, opts InjectOptions) string",
"d": "InjectInputSyncOpts 注入输入并同步等待回复,同时在这次注入上声明记忆/裁剪行为。",
"k": "method",
"r": "PluginSDK",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 731,
"g": [
"注入输入",
"投喂输入",
"模拟用户输入"
]
},
{
"n": "InjectInterruptMedia",
"s": "InjectInterruptMedia(source, channel, text string, blocks []ContentBlock)",
"d": "",
"k": "method",
"r": "IOInjector",
"p": "channels",
"b": false,
"f": "plugin.go",
"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",
"s": "func (s *PluginSDK) InjectInterruptMediaOpts(source, channel, text string, blocks []ContentBlock, opts InjectOptions)",
"d": "InjectInterruptMediaOpts 注入带媒体块的中断,并声明记忆/裁剪行为。",
"k": "method",
"r": "PluginSDK",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 756,
"g": [
"中断注入",
"插话",
"打断",
"抢占",
"媒体",
"图片",
"音频"
]
},
{
"n": "InjectInterruptMediaOpts",
"s": "InjectInterruptMediaOpts(source, channel, text string, blocks []ContentBlock, opts InjectOptions)",
"d": "",
"k": "method",
"r": "IOInjector",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 243,
"g": [
"中断注入",
"插话",
"打断",
"抢占",
"媒体",
"图片",
"音频"
]
},
{
"n": "InjectInterruptText",
"s": "func (s *PluginSDK) InjectInterruptText(source, channel, text string)",
"d": "InjectInterruptText injects a text interrupt that can preempt current LLM processing.",
"k": "method",
"r": "PluginSDK",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 673,
"g": [
"中断注入",
"插话",
"打断",
"抢占"
]
},
{
"n": "InjectInterruptText",
"s": "InjectInterruptText(source, channel, text string)",
"d": "",
"k": "method",
"r": "IOInjector",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 221,
"g": [
"中断注入",
"插话",
"打断",
"抢占"
]
},
{
"n": "InjectInterruptTextOpts",
"s": "InjectInterruptTextOpts(source, channel, text string, opts InjectOptions)",
"d": "",
"k": "method",
"r": "IOInjector",
"p": "channels",
"b": false,
"f": "plugin.go",
"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",
"s": "type InjectOptions struct { NoMemory bool ContextPolicy string // RecallPolicy 声明此次注入是否据其内容召回相关记忆。 // 空串 = 默认(输入/注<><E6B3A8> …",
"d": "InjectOptions 声明一次注入行为在记忆层与上下文层的表现。",
"k": "type",
"r": "",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 98,
"g": [
"注入选项",
"是否记入记忆",
"是否裁剪上下文"
]
},
{
"n": "InjectText",
"s": "InjectText(source, channel, text string)",
"d": "",
"k": "method",
"r": "IOInjector",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 222,
"g": [
"注入文本",
"注入消息",
"投喂输入",
"灌入内容"
]
},
{
"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,
"g": [
"注入文本",
"注入消息",
"投喂输入",
"灌入内容"
]
},
{
"n": "InjectTextNoMemory",
"s": "InjectTextNoMemory(source, channel, text string)",
"d": "",
"k": "method",
"r": "IOInjector",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 223,
"g": [
"注入文本",
"注入消息",
"投喂输入",
"灌入内容",
"记忆",
"内存"
]
},
{
"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": 685,
"g": [
"注入文本",
"注入消息",
"投喂输入",
"灌入内容",
"记忆",
"内存"
]
},
{
"n": "InjectTextOpts",
"s": "InjectTextOpts(source, channel, text string, opts InjectOptions)",
"d": "以下 Opts 变体让调用点在**这一次注入**上声明记忆与裁剪行为。",
"k": "method",
"r": "IOInjector",
"p": "channels",
"b": false,
"f": "plugin.go",
"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",
"s": "type InputChannelRegistrar func(name string, def ChannelDef) error",
"d": "InputChannelRegistrar registers an input channel with its memory behavior.",
"k": "type",
"r": "",
"p": "bridge",
"b": false,
"f": "plugin.go",
"l": 314,
"g": [
"通道",
"频道"
]
},
{
"n": "Insert",
"s": "Insert(doc *Doc) error",
"d": "",
"k": "method",
"r": "DocMemoryAPI",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 76,
"g": [
"插入文档"
]
},
{
"n": "InsertWithMedia",
"s": "InsertWithMedia(doc *Doc, attachments []MediaAttachment) error",
"d": "InsertWithMedia 写入文档并关联媒体。attachments 里带 Data 的会落进",
"k": "method",
"r": "DocMemoryAPI",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 81,
"g": [
"媒体",
"图片",
"音频",
"插入带媒体文档"
]
},
{
"n": "Introspect",
"s": "Introspect() (map[string]interface{}, error)",
"d": "",
"k": "method",
"r": "MemoryAPI",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 7,
"g": [
"查看记忆",
"记忆概览"
]
},
{
"n": "IsPluginDisabled",
"s": "IsPluginDisabled(name string) bool",
"d": "IsPluginDisabled 查询插件是否被禁用。",
"k": "method",
"r": "PluginMgrAPI",
"p": "lifecycle",
"b": false,
"f": "plugin.go",
"l": 290,
"g": [
"查插件是否被禁用"
]
},
{
"n": "IsResponded",
"s": "func (c *StageContext) IsResponded() bool",
"d": "",
"k": "method",
"r": "StageContext",
"p": "stages",
"b": false,
"f": "plugin.go",
"l": 172
},
{
"n": "Knowledge",
"s": "type Knowledge struct { Name string `json:\"name\"` Content string `json:\"content\"` }",
"d": "Knowledge represents a knowledge entry.",
"k": "type",
"r": "",
"p": "memory",
"b": false,
"f": "knowledge.go",
"l": 11,
"g": [
"知识库",
"知识"
]
},
{
"n": "Knowledge",
"s": "func (s *PluginSDK) Knowledge() KnowledgeAPI",
"d": "Knowledge returns the knowledge store API (may be nil if not available).",
"k": "method",
"r": "PluginSDK",
"p": "memory",
"b": false,
"f": "plugin.go",
"l": 425,
"g": [
"知识库",
"知识"
]
},
{
"n": "KnowledgeAPI",
"s": "type KnowledgeAPI interface",
"d": "KnowledgeAPI provides access to the knowledge store.",
"k": "interface",
"r": "",
"p": "memory",
"b": false,
"f": "",
"l": 0
},
{
"n": "LLM",
"s": "func (s *PluginSDK) LLM() LLMAPI",
"d": "LLM returns the LLM provider API (may be nil if not available).",
"k": "method",
"r": "PluginSDK",
"p": "llm",
"b": false,
"f": "plugin.go",
"l": 432
},
{
"n": "LLMAPI",
"s": "type LLMAPI interface",
"d": "LLMAPI provides access to the LLM provider manager.",
"k": "interface",
"r": "",
"p": "llm",
"b": false,
"f": "",
"l": 0
},
{
"n": "List",
"s": "List() ([]string, error)",
"d": "",
"k": "method",
"r": "KnowledgeAPI",
"p": "memory",
"b": false,
"f": "knowledge.go",
"l": 7,
"g": [
"列出"
]
},
{
"n": "List",
"s": "List(prefix string) ([]string, error)",
"d": "List returns all keys matching the given prefix.",
"k": "method",
"r": "SettingsAPI",
"p": "settings",
"b": false,
"f": "settings.go",
"l": 11,
"g": [
"列出"
]
},
{
"n": "ListCore",
"s": "ListCore(prefix string) ([]string, error)",
"d": "ListCore lists core config keys matching the prefix.",
"k": "method",
"r": "SettingsAPI",
"p": "settings",
"b": false,
"f": "settings.go",
"l": 20,
"g": [
"列出核心配置"
]
},
{
"n": "ListLoadedPlugins",
"s": "ListLoadedPlugins() []string",
"d": "ListLoadedPlugins 列出已加载插件。",
"k": "method",
"r": "PluginMgrAPI",
"p": "lifecycle",
"b": false,
"f": "plugin.go",
"l": 288,
"g": [
"已加载插件列表"
]
},
{
"n": "ListPersons",
"s": "ListPersons() ([]string, error)",
"d": "",
"k": "method",
"r": "SocialAPI",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 105,
"g": [
"列出人物"
]
},
{
"n": "ListPlugin",
"s": "ListPlugin(plugin, prefix string) ([]string, error)",
"d": "ListPlugin lists another plugin's config keys matching the prefix.",
"k": "method",
"r": "SettingsAPI",
"p": "settings",
"b": false,
"f": "settings.go",
"l": 34,
"g": [
"列出插件配置"
]
},
{
"n": "ListSources",
"s": "ListSources() []string",
"d": "",
"k": "method",
"r": "LLMAPI",
"p": "llm",
"b": false,
"f": "llm.go",
"l": 5,
"g": [
"列出模型来源"
]
},
{
"n": "Lock",
"s": "func (c *StageContext) Lock()",
"d": "",
"k": "method",
"r": "StageContext",
"p": "stages",
"b": false,
"f": "plugin.go",
"l": 170
},
{
"n": "MediaAttachment",
"s": "type MediaAttachment struct { Digest string `json:\"digest,omitempty\"` MIME string `json:\"mime,omitempty\"` Data []byte `json:\"data,omitempty\"` Name string `json:\"name,omite …",
"d": "TextEvent represents a single text memory event.",
"k": "type",
"r": "",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 58,
"g": [
"媒体",
"图片",
"音频",
"媒体附件"
]
},
{
"n": "MemItem",
"s": "type MemItem struct { Role string `json:\"role\"` Content string `json:\"content\"` Score float64 `json:\"score\"` }",
"d": "MemItem represents a memory item in stage context.",
"k": "type",
"r": "",
"p": "misc",
"b": false,
"f": "plugin.go",
"l": 179
},
{
"n": "Memory",
"s": "func (s *PluginSDK) Memory() MemoryAPI",
"d": "Memory returns the graph memory API (may be nil if not available).",
"k": "method",
"r": "PluginSDK",
"p": "memory",
"b": false,
"f": "plugin.go",
"l": 404,
"g": [
"记忆",
"内存"
]
},
{
"n": "MemoryAPI",
"s": "type MemoryAPI interface",
"d": "MemoryAPI provides access to the graph memory (entity-relation store).",
"k": "interface",
"r": "",
"p": "memory",
"b": false,
"f": "",
"l": 0
},
{
"n": "MergeEntities",
"s": "MergeEntities(source, target string) (int, error)",
"d": "",
"k": "method",
"r": "MemoryAPI",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 8,
"g": [
"合并实体"
]
},
{
"n": "Name",
"s": "Name() string",
"d": "",
"k": "method",
"r": "Plugin",
"p": "lifecycle",
"b": false,
"f": "plugin.go",
"l": 14,
"g": [
"名称"
]
},
{
"n": "OutputChannelRegistrar",
"s": "type OutputChannelRegistrar func(name string, caps int, desc string, def ChannelDef, handler ToolHandler) error",
"d": "OutputChannelRegistrar registers an output channel that the output_send tool can use.",
"k": "type",
"r": "",
"p": "bridge",
"b": false,
"f": "plugin.go",
"l": 317,
"g": [
"通道",
"频道"
]
},
{
"n": "OutputChannelUnregistrar",
"s": "type OutputChannelUnregistrar func(name string) error",
"d": "OutputChannelUnregistrar 注销一个输出通道。",
"k": "type",
"r": "",
"p": "bridge",
"b": false,
"f": "plugin.go",
"l": 324,
"g": [
"通道",
"频道"
]
},
{
"n": "PersonProfile",
"s": "type PersonProfile struct { Name string `json:\"name\"` Traits map[string]string `json:\"traits,omitempty\"` Relations []SocialRelation `json:\"relations,omitemp …",
"d": "PersonProfile represents a person's complete profile (traits + social relations).",
"k": "type",
"r": "",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 109,
"g": [
"人物画像"
]
},
{
"n": "Plugin",
"s": "type Plugin interface",
"d": "Plugin is the interface every plugin must implement.",
"k": "interface",
"r": "",
"p": "lifecycle",
"b": false,
"f": "",
"l": 0
},
{
"n": "PluginMgr",
"s": "func (s *PluginSDK) PluginMgr() PluginMgrAPI",
"d": "PluginMgr returns the plugin manager API (ReloadOne / ReloadPlugins / list).",
"k": "method",
"r": "PluginSDK",
"p": "lifecycle",
"b": false,
"f": "plugin.go",
"l": 653,
"g": [
"插件管理",
"重载插件",
"禁用插件",
"插件管理器"
]
},
{
"n": "PluginMgrAPI",
"s": "type PluginMgrAPI interface",
"d": "PluginMgrAPI 提供插件管理能力(外部插件可调用)。",
"k": "interface",
"r": "",
"p": "lifecycle",
"b": false,
"f": "",
"l": 0
},
{
"n": "PluginName",
"s": "func (s *PluginSDK) PluginName() string",
"d": "PluginName returns the name of the plugin.",
"k": "method",
"r": "PluginSDK",
"p": "lifecycle",
"b": false,
"f": "plugin.go",
"l": 397,
"g": [
"插件名"
]
},
{
"n": "PluginSDK",
"s": "type PluginSDK struct { name string regTool ToolRegistrar regStage StageRegistrar regAPI APIRegistrar regOutput OutputChannelRegistrar …",
"d": "PluginSDK is the main API surface provided to plugins at runtime.",
"k": "type",
"r": "",
"p": "misc",
"b": false,
"f": "plugin.go",
"l": 337
},
{
"n": "Plugins",
"s": "Plugins() []string",
"d": "Plugins returns a list of all plugin config namespaces.",
"k": "method",
"r": "SettingsAPI",
"p": "settings",
"b": false,
"f": "settings.go",
"l": 46,
"g": [
"插件配置"
]
},
{
"n": "PriorityL1",
"s": "const PriorityL1",
"d": "中断优先级取值。",
"k": "const",
"r": "",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 123,
"g": [
"优先级",
"中断级别"
]
},
{
"n": "PriorityL2",
"s": "const PriorityL2",
"d": "中断优先级取值。",
"k": "const",
"r": "",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 124,
"g": [
"优先级",
"中断级别"
]
},
{
"n": "PriorityL3",
"s": "const PriorityL3",
"d": "中断优先级取值。",
"k": "const",
"r": "",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 125,
"g": [
"优先级",
"中断级别"
]
},
{
"n": "PriorityL4",
"s": "const PriorityL4",
"d": "PriorityL4 仅内核级(内置)插件可用;外部插件声明会被夹到 L3。",
"k": "const",
"r": "",
"p": "channels",
"b": true,
"f": "plugin.go",
"l": 127,
"g": [
"优先级",
"中断级别"
]
},
{
"n": "Purge",
"s": "Purge(criteria map[string]string, mode string) (int, error)",
"d": "",
"k": "method",
"r": "MemoryAPI",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 9,
"g": [
"清除",
"删除记忆",
"清除记忆"
]
},
{
"n": "Query",
"s": "Query(text string, topK int) []*Doc",
"d": "",
"k": "method",
"r": "DocMemoryAPI",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 75,
"g": [
"查询文档"
]
},
{
"n": "RLock",
"s": "func (c *StageContext) RLock()",
"d": "",
"k": "method",
"r": "StageContext",
"p": "stages",
"b": false,
"f": "plugin.go",
"l": 168
},
{
"n": "RUnlock",
"s": "func (c *StageContext) RUnlock()",
"d": "",
"k": "method",
"r": "StageContext",
"p": "stages",
"b": false,
"f": "plugin.go",
"l": 169
},
{
"n": "Recall",
"s": "Recall(query []string, depth int) ([]Entity, []Relation, error)",
"d": "",
"k": "method",
"r": "MemoryAPI",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 5,
"g": [
"召回",
"检索记忆",
"召回记忆",
"查记忆"
]
},
{
"n": "RecallPolicyAuto",
"s": "const RecallPolicyAuto",
"d": "召回策略:决定一次工具调用/输入/注入是否据其内容**召回**(注入)相关记忆。",
"k": "const",
"r": "",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 65,
"g": [
"策略",
"召回",
"检索记忆",
"自动召回",
"默认召回"
]
},
{
"n": "RecallPolicyNone",
"s": "const RecallPolicyNone",
"d": "召回策略:决定一次工具调用/输入/注入是否据其内容**召回**(注入)相关记忆。",
"k": "const",
"r": "",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 64,
"g": [
"策略",
"召回",
"检索记忆",
"不召回",
"关闭召回"
]
},
{
"n": "RegisterDef",
"s": "RegisterDef(def ConfigDef)",
"d": "RegisterDef registers a config definition for UI display.",
"k": "method",
"r": "SettingsAPI",
"p": "settings",
"b": false,
"f": "settings.go",
"l": 37,
"g": [
"注册配置项",
"声明配置",
"配置定义"
]
},
{
"n": "RegisterInputChannel",
"s": "func (s *PluginSDK) RegisterInputChannel(name string, def ChannelDef) error",
"d": "RegisterInputChannel registers an input channel with its memory behavior.",
"k": "method",
"r": "PluginSDK",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 561,
"g": [
"注册输入通道",
"收消息",
"接收消息",
"外部消息源",
"通道",
"频道"
]
},
{
"n": "RegisterOnRemoveHandler",
"s": "func (s *PluginSDK) RegisterOnRemoveHandler(fn func())",
"d": "RegisterOnRemoveHandler 注册插件被删除(卸载)时的清理回调。",
"k": "method",
"r": "PluginSDK",
"p": "lifecycle",
"b": false,
"f": "plugin.go",
"l": 826,
"g": [
"卸载回调",
"删除清理",
"插件卸载",
"onRemove"
]
},
{
"n": "RegisterOutputChannel",
"s": "func (s *PluginSDK) RegisterOutputChannel(name string, caps int, desc string, def ChannelDef, handler ToolHandler) error",
"d": "RegisterOutputChannel registers an output channel that the output_send tool can route to.",
"k": "method",
"r": "PluginSDK",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 528,
"g": [
"注册输出通道",
"发消息",
"投递消息",
"输出目的地",
"通道",
"频道"
]
},
{
"n": "RegisterPluginAPI",
"s": "func (s *PluginSDK) RegisterPluginAPI(name string) error",
"d": "RegisterPluginAPI registers this plugin's API for access by other plugins.",
"k": "method",
"r": "PluginSDK",
"p": "lifecycle",
"b": false,
"f": "plugin.go",
"l": 502,
"g": [
"注册插件接口",
"暴露接口"
]
},
{
"n": "RegisterStage",
"s": "func (s *PluginSDK) RegisterStage(stage Stage, handler StageHandler, scope ...StageScope)",
"d": "RegisterStage registers a handler for a pipeline stage.",
"k": "method",
"r": "PluginSDK",
"p": "stages",
"b": false,
"f": "plugin.go",
"l": 467,
"g": [
"注册阶段",
"阶段钩子",
"挂钩子",
"干预流程",
"管道钩子",
"阶段",
"钩子"
]
},
{
"n": "RegisterStopHandler",
"s": "func (s *PluginSDK) RegisterStopHandler(fn func())",
"d": "RegisterStopHandler 注册插件停止阶段的清理回调。",
"k": "method",
"r": "PluginSDK",
"p": "lifecycle",
"b": false,
"f": "plugin.go",
"l": 801,
"g": [
"停止回调",
"关闭清理",
"插件停止"
]
},
{
"n": "RegisterTool",
"s": "func (s *PluginSDK) RegisterTool(name string, def ToolDef, handler ToolHandler) error",
"d": "RegisterTool registers a tool that the LLM can call.",
"k": "method",
"r": "PluginSDK",
"p": "tools",
"b": false,
"f": "plugin.go",
"l": 453,
"g": [
"注册工具",
"添加工具",
"暴露工具",
"工具定义",
"让模型调用",
"工具",
"怎么注册工具",
"工具怎么加",
"自定义工具"
]
},
{
"n": "Relation",
"s": "type Relation struct { SourceName string `json:\"source_name\"` TargetName string `json:\"target_name\"` RelationType string `json:\"relation_type\"` Confidence float6 …",
"d": "Relation represents a relationship between two entities.",
"k": "type",
"r": "",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 20,
"g": [
"关系",
"三元组关系"
]
},
{
"n": "ReloadOne",
"s": "ReloadOne(name string) error",
"d": "ReloadOne 重载单个插件(停止后重新加载)。",
"k": "method",
"r": "PluginMgrAPI",
"p": "lifecycle",
"b": false,
"f": "plugin.go",
"l": 286,
"g": [
"重载单个插件"
]
},
{
"n": "Remove",
"s": "Remove(id string)",
"d": "",
"k": "method",
"r": "DocMemoryAPI",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 82,
"g": [
"删除文档"
]
},
{
"n": "RunOnRemoveHandlers",
"s": "func (s *PluginSDK) RunOnRemoveHandlers()",
"d": "RunOnRemoveHandlers 执行全部已注册的 onRemove handler(后注册先执行,执行后清空,幂等)。",
"k": "method",
"r": "PluginSDK",
"p": "lifecycle",
"b": false,
"f": "plugin.go",
"l": 837
},
{
"n": "RunStopHandlers",
"s": "func (s *PluginSDK) RunStopHandlers()",
"d": "RunStopHandlers 执行全部已注册的 stop handler(后注册先执行,执行后清空,幂等)。",
"k": "method",
"r": "PluginSDK",
"p": "lifecycle",
"b": false,
"f": "plugin.go",
"l": 812
},
{
"n": "SDKVersion",
"s": "var SDKVersion",
"d": "SDKVersion 是对外暴露的 SDK 版本号。",
"k": "var",
"r": "",
"p": "misc",
"b": false,
"f": "plugin.go",
"l": 10,
"g": [
"SDK 版本"
]
},
{
"n": "Search",
"s": "Search(query string, topK int) ([]*Knowledge, error)",
"d": "",
"k": "method",
"r": "KnowledgeAPI",
"p": "memory",
"b": false,
"f": "knowledge.go",
"l": 5,
"g": [
"搜索知识"
]
},
{
"n": "Set",
"s": "Set(key string, value interface{}) error",
"d": "Set writes a config value to the plugin's own config table.",
"k": "method",
"r": "SettingsAPI",
"p": "settings",
"b": false,
"f": "settings.go",
"l": 8,
"g": [
"设置",
"装配",
"写入配置"
]
},
{
"n": "SetAutoRestart",
"s": "func (s *PluginSDK) SetAutoRestart(enabled bool)",
"d": "SetAutoRestart 设置插件崩溃后内核是否自动重启它。",
"k": "method",
"r": "PluginSDK",
"p": "lifecycle",
"b": false,
"f": "plugin.go",
"l": 784,
"g": [
"设置",
"装配",
"自动重启",
"崩溃自愈",
"故障恢复",
"崩溃后重启",
"是否自动重启"
]
},
{
"n": "SetCore",
"s": "SetCore(key string, value interface{}) error",
"d": "SetCore writes to the core config table.",
"k": "method",
"r": "SettingsAPI",
"p": "settings",
"b": false,
"f": "settings.go",
"l": 17,
"g": [
"设置",
"装配",
"写核心配置"
]
},
{
"n": "SetDocMemoryAPI",
"s": "func (s *PluginSDK) SetDocMemoryAPI(dm DocMemoryAPI)",
"d": "",
"k": "method",
"r": "PluginSDK",
"p": "bridge",
"b": false,
"f": "plugin.go",
"l": 614,
"g": [
"设置",
"装配",
"记忆",
"内存",
"文档"
]
},
{
"n": "SetEventSubscriber",
"s": "func (s *PluginSDK) SetEventSubscriber(es EventSubscriber)",
"d": "",
"k": "method",
"r": "PluginSDK",
"p": "bridge",
"b": true,
"f": "plugin.go",
"l": 638,
"g": [
"设置",
"装配",
"事件",
"订阅"
]
},
{
"n": "SetIOInjector",
"s": "func (s *PluginSDK) SetIOInjector(io IOInjector)",
"d": "SetIOInjector sets the IO injector (called by the core at startup).",
"k": "method",
"r": "PluginSDK",
"p": "bridge",
"b": false,
"f": "plugin.go",
"l": 595,
"g": [
"设置",
"装配"
]
},
{
"n": "SetInputChannelRegistrar",
"s": "func (s *PluginSDK) SetInputChannelRegistrar(r InputChannelRegistrar)",
"d": "SetInputChannelRegistrar sets the input channel registrar (called by the core at startup).",
"k": "method",
"r": "PluginSDK",
"p": "bridge",
"b": false,
"f": "plugin.go",
"l": 588,
"g": [
"设置",
"装配",
"通道",
"频道"
]
},
{
"n": "SetKnowledgeAPI",
"s": "func (s *PluginSDK) SetKnowledgeAPI(kn KnowledgeAPI)",
"d": "",
"k": "method",
"r": "PluginSDK",
"p": "bridge",
"b": false,
"f": "plugin.go",
"l": 620,
"g": [
"设置",
"装配",
"知识库",
"知识"
]
},
{
"n": "SetLLMAPI",
"s": "func (s *PluginSDK) SetLLMAPI(llm LLMAPI)",
"d": "",
"k": "method",
"r": "PluginSDK",
"p": "bridge",
"b": false,
"f": "plugin.go",
"l": 626,
"g": [
"设置",
"装配"
]
},
{
"n": "SetMemoryAPI",
"s": "func (s *PluginSDK) SetMemoryAPI(mem MemoryAPI)",
"d": "SetMemoryAPI sets the memory API (called by the core at startup).",
"k": "method",
"r": "PluginSDK",
"p": "bridge",
"b": false,
"f": "plugin.go",
"l": 602,
"g": [
"设置",
"装配",
"记忆",
"内存"
]
},
{
"n": "SetOutputChannelRegistrar",
"s": "func (s *PluginSDK) SetOutputChannelRegistrar(r OutputChannelRegistrar)",
"d": "SetOutputChannelRegistrar sets the output channel registrar (called by the core at startup).",
"k": "method",
"r": "PluginSDK",
"p": "bridge",
"b": false,
"f": "plugin.go",
"l": 574,
"g": [
"设置",
"装配",
"通道",
"频道"
]
},
{
"n": "SetOutputChannelUnregistrar",
"s": "func (s *PluginSDK) SetOutputChannelUnregistrar(r OutputChannelUnregistrar)",
"d": "SetOutputChannelUnregistrar sets the output channel unregistrar (called by the core at startup).",
"k": "method",
"r": "PluginSDK",
"p": "bridge",
"b": true,
"f": "plugin.go",
"l": 581,
"g": [
"设置",
"装配",
"通道",
"频道"
]
},
{
"n": "SetPlugin",
"s": "SetPlugin(plugin, key string, value interface{}) error",
"d": "SetPlugin writes to another plugin's config table.",
"k": "method",
"r": "SettingsAPI",
"p": "settings",
"b": false,
"f": "settings.go",
"l": 31,
"g": [
"设置",
"装配",
"写插件配置"
]
},
{
"n": "SetPluginMgrAPI",
"s": "func (s *PluginSDK) SetPluginMgrAPI(pm PluginMgrAPI)",
"d": "SetPluginMgrAPI sets the plugin manager API (called by the bridge at startup).",
"k": "method",
"r": "PluginSDK",
"p": "bridge",
"b": false,
"f": "plugin.go",
"l": 645,
"g": [
"设置",
"装配",
"插件管理",
"重载插件",
"禁用插件"
]
},
{
"n": "SetSocialAPI",
"s": "func (s *PluginSDK) SetSocialAPI(social SocialAPI)",
"d": "",
"k": "method",
"r": "PluginSDK",
"p": "bridge",
"b": false,
"f": "plugin.go",
"l": 632,
"g": [
"设置",
"装配",
"社交",
"关系",
"联系人"
]
},
{
"n": "SetSource",
"s": "SetSource(name string) error",
"d": "",
"k": "method",
"r": "LLMAPI",
"p": "llm",
"b": false,
"f": "llm.go",
"l": 6,
"g": [
"设置",
"装配",
"切换模型"
]
},
{
"n": "SetTextMemoryAPI",
"s": "func (s *PluginSDK) SetTextMemoryAPI(tm TextMemoryAPI)",
"d": "",
"k": "method",
"r": "PluginSDK",
"p": "bridge",
"b": false,
"f": "plugin.go",
"l": 608,
"g": [
"设置",
"装配",
"记忆",
"内存"
]
},
{
"n": "SetToolBlocks",
"s": "func (s *PluginSDK) SetToolBlocks(blocks []ContentBlock)",
"d": "SetToolBlocks 在工具处理函数内注入多模态内容块,内核在下一条 tool message",
"k": "method",
"r": "PluginSDK",
"p": "channels",
"b": false,
"f": "plugin.go",
"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",
"s": "func (s *PluginSDK) Settings() SettingsAPI",
"d": "Settings returns the settings API for reading/writing plugin configuration.",
"k": "method",
"r": "PluginSDK",
"p": "settings",
"b": false,
"f": "plugin.go",
"l": 401,
"g": [
"设置",
"装配"
]
},
{
"n": "SettingsAPI",
"s": "type SettingsAPI interface",
"d": "",
"k": "interface",
"r": "",
"p": "settings",
"b": false,
"f": "",
"l": 0
},
{
"n": "Social",
"s": "func (s *PluginSDK) Social() SocialAPI",
"d": "Social returns the social graph API (may be nil if not available).",
"k": "method",
"r": "PluginSDK",
"p": "memory",
"b": false,
"f": "plugin.go",
"l": 439,
"g": [
"社交",
"关系",
"联系人"
]
},
{
"n": "SocialAPI",
"s": "type SocialAPI interface",
"d": "SocialAPI provides read-only access to the social graph (person profiles and relationships).",
"k": "interface",
"r": "",
"p": "memory",
"b": false,
"f": "",
"l": 0
},
{
"n": "SocialRelation",
"s": "type SocialRelation struct { Person string `json:\"person\"` Relation string `json:\"relation\"` }",
"d": "SocialRelation represents a social relationship between two persons.",
"k": "type",
"r": "",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 116,
"g": [
"社交",
"关系",
"联系人",
"社交关系"
]
},
{
"n": "Stage",
"s": "type Stage string",
"d": "Stage represents a point in the message processing pipeline.",
"k": "type",
"r": "",
"p": "stages",
"b": false,
"f": "plugin.go",
"l": 26,
"g": [
"阶段",
"钩子",
"阶段名",
"管线阶段"
]
},
{
"n": "StageAfterOutput",
"s": "const StageAfterOutput",
"d": "",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 35,
"g": [
"阶段",
"钩子"
]
},
{
"n": "StageAfterToolcall",
"s": "const StageAfterToolcall",
"d": "",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 33,
"g": [
"阶段",
"钩子",
"工具"
]
},
{
"n": "StageBeforeOutput",
"s": "const StageBeforeOutput",
"d": "",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 34,
"g": [
"阶段",
"钩子"
]
},
{
"n": "StageBeforeToolcall",
"s": "const StageBeforeToolcall",
"d": "",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 32,
"g": [
"阶段",
"钩子",
"工具"
]
},
{
"n": "StageContext",
"s": "type StageContext struct { mu sync.RWMutex RawMessage string UserID string GroupID string ContextMsgs []map[string]interface{} L …",
"d": "StageContext provides context for stage handlers.",
"k": "type",
"r": "",
"p": "stages",
"b": false,
"f": "plugin.go",
"l": 148,
"g": [
"阶段",
"钩子",
"阶段上下文",
"读写消息"
]
},
{
"n": "StageHandler",
"s": "type StageHandler func(ctx *StageContext) error",
"d": "StageHandler is a function that handles a pipeline stage event.",
"k": "type",
"r": "",
"p": "stages",
"b": false,
"f": "plugin.go",
"l": 23,
"g": [
"阶段",
"钩子",
"阶段处理函数"
]
},
{
"n": "StageOnInput",
"s": "const StageOnInput",
"d": "",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 29,
"g": [
"阶段",
"钩子"
]
},
{
"n": "StagePostAction",
"s": "const StagePostAction",
"d": "",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 31,
"g": [
"阶段",
"钩子"
]
},
{
"n": "StagePreAction",
"s": "const StagePreAction",
"d": "",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 30,
"g": [
"阶段",
"钩子"
]
},
{
"n": "StageRegistrar",
"s": "type StageRegistrar func(stage Stage, handler StageHandler)",
"d": "StageRegistrar registers a stage handler.",
"k": "type",
"r": "",
"p": "stages",
"b": false,
"f": "plugin.go",
"l": 308,
"g": [
"阶段",
"钩子"
]
},
{
"n": "StageScope",
"s": "type StageScope int",
"d": "StageScope controls which events a stage handler receives.",
"k": "type",
"r": "",
"p": "stages",
"b": false,
"f": "plugin.go",
"l": 294,
"g": [
"阶段",
"钩子",
"阶段作用域",
"只看自己的调用"
]
},
{
"n": "StageScopeGlobal",
"s": "const StageScopeGlobal",
"d": "StageScopeGlobal receives all stage events (default).",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 298,
"g": [
"阶段",
"钩子"
]
},
{
"n": "StageScopeOwnTools",
"s": "const StageScopeOwnTools",
"d": "StageScopeOwnTools only receives events for this plugin's own tool calls",
"k": "const",
"r": "",
"p": "constants",
"b": false,
"f": "plugin.go",
"l": 301,
"g": [
"阶段",
"钩子",
"工具"
]
},
{
"n": "Start",
"s": "Start(sdk *PluginSDK) error",
"d": "",
"k": "method",
"r": "Plugin",
"p": "lifecycle",
"b": false,
"f": "plugin.go",
"l": 15,
"g": [
"启动"
]
},
{
"n": "Stats",
"s": "Stats() map[string]interface{}",
"d": "",
"k": "method",
"r": "DocMemoryAPI",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 83,
"g": [
"统计"
]
},
{
"n": "Stop",
"s": "Stop() error",
"d": "",
"k": "method",
"r": "Plugin",
"p": "lifecycle",
"b": false,
"f": "plugin.go",
"l": 16,
"g": [
"停止",
"关闭"
]
},
{
"n": "Subscribe",
"s": "Subscribe(eventType EventType, handler EventHandler) func()",
"d": "",
"k": "method",
"r": "EventSubscriber",
"p": "events",
"b": true,
"f": "plugin.go",
"l": 279
},
{
"n": "TextEvent",
"s": "type TextEvent struct { Role string `json:\"role\"` Content string `json:\"content\"` Timestamp int64 `json:\"timestamp\"` Channel …",
"d": "",
"k": "type",
"r": "",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 65,
"g": [
"事件",
"订阅"
]
},
{
"n": "TextMemory",
"s": "func (s *PluginSDK) TextMemory() TextMemoryAPI",
"d": "TextMemory returns the text memory API (may be nil if not available).",
"k": "method",
"r": "PluginSDK",
"p": "memory",
"b": false,
"f": "plugin.go",
"l": 411,
"g": [
"记忆",
"内存"
]
},
{
"n": "TextMemoryAPI",
"s": "type TextMemoryAPI interface",
"d": "TextMemoryAPI provides access to chronological text event storage.",
"k": "interface",
"r": "",
"p": "memory",
"b": false,
"f": "",
"l": 0
},
{
"n": "ToolCall",
"s": "type ToolCall struct { ID string `json:\"id\"` Name string `json:\"name\"` Plugin string `json:\"plugin,omitempty …",
"d": "ToolCall represents a model's request to call a tool.",
"k": "type",
"r": "",
"p": "tools",
"b": false,
"f": "plugin.go",
"l": 186,
"g": [
"工具",
"工具调用"
]
},
{
"n": "ToolDef",
"s": "type ToolDef struct { Name string `json:\"name\"` Plugin string `json:\"plugin,omitempty\"` Description string …",
"d": "ToolDef describes a tool that the plugin exposes.",
"k": "type",
"r": "",
"p": "tools",
"b": false,
"f": "plugin.go",
"l": 203,
"g": [
"工具",
"工具定义",
"工具描述",
"参数表"
]
},
{
"n": "ToolHandler",
"s": "type ToolHandler func(args map[string]interface{}) (interface{}, error)",
"d": "ToolHandler is a function that handles a tool call.",
"k": "type",
"r": "",
"p": "tools",
"b": false,
"f": "plugin.go",
"l": 20,
"g": [
"工具",
"工具实现",
"处理函数"
]
},
{
"n": "ToolRegistrar",
"s": "type ToolRegistrar func(name string, def ToolDef, handler ToolHandler) error",
"d": "ToolRegistrar registers a tool dynamically.",
"k": "type",
"r": "",
"p": "bridge",
"b": false,
"f": "plugin.go",
"l": 305,
"g": [
"工具"
]
},
{
"n": "ToolResult",
"s": "type ToolResult struct { CallID string `json:\"call_id\"` Name string `json:\"name\"` Plugin string `json:\"plugin,omitempty\"` Success bool `json:\"suc …",
"d": "ToolResult represents the result of a tool call.",
"k": "type",
"r": "",
"p": "tools",
"b": false,
"f": "plugin.go",
"l": 194,
"g": [
"工具",
"工具结果",
"返回值"
]
},
{
"n": "Triple",
"s": "type Triple struct { Subject string `json:\"subject\"` Relation string `json:\"relation\"` Object string `json:\"object\"` Confidence float64 `json:\"c …",
"d": "Triple represents a subject-relation-object triple for the knowledge graph.",
"k": "type",
"r": "",
"p": "memory",
"b": false,
"f": "memory.go",
"l": 31,
"g": [
"三元组"
]
},
{
"n": "Unlock",
"s": "func (c *StageContext) Unlock()",
"d": "",
"k": "method",
"r": "StageContext",
"p": "stages",
"b": false,
"f": "plugin.go",
"l": 171
},
{
"n": "UnregisterOutputChannel",
"s": "func (s *PluginSDK) UnregisterOutputChannel(name string) error",
"d": "UnregisterOutputChannel 注销一个输出通道(动态通道随资源生灭时必须调用)。",
"k": "method",
"r": "PluginSDK",
"p": "misc",
"b": true,
"f": "plugin.go",
"l": 539,
"g": [
"通道",
"频道",
"注销输出通道",
"删除通道"
]
},
{
"n": "ValidContextPolicy",
"s": "func ValidContextPolicy(policy string) bool",
"d": "ValidContextPolicy 校验策略取值;空串等价于 ContextPolicyNone。",
"k": "func",
"r": "",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 49,
"g": [
"策略",
"校验裁剪策略"
]
},
{
"n": "ValidRecallPolicy",
"s": "func ValidRecallPolicy(policy string) bool",
"d": "ValidRecallPolicy 校验召回策略取值;空串按调用面取默认值。",
"k": "func",
"r": "",
"p": "channels",
"b": false,
"f": "plugin.go",
"l": 69,
"g": [
"策略",
"召回",
"检索记忆",
"校验召回策略"
]
}
]