From cd3a4e1d1e52ba6f62742aa9369dc8adcaa178d0 Mon Sep 17 00:00:00 2001 From: Hoshina Date: Sun, 1 Mar 2026 22:20:57 +0800 Subject: [PATCH] docs: fix review feedback from PR #916 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove Feishu from webhook channel list in README.md and README.zh.md; add clarifying note that Feishu uses WebSocket/SDK mode instead - Replace Chinese text in README.vi.md header with Vietnamese equivalent - Translate mixed-language WeCom note in README.vi.md to full Vietnamese - Mark webhook_path as optional (否) in docs/channels/line/README.zh.md - Remove incorrect yaml struct tags from new-channel example in pkg/channels/README.md and README.zh.md (config uses json tags only) - Fix multi-mode initChannel example to use whatsapp/whatsapp_native (matching the "WhatsApp Bridge vs Native" comment) instead of matrix - Correct ReasoningChannelID description: list the 12 channels that have the field and note that PicoConfig does not expose it --- README.md | 2 +- README.vi.md | 4 ++-- README.zh.md | 2 +- docs/channels/line/README.zh.md | 2 +- pkg/channels/README.md | 22 +++++++++++----------- pkg/channels/README.zh.md | 22 +++++++++++----------- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index fd73f2338..2a253401e 100644 --- a/README.md +++ b/README.md @@ -295,7 +295,7 @@ That's it! You have a working AI assistant in 2 minutes. Talk to your picoclaw through Telegram, Discord, WhatsApp, DingTalk, LINE, or WeCom -> **Note**: All webhook-based channels (LINE, WeCom, Feishu, etc.) are served on a single shared Gateway HTTP server (`gateway.host`:`gateway.port`, default `127.0.0.1:18790`). There are no per-channel ports to configure. +> **Note**: All webhook-based channels (LINE, WeCom, etc.) are served on a single shared Gateway HTTP server (`gateway.host`:`gateway.port`, default `127.0.0.1:18790`). There are no per-channel ports to configure. Note: Feishu uses WebSocket/SDK mode and does not use the shared HTTP webhook server. | Channel | Setup | | ------------ | ---------------------------------- | diff --git a/README.vi.md b/README.vi.md index 9aae23503..bfbacb0f4 100644 --- a/README.vi.md +++ b/README.vi.md @@ -3,7 +3,7 @@

PicoClaw: Trợ lý AI Siêu Nhẹ viết bằng Go

-

Phần cứng $10 · RAM 10MB · Khởi động 1 giây · 皮皮虾,我们走!

+

Phần cứng $10 · RAM 10MB · Khởi động 1 giây · Nào, xuất phát!

Go @@ -488,7 +488,7 @@ Xem [Hướng dẫn Cấu hình WeCom App](docs/wecom-app-configuration.md) đ } ``` -> **Lưu ý:** WeCom Bot incoming webhook endpoints are served by the shared Gateway HTTP server (mặc định 127.0.0.1:18790). Nếu bạn cần truy cập từ bên ngoài, đặt reverse proxy hoặc mở port Gateway phù hợp. +> **Lưu ý:** Các endpoint webhook của WeCom Bot được phục vụ bởi máy chủ Gateway HTTP dùng chung (mặc định 127.0.0.1:18790). Nếu bạn cần truy cập từ bên ngoài, hãy cấu hình reverse proxy hoặc mở cổng Gateway tương ứng. **Thiết lập Nhanh - WeCom App:** diff --git a/README.zh.md b/README.zh.md index 145d81fa5..1d8db583e 100644 --- a/README.zh.md +++ b/README.zh.md @@ -290,7 +290,7 @@ picoclaw agent -m "2+2 等于几?" PicoClaw 支持多种聊天平台,使您的 Agent 能够连接到任何地方。 -> **注意**: 所有 Webhook 类渠道(LINE、WeCom、飞书等)均挂载在同一个 Gateway HTTP 服务器上(`gateway.host`:`gateway.port`,默认 `127.0.0.1:18790`),无需为每个渠道单独配置端口。 +> **注意**: 所有 Webhook 类渠道(LINE、WeCom 等)均挂载在同一个 Gateway HTTP 服务器上(`gateway.host`:`gateway.port`,默认 `127.0.0.1:18790`),无需为每个渠道单独配置端口。注意:飞书(Feishu)使用 WebSocket/SDK 模式,不通过该共享 HTTP webhook 服务器接收消息。 ### 核心渠道 diff --git a/docs/channels/line/README.zh.md b/docs/channels/line/README.zh.md index db2e98e3e..a36f622c2 100644 --- a/docs/channels/line/README.zh.md +++ b/docs/channels/line/README.zh.md @@ -23,7 +23,7 @@ PicoClaw 通过 LINE Messaging API 配合 Webhook 回调功能实现对 LINE 的 | enabled | bool | 是 | 是否启用 LINE Channel | | channel_secret | string | 是 | LINE Messaging API 的 Channel Secret | | channel_access_token | string | 是 | LINE Messaging API 的 Channel Access Token | -| webhook_path | string | 是 | Webhook 的路径 (默认为 /webhook/line) | +| webhook_path | string | 否 | Webhook 的路径 (默认为 /webhook/line) | | allow_from | array | 否 | 用户ID白名单,空表示允许所有用户 | ## 设置流程 diff --git a/pkg/channels/README.md b/pkg/channels/README.md index 6fbf2bb34..b7c56660b 100644 --- a/pkg/channels/README.md +++ b/pkg/channels/README.md @@ -775,17 +775,17 @@ When the Agent finishes processing a message, Manager's `preSend` automatically: ```go type ChannelsConfig struct { // ... existing channels - Matrix MatrixChannelConfig `yaml:"matrix" json:"matrix"` + Matrix MatrixChannelConfig `json:"matrix"` } type MatrixChannelConfig struct { - Enabled bool `yaml:"enabled" json:"enabled"` - HomeServer string `yaml:"home_server" json:"home_server"` - Token string `yaml:"token" json:"token"` - AllowFrom []string `yaml:"allow_from" json:"allow_from"` - GroupTrigger GroupTriggerConfig `yaml:"group_trigger" json:"group_trigger"` - Placeholder PlaceholderConfig `yaml:"placeholder" json:"placeholder"` - ReasoningChannelID string `yaml:"reasoning_channel_id" json:"reasoning_channel_id"` + Enabled bool `json:"enabled"` + HomeServer string `json:"home_server"` + Token string `json:"token"` + AllowFrom []string `json:"allow_from"` + GroupTrigger GroupTriggerConfig `json:"group_trigger"` + Placeholder PlaceholderConfig `json:"placeholder"` + ReasoningChannelID string `json:"reasoning_channel_id"` } ``` @@ -801,9 +801,9 @@ if m.config.Channels.Matrix.Enabled && m.config.Channels.Matrix.Token != "" { > **Note**: If your channel has multiple modes (like WhatsApp Bridge vs Native), branch in initChannels based on config: > ```go > if cfg.UseNative { -> m.initChannel("matrix_native", "Matrix Native") +> m.initChannel("whatsapp_native", "WhatsApp Native") > } else { -> m.initChannel("matrix", "Matrix") +> m.initChannel("whatsapp", "WhatsApp") > } > ``` @@ -1381,4 +1381,4 @@ agentLoop.Stop() // Stop Agent 7. **PlaceholderConfig vs implementation**: `PlaceholderConfig` appears in 6 channel configs (Telegram, Discord, Slack, LINE, OneBot, Pico), but only channels that implement both `PlaceholderCapable` + `MessageEditor` (Telegram, Discord, Pico) can actually use placeholder message editing. The rest are reserved fields. -8. **ReasoningChannelID**: All 12 channel configs have a `ReasoningChannelID` field, used to route LLM reasoning/thinking output to a designated channel. `BaseChannel` exposes this via the `WithReasoningChannelID` option and `ReasoningChannelID()` method. \ No newline at end of file +8. **ReasoningChannelID**: Most channel configs include a `reasoning_channel_id` field to route LLM reasoning/thinking output to a designated channel (WhatsApp, Telegram, Feishu, Discord, MaixCam, QQ, DingTalk, Slack, LINE, OneBot, WeCom, WeComApp). Note: `PicoConfig` does not currently expose this field. `BaseChannel` exposes this via the `WithReasoningChannelID` option and `ReasoningChannelID()` method. \ No newline at end of file diff --git a/pkg/channels/README.zh.md b/pkg/channels/README.zh.md index bbd9a4321..2c5e7356e 100644 --- a/pkg/channels/README.zh.md +++ b/pkg/channels/README.zh.md @@ -774,17 +774,17 @@ if c.owner != nil && c.placeholderRecorder != nil { ```go type ChannelsConfig struct { // ... 现有 channels - Matrix MatrixChannelConfig `yaml:"matrix" json:"matrix"` + Matrix MatrixChannelConfig `json:"matrix"` } type MatrixChannelConfig struct { - Enabled bool `yaml:"enabled" json:"enabled"` - HomeServer string `yaml:"home_server" json:"home_server"` - Token string `yaml:"token" json:"token"` - AllowFrom []string `yaml:"allow_from" json:"allow_from"` - GroupTrigger GroupTriggerConfig `yaml:"group_trigger" json:"group_trigger"` - Placeholder PlaceholderConfig `yaml:"placeholder" json:"placeholder"` - ReasoningChannelID string `yaml:"reasoning_channel_id" json:"reasoning_channel_id"` + Enabled bool `json:"enabled"` + HomeServer string `json:"home_server"` + Token string `json:"token"` + AllowFrom []string `json:"allow_from"` + GroupTrigger GroupTriggerConfig `json:"group_trigger"` + Placeholder PlaceholderConfig `json:"placeholder"` + ReasoningChannelID string `json:"reasoning_channel_id"` } ``` @@ -800,9 +800,9 @@ if m.config.Channels.Matrix.Enabled && m.config.Channels.Matrix.Token != "" { > **注意**:如果你的 channel 有多种模式(如 WhatsApp Bridge vs Native),需要在 initChannels 中根据配置分支: > ```go > if cfg.UseNative { -> m.initChannel("matrix_native", "Matrix Native") +> m.initChannel("whatsapp_native", "WhatsApp Native") > } else { -> m.initChannel("matrix", "Matrix") +> m.initChannel("whatsapp", "WhatsApp") > } > ``` @@ -1380,4 +1380,4 @@ agentLoop.Stop() // 停止 Agent 7. **PlaceholderConfig 的配置与实现**:`PlaceholderConfig` 出现在 6 个 channel config 中(Telegram、Discord、Slack、LINE、OneBot、Pico),但只有实现了 `PlaceholderCapable` + `MessageEditor` 的 channel(Telegram、Discord、Pico)能真正使用占位消息编辑功能。其余 channel 的 `PlaceholderConfig` 为预留字段。 -8. **ReasoningChannelID**:所有 channel config(12 个)都有 `ReasoningChannelID` 字段,用于将 LLM 的思维链(reasoning/thinking)路由到指定 channel。`BaseChannel` 通过 `WithReasoningChannelID` 选项和 `ReasoningChannelID()` 方法暴露此配置。 \ No newline at end of file +8. **ReasoningChannelID**:大多数 channel config 都包含 `reasoning_channel_id` 字段,用于将 LLM 的思维链(reasoning/thinking)路由到指定 channel(WhatsApp、Telegram、Feishu、Discord、MaixCam、QQ、DingTalk、Slack、LINE、OneBot、WeCom、WeComApp)。注意:`PicoConfig` 目前不包含该字段。`BaseChannel` 通过 `WithReasoningChannelID` 选项和 `ReasoningChannelID()` 方法暴露此配置。 \ No newline at end of file