docs: update output channel interface (payload/meta/type) in SDK docs

This commit is contained in:
root
2026-07-19 10:35:25 +08:00
parent bf08764c29
commit d38d42e57f
3 changed files with 30 additions and 2 deletions

View File

@ -53,6 +53,11 @@ sdk.RegisterStage(StageBeforeToolcall, myHandler, StageScopeOwnTools)
sdk.RegisterOutputChannel("my-channel", CapText|CapFile, "channel description", handler)
```
The handler receives three arguments:
- `payload` (string) — message content. For `type=text` it's plain text, for `type=file/image` it's a URL
- `meta` (string) — optional JSON routing metadata (e.g. `{"group_id":123,"user_id":456}`)
- `type` (string) — content type enum (see below)
Capability flags:
| Flag | Value | Description |
@ -63,6 +68,15 @@ Capability flags:
| `CapAudio` | 8 | Audio output |
| `CapStructured` | 16 | Structured data output |
Type enum values:
| Value | Description |
|-------|-------------|
| `text` | plain text |
| `voice` / `audio` | audio/voice |
| `image` | image |
| `file` | file |
### IOInjector Channel Routing
| Method | Description |