-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add WeCom AIBot channel implementation and tests #893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 11 commits
a4f30e9
d0d6c8c
728b65b
fb60941
8774ce1
e3634fb
0696f97
fd3111f
aaddf94
8d5f134
399a763
fb1e207
7918b9f
ad7ce69
77723eb
711657c
59d1f06
1ba5ab7
a193e2d
7c80274
403b0c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -288,7 +288,7 @@ Discutez avec votre PicoClaw via Telegram, Discord, DingTalk, LINE ou WeCom | |
| | **QQ** | Facile (AppID + AppSecret) | | ||
| | **DingTalk** | Moyen (identifiants de l'application) | | ||
| | **LINE** | Moyen (identifiants + URL de webhook) | | ||
| | **WeCom** | Moyen (CorpID + configuration webhook) | | ||
| | **WeCom AI Bot** | Moyen (Token + clé AES) | | ||
|
|
||
| <details> | ||
| <summary><b>Telegram</b> (Recommandé)</summary> | ||
|
|
@@ -491,12 +491,13 @@ picoclaw gateway | |
| <details> | ||
| <summary><b>WeCom (WeChat Work)</b></summary> | ||
|
|
||
| PicoClaw prend en charge deux types d'intégration WeCom : | ||
| PicoClaw prend en charge trois types d'intégration WeCom : | ||
|
|
||
| **Option 1 : WeCom Bot (Robot Intelligent)** - Configuration plus facile, prend en charge les discussions de groupe | ||
| **Option 2 : WeCom App (Application Personnalisée)** - Plus de fonctionnalités, messagerie proactive | ||
| **Option 1 : WeCom Bot (Robot)** - Configuration plus facile, prend en charge les discussions de groupe | ||
| **Option 2 : WeCom App (Application Personnalisée)** - Plus de fonctionnalités, messagerie proactive, chat privé uniquement | ||
| **Option 3 : WeCom AI Bot (Bot Intelligent)** - Bot IA officiel, réponses en streaming, prend en charge groupe et privé | ||
|
|
||
| Voir le [Guide de Configuration WeCom App](docs/wecom-app-configuration.md) pour des instructions détaillées. | ||
| Voir le [Guide de Configuration WeCom AI Bot](docs/channels/wecom/wecom_aibot/README.zh.md) pour des instructions détaillées. | ||
|
|
||
| **Configuration Rapide - WeCom Bot :** | ||
|
|
||
|
|
@@ -567,6 +568,41 @@ picoclaw gateway | |
|
|
||
| > **Note** : WeCom App nécessite l'ouverture du port 18792 pour les callbacks webhook. Utilisez un proxy inverse pour HTTPS en production. | ||
|
|
||
| **Configuration Rapide - WeCom AI Bot :** | ||
|
|
||
| **1. Créer un AI Bot** | ||
|
|
||
| * Accédez à la Console d'Administration WeCom → Gestion des Applications → AI Bot | ||
| * Configurez l'URL de callback : `http://your-server:18791/webhook/wecom-aibot` | ||
| * Copiez le **Token** et générez l'**EncodingAESKey** | ||
|
|
||
| **2. Configurer** | ||
|
|
||
| ```json | ||
| { | ||
| "channels": { | ||
| "wecom_aibot": { | ||
| "enabled": true, | ||
| "token": "YOUR_TOKEN", | ||
| "encoding_aes_key": "YOUR_43_CHAR_ENCODING_AES_KEY", | ||
| "webhook_host": "0.0.0.0", | ||
| "webhook_port": 18791, | ||
| "webhook_path": "/webhook/wecom-aibot", | ||
| "allow_from": [], | ||
| "welcome_message": "Bonjour ! Comment puis-je vous aider ?" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| **3. Lancer** | ||
|
|
||
| ```bash | ||
| picoclaw gateway | ||
| ``` | ||
|
|
||
| > **Note** : WeCom AI Bot utilise le protocole pull en streaming — pas de problème de timeout. Les tâches longues (>5,5 min) basculent automatiquement vers la livraison via `response_url`. | ||
|
||
|
|
||
| </details> | ||
|
|
||
| ## <img src="assets/clawdchat-icon.png" width="24" height="24" alt="ClawdChat"> Rejoignez le Réseau Social d'Agents | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -257,7 +257,7 @@ Telegram、Discord、QQ、DingTalk、LINE、WeCom で PicoClaw と会話でき | |
| | **QQ** | 簡単(AppID + AppSecret) | | ||
| | **DingTalk** | 普通(アプリ認証情報) | | ||
| | **LINE** | 普通(認証情報 + Webhook URL) | | ||
| | **WeCom** | 普通(CorpID + Webhook設定) | | ||
| | **WeCom AI Bot** | 普通(Token + AES キー) | | ||
|
||
|
|
||
| <details> | ||
| <summary><b>Telegram</b>(推奨)</summary> | ||
|
|
@@ -456,12 +456,13 @@ picoclaw gateway | |
| <details> | ||
| <summary><b>WeCom (企業微信)</b></summary> | ||
|
|
||
| PicoClaw は2種類の WeCom 統合をサポートしています: | ||
| PicoClaw は3種類の WeCom 統合をサポートしています: | ||
|
|
||
| **オプション1: WeCom Bot (智能ロボット)** - 簡単な設定、グループチャット対応 | ||
| **オプション2: WeCom App (自作アプリ)** - より多機能、アクティブメッセージング対応 | ||
| **オプション1: WeCom Bot (ロボット)** - 簡単な設定、グループチャット対応 | ||
| **オプション2: WeCom App (カスタムアプリ)** - より多機能、アクティブメッセージング対応、プライベートチャットのみ | ||
| **オプション3: WeCom AI Bot (スマートボット)** - 公式 AI Bot、ストリーミング返信、グループ・プライベート両対応 | ||
|
|
||
| 詳細な設定手順は [WeCom App Configuration Guide](docs/wecom-app-configuration.md) を参照してください。 | ||
| 詳細な設定手順は [WeCom AI Bot Configuration Guide](docs/channels/wecom/wecom_aibot/README.zh.md) を参照してください。 | ||
|
|
||
| **クイックセットアップ - WeCom Bot:** | ||
|
|
||
|
|
@@ -532,6 +533,41 @@ picoclaw gateway | |
|
|
||
| > **注意**: WeCom App は Webhook コールバック用にポート 18792 を開放する必要があります。本番環境では HTTPS 用のリバースプロキシを使用してください。 | ||
|
|
||
| **クイックセットアップ - WeCom AI Bot:** | ||
|
|
||
| **1. AI Bot を作成** | ||
|
|
||
| * WeCom 管理コンソール → アプリ管理 → AI Bot | ||
| * コールバック URL を設定: `http://your-server:18791/webhook/wecom-aibot` | ||
| * **Token** をコピーし、**EncodingAESKey** を生成 | ||
|
|
||
| **2. 設定** | ||
|
|
||
| ```json | ||
| { | ||
| "channels": { | ||
| "wecom_aibot": { | ||
| "enabled": true, | ||
| "token": "YOUR_TOKEN", | ||
| "encoding_aes_key": "YOUR_43_CHAR_ENCODING_AES_KEY", | ||
| "webhook_host": "0.0.0.0", | ||
| "webhook_port": 18791, | ||
| "webhook_path": "/webhook/wecom-aibot", | ||
| "allow_from": [], | ||
| "welcome_message": "こんにちは!何かお手伝いできますか?" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| **3. 起動** | ||
|
|
||
| ```bash | ||
| picoclaw gateway | ||
| ``` | ||
|
|
||
| > **注意**: WeCom AI Bot はストリーミングプルプロトコルを使用 — 返信タイムアウトの心配なし。長時間タスク(>30秒)は自動的に `response_url` によるプッシュ配信に切り替わります。 | ||
|
|
||
| </details> | ||
|
|
||
| ## ⚙️ 設定 | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -303,7 +303,7 @@ Talk to your picoclaw through Telegram, Discord, WhatsApp, DingTalk, LINE, or We | |||||
| | **QQ** | Easy (AppID + AppSecret) | | ||||||
| | **DingTalk** | Medium (app credentials) | | ||||||
| | **LINE** | Medium (credentials + webhook URL) | | ||||||
| | **WeCom** | Medium (CorpID + webhook setup) | | ||||||
| | **WeCom AI Bot** | Medium (Token + AES key) | | ||||||
|
||||||
|
|
||||||
| <details> | ||||||
| <summary><b>Telegram</b> (Recommended)</summary> | ||||||
|
|
@@ -536,12 +536,13 @@ picoclaw gateway | |||||
| <details> | ||||||
| <summary><b>WeCom (企业微信)</b></summary> | ||||||
|
|
||||||
| PicoClaw supports two types of WeCom integration: | ||||||
| PicoClaw supports three types of WeCom integration: | ||||||
|
|
||||||
| **Option 1: WeCom Bot (智能机器人)** - Easier setup, supports group chats | ||||||
| **Option 2: WeCom App (自建应用)** - More features, proactive messaging | ||||||
| **Option 1: WeCom Bot (Bot)** - Easier setup, supports group chats | ||||||
| **Option 2: WeCom App (Custom App)** - More features, proactive messaging, private chat only | ||||||
| **Option 3: WeCom AI Bot (AI Bot)** - Official AI Bot, streaming replies, supports group & private chat | ||||||
|
|
||||||
| See [WeCom App Configuration Guide](docs/wecom-app-configuration.md) for detailed setup instructions. | ||||||
| See [WeCom AI Bot Configuration Guide](docs/channels/wecom/wecom_aibot/README.zh.md) for detailed setup instructions. | ||||||
|
||||||
| See [WeCom AI Bot Configuration Guide](docs/channels/wecom/wecom_aibot/README.zh.md) for detailed setup instructions. | |
| See [WeCom AI Bot Configuration Guide (Chinese)](docs/channels/wecom/wecom_aibot/README.zh.md) for detailed setup instructions (documentation currently available in Chinese only). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -282,7 +282,7 @@ Converse com seu PicoClaw via Telegram, Discord, DingTalk, LINE ou WeCom. | |
| | **QQ** | Fácil (AppID + AppSecret) | | ||
| | **DingTalk** | Médio (credenciais do app) | | ||
| | **LINE** | Médio (credenciais + webhook URL) | | ||
| | **WeCom** | Médio (CorpID + configuração webhook) | | ||
| | **WeCom AI Bot** | Médio (Token + chave AES) | | ||
|
||
|
|
||
| <details> | ||
| <summary><b>Telegram</b> (Recomendado)</summary> | ||
|
|
@@ -485,12 +485,13 @@ picoclaw gateway | |
| <details> | ||
| <summary><b>WeCom (WeChat Work)</b></summary> | ||
|
|
||
| O PicoClaw suporta dois tipos de integração WeCom: | ||
| O PicoClaw suporta três tipos de integração WeCom: | ||
|
|
||
| **Opção 1: WeCom Bot (Robô Inteligente)** - Configuração mais fácil, suporta chats em grupo | ||
| **Opção 2: WeCom App (Aplicativo Personalizado)** - Mais recursos, mensagens proativas | ||
| **Opção 1: WeCom Bot (Robô)** - Configuração mais fácil, suporta chats em grupo | ||
| **Opção 2: WeCom App (Aplicativo Personalizado)** - Mais recursos, mensagens proativas, somente chat privado | ||
| **Opção 3: WeCom AI Bot (Robô Inteligente)** - Bot IA oficial, respostas em streaming, suporta grupo e privado | ||
|
|
||
| Veja o [Guia de Configuração WeCom App](docs/wecom-app-configuration.md) para instruções detalhadas. | ||
| Veja o [Guia de Configuração WeCom AI Bot](docs/channels/wecom/wecom_aibot/README.zh.md) para instruções detalhadas. | ||
|
|
||
| **Configuração Rápida - WeCom Bot:** | ||
|
|
||
|
|
@@ -561,6 +562,41 @@ picoclaw gateway | |
|
|
||
| > **Nota**: O WeCom App requer a abertura da porta 18792 para callbacks de webhook. Use um proxy reverso para HTTPS em produção. | ||
|
|
||
| **Configuração Rápida - WeCom AI Bot:** | ||
|
|
||
| **1. Criar um AI Bot** | ||
|
|
||
| * Acesse o Console de Administração WeCom → Gerenciamento de Aplicativos → AI Bot | ||
| * Configure a URL de callback: `http://your-server:18791/webhook/wecom-aibot` | ||
| * Copie o **Token** e gere o **EncodingAESKey** | ||
|
|
||
| **2. Configurar** | ||
|
|
||
| ```json | ||
| { | ||
| "channels": { | ||
| "wecom_aibot": { | ||
| "enabled": true, | ||
| "token": "YOUR_TOKEN", | ||
| "encoding_aes_key": "YOUR_43_CHAR_ENCODING_AES_KEY", | ||
| "webhook_host": "0.0.0.0", | ||
| "webhook_port": 18791, | ||
| "webhook_path": "/webhook/wecom-aibot", | ||
| "allow_from": [], | ||
| "welcome_message": "Olá! Como posso ajudá-lo?" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| **3. Executar** | ||
|
|
||
| ```bash | ||
| picoclaw gateway | ||
| ``` | ||
|
|
||
| > **Nota**: O WeCom AI Bot usa protocolo de pull em streaming — sem preocupações com timeout de resposta. Tarefas longas (>5,5 min) alternam automaticamente para entrega via `response_url`. | ||
|
||
|
|
||
| </details> | ||
|
|
||
| ## <img src="assets/clawdchat-icon.png" width="24" height="24" alt="ClawdChat"> Junte-se a Rede Social de Agentes | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -256,7 +256,7 @@ Trò chuyện với PicoClaw qua Telegram, Discord, DingTalk, LINE hoặc WeCom. | |
| | **QQ** | Dễ (AppID + AppSecret) | | ||
| | **DingTalk** | Trung bình (app credentials) | | ||
| | **LINE** | Trung bình (credentials + webhook URL) | | ||
| | **WeCom** | Trung bình (CorpID + cấu hình webhook) | | ||
| | **WeCom AI Bot** | Trung bình (Token + khóa AES) | | ||
|
||
|
|
||
| <details> | ||
| <summary><b>Telegram</b> (Khuyên dùng)</summary> | ||
|
|
@@ -459,12 +459,13 @@ picoclaw gateway | |
| <details> | ||
| <summary><b>WeCom (WeChat Work)</b></summary> | ||
|
|
||
| PicoClaw hỗ trợ hai loại tích hợp WeCom: | ||
| PicoClaw hỗ trợ ba loại tích hợp WeCom: | ||
|
|
||
| **Tùy chọn 1: WeCom Bot (Robot Thông minh)** - Thiết lập dễ dàng hơn, hỗ trợ chat nhóm | ||
| **Tùy chọn 2: WeCom App (Ứng dụng Tự xây dựng)** - Nhiều tính năng hơn, nhắn tin chủ động | ||
| **Tùy chọn 1: WeCom Bot (Robot)** - Thiết lập dễ dàng hơn, hỗ trợ chat nhóm | ||
| **Tùy chọn 2: WeCom App (Ứng dụng Tùy chỉnh)** - Nhiều tính năng hơn, nhắn tin chủ động, chỉ chat riêng tư | ||
| **Tùy chọn 3: WeCom AI Bot (Bot Thông Minh)** - Bot AI chính thức, phản hồi streaming, hỗ trợ nhóm và riêng tư | ||
|
|
||
| Xem [Hướng dẫn Cấu hình WeCom App](docs/wecom-app-configuration.md) để biết hướng dẫn chi tiết. | ||
| Xem [Hướng dẫn Cấu hình WeCom AI Bot](docs/channels/wecom/wecom_aibot/README.zh.md) để biết hướng dẫn chi tiết. | ||
|
|
||
| **Thiết lập Nhanh - WeCom Bot:** | ||
|
|
||
|
|
@@ -535,6 +536,41 @@ picoclaw gateway | |
|
|
||
| > **Lưu ý**: WeCom App yêu cầu mở cổng 18792 cho callback webhook. Sử dụng proxy ngược cho HTTPS trong môi trường sản xuất. | ||
|
|
||
| **Thiết lập Nhanh - WeCom AI Bot:** | ||
|
|
||
| **1. Tạo AI Bot** | ||
|
|
||
| * Truy cập Bảng điều khiển Quản trị WeCom → Quản lý Ứng dụng → AI Bot | ||
| * Cấu hình URL callback: `http://your-server:18791/webhook/wecom-aibot` | ||
| * Sao chép **Token** và tạo **EncodingAESKey** | ||
|
|
||
| **2. Cấu hình** | ||
|
|
||
| ```json | ||
| { | ||
| "channels": { | ||
| "wecom_aibot": { | ||
| "enabled": true, | ||
| "token": "YOUR_TOKEN", | ||
| "encoding_aes_key": "YOUR_43_CHAR_ENCODING_AES_KEY", | ||
| "webhook_host": "0.0.0.0", | ||
| "webhook_port": 18791, | ||
| "webhook_path": "/webhook/wecom-aibot", | ||
| "allow_from": [], | ||
| "welcome_message": "Xin chào! Tôi có thể giúp gì cho bạn?" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| **3. Chạy** | ||
|
|
||
| ```bash | ||
| picoclaw gateway | ||
| ``` | ||
|
|
||
| > **Lưu ý**: WeCom AI Bot sử dụng giao thức pull streaming — không lo timeout phản hồi. Tác vụ dài (>5,5 phút) tự động chuyển sang gửi qua `response_url`. | ||
|
||
|
|
||
| </details> | ||
|
|
||
| ## <img src="assets/clawdchat-icon.png" width="24" height="24" alt="ClawdChat"> Tham gia Mạng xã hội Agent | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -127,7 +127,7 @@ | |||||||||
| "reasoning_channel_id": "" | ||||||||||
| }, | ||||||||||
| "wecom": { | ||||||||||
| "_comment": "WeCom Bot (智能机器人) - Easier setup, supports group chats", | ||||||||||
| "_comment": "WeCom Bot - Easier setup, supports group chats", | ||||||||||
| "enabled": false, | ||||||||||
| "token": "YOUR_TOKEN", | ||||||||||
| "encoding_aes_key": "YOUR_43_CHAR_ENCODING_AES_KEY", | ||||||||||
|
|
@@ -140,7 +140,7 @@ | |||||||||
| "reasoning_channel_id": "" | ||||||||||
| }, | ||||||||||
| "wecom_app": { | ||||||||||
| "_comment": "WeCom App (自建应用) - More features, proactive messaging, private chat only. See docs/wecom-app-configuration.md", | ||||||||||
| "_comment": "WeCom App (自建应用) - More features, proactive messaging, private chat only.", | ||||||||||
| "enabled": false, | ||||||||||
| "corp_id": "YOUR_CORP_ID", | ||||||||||
| "corp_secret": "YOUR_CORP_SECRET", | ||||||||||
|
|
@@ -153,6 +153,18 @@ | |||||||||
| "allow_from": [], | ||||||||||
| "reply_timeout": 5, | ||||||||||
| "reasoning_channel_id": "" | ||||||||||
| }, | ||||||||||
| "wecom_aibot": { | ||||||||||
| "_comment": "WeCom AI Bot (智能机器人) - Official WeCom AI Bot integration, supports proactive messaging and private chats.", | ||||||||||
|
||||||||||
| "_comment": "WeCom AI Bot (智能机器人) - Official WeCom AI Bot integration, supports proactive messaging and private chats.", | |
| "_comment": "WeCom AI Bot (智能机器人) - Official WeCom AI Bot integration, supports proactive messaging, private chats, and group chats.", |
Outdated
Copilot
AI
Feb 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WeComAIBot example configuration uses port 18791, which conflicts with the default port for LINE. The example should use a unique port (e.g., 18794) to avoid misleading users into a port conflict when they also have LINE enabled.
| "webhook_port": 18791, | |
| "webhook_port": 18794, |
Copilot
AI
Feb 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wecom_aibot entry in config.example.json is missing the allow_from and reply_timeout fields that are present in the WeComAIBotConfig struct (and in the defaults) and are included in every other WeCom channel entry (wecom and wecom_app). Omitting these from the example config makes it less discoverable for users who want to restrict which users the bot responds to.
| "webhook_path": "/webhook/wecom-aibot", | |
| "webhook_path": "/webhook/wecom-aibot", | |
| "allow_from": [], | |
| "reply_timeout": 5, |
Copilot
AI
Feb 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wecom_aibot example configuration is missing the allow_from and reply_timeout fields that are present in the wecom and wecom_app example configurations. While these fields have defaults, including them in the example config would help users understand that these options exist, consistent with the other WeCom channel examples.
| "max_steps": 10, | |
| "max_steps": 10, | |
| "allow_from": [], | |
| "reply_timeout": 5, |
Copilot
AI
Feb 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wecom_aibot section in config.example.json is missing the allow_from and reply_timeout fields. Every other channel in this file includes allow_from, and the other WeCom channels (wecom and wecom_app) both include reply_timeout. This inconsistency makes it less obvious to users that these configuration options exist for wecom_aibot. The fields are supported by the config struct (WeComAIBotConfig) and the channel implementation.
Copilot
AI
Feb 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wecom_aibot entry in config.example.json omits allow_from and reply_timeout fields that are present in both the wecom and wecom_app example entries. For consistency and to make the example easier to use as a template, these fields should be included in the example, just as they are in the wecom and wecom_app blocks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WeCom table row was replaced with "WeCom AI Bot", removing coverage of WeCom Bot and WeCom App from the overview table. The "See [WeCom AI Bot Configuration Guide]" link replaces the former WeCom App guide link, leaving no dedicated link for WeCom App or WeCom Bot detailed docs.