mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-09-25 03:18:08 +00:00
docs: 恢复内置插件中断投递 API 文档
PLUGIN_DEV.md 第二节保留公开 API (InjectText/InjectInterruptText/InjectTextNoMemory), 第四节新增"输入投递(内置插件)"小节展示 InjectInput/InjectInterrupt/InjectInputSync 等 内置插件专属方法,附注说明区分外部与内置插件 API 边界。
This commit is contained in:
@ -349,6 +349,26 @@ s.UnregisterChannel("mydevice")
|
||||
channels := s.ListChannels()
|
||||
```
|
||||
|
||||
#### Input Delivery (built-in plugins)
|
||||
|
||||
```go
|
||||
// Queued delivery (processed in order)
|
||||
s.InjectInput(source, channel, eventType string, payload map[string]interface{})
|
||||
|
||||
// Synchronous delivery (waits for response)
|
||||
resp := s.InjectInputSync(source, channel, eventType string, payload map[string]interface{})
|
||||
|
||||
// Interrupt delivery (can preempt current LLM processing)
|
||||
s.InjectInterrupt(source, channel, eventType string, payload map[string]interface{})
|
||||
|
||||
// Synchronous text shortcuts
|
||||
resp := s.InjectTextSync(source, channel, text string)
|
||||
resp := s.InjectTextSyncNoMemory(source, channel, text string)
|
||||
|
||||
// Get output channel
|
||||
outputCh := s.OutputChan()
|
||||
```
|
||||
|
||||
> **Note**: `Subscribe`, `Publish`, `RegisterChannel`, `UnregisterChannel`, `ListChannels`, `InjectInput`, `InjectInputSync`, `InjectInterrupt`, `InjectTextSync`, `InjectTextSyncNoMemory`, `OutputChan` are only available in built-in plugins (`internal/sdk` package). External dynamic plugins should use the public APIs: `InjectText`, `InjectInterruptText`, `InjectTextNoMemory`.
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user