mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-28 19:35:27 +08:00
docs: update WeCom bot events and sandbox profiles
This commit is contained in:
@@ -126,6 +126,21 @@ Click `Company-Created`, select the created bot, and enter the chat interface.
|
||||
|
||||
Similarly, if you want to invite the bot to a group chat, click the add member button in the group chat and add the bot from there.
|
||||
|
||||
### Orchestration events
|
||||
|
||||
The new WeCom AI Bot adapter exposes these business events in both WebSocket and Webhook modes. Choose a processor for each event in the bot's event routing settings.
|
||||
|
||||
| Event | Use case and data |
|
||||
| --- | --- |
|
||||
| `message.received` | Handle incoming user messages for conversations or tasks. |
|
||||
| `wecombot.enter_chat` | Start a welcome or onboarding workflow when a user enters the bot chat. Includes the user, chat ID, and raw event data. |
|
||||
| `wecombot.template_card_event` | Handle card clicks and submissions, branching on `task_id`, `event_key`, or `selected_items`. Includes card type, user, chat, and raw event data. |
|
||||
| `feedback.received` | Collect feedback on bot replies. |
|
||||
|
||||
WeCom sends the chat-entry event; it does not mean that a friend was added. Welcome replies must complete within the platform's 5-second window. Prefer a fast, fixed text response. LangBot uses the dedicated welcome API for text event replies and reports an expired window explicitly. Avoid slow model calls to generate welcome messages.
|
||||
|
||||
LangBot interaction forms and Dify forms continue through their existing callback flows, without also triggering a card business event. Connection, authentication, and reconnection states are not orchestration events.
|
||||
|
||||
### Effect Images
|
||||
|
||||

|
||||
|
||||
@@ -64,12 +64,15 @@ Box can run in **local containers**, in a **cloud sandbox**, or as a **process o
|
||||
|
||||
| Profile | Network | Mounts | Resources | When to use |
|
||||
|---------|---------|--------|-----------|-------------|
|
||||
| `default` | Off | Read-write | Default limits | Default choice |
|
||||
| `default` | On | Read-write | Default limits | Default choice, including API access or dependency downloads |
|
||||
| `offline` | Off | Read-write | Default limits | Offline tasks; preserves the previous default configuration |
|
||||
| `offline_readonly` | Off | Read-only | Stricter | Reading untrusted files |
|
||||
| `network_basic` | Basic network | Read-write | Default limits | API access or dependency install |
|
||||
| `network_extended` | Full network | Read-write | Relaxed | Development, debugging, complex tasks |
|
||||
|
||||
Prefer least privilege: skip the network unless you need it (`default` / `offline_readonly`); only add necessary directories to `allowed_mount_roots`.
|
||||
`network_basic` is retained for compatibility and has the same settings as `default`.
|
||||
|
||||
Prefer least privilege: skip the network unless you need it (`offline` / `offline_readonly`); only add necessary directories to `allowed_mount_roots`.
|
||||
|
||||
<Note>
|
||||
The Host backend does not enforce these isolation policies. A configured profile, CPU / memory / PID limit, read-only rootfs, or disabled network does not create a sandbox boundary around host processes.
|
||||
|
||||
@@ -126,6 +126,21 @@ WeCom に入り、「➕」をクリックします。以下のように:
|
||||
|
||||
同様に、ボットをグループチャットに招待したい場合は、グループチャットでメンバーを追加ボタンをクリックし、そこからボットを追加します。
|
||||
|
||||
### オーケストレーションイベント
|
||||
|
||||
新しい WeCom AI Bot アダプターは、WebSocket と Webhook の両モードで以下の業務イベントを提供します。ボットのイベントルーティングで、イベントごとに処理器を選択できます。
|
||||
|
||||
| イベント | 用途とデータ |
|
||||
| --- | --- |
|
||||
| `message.received` | ユーザーのメッセージを受信し、会話やタスクを処理します。 |
|
||||
| `wecombot.enter_chat` | ユーザーがボットのチャットを開いた際に、歓迎や案内のフローを開始します。ユーザー、チャット ID、元のイベントデータを含みます。 |
|
||||
| `wecombot.template_card_event` | カードのクリックや送信を処理し、`task_id`、`event_key`、`selected_items` に応じて分岐できます。カード種別、ユーザー、チャット、元のイベントデータを含みます。 |
|
||||
| `feedback.received` | ボットの回答に対するフィードバックを収集します。 |
|
||||
|
||||
チャットへの参加イベントは WeCom から送信され、友だち追加を意味しません。歓迎メッセージはプラットフォームの 5 秒以内の応答期限に収めてください。短い固定テキストを推奨します。イベントへのテキスト返信には専用の歓迎 API を使用し、期限切れは明示的にエラーになります。時間のかかるモデル呼び出しによる歓迎文の生成は避けてください。
|
||||
|
||||
LangBot のインタラクションフォームと Dify フォームは既存のコールバック処理を使用し、カードの業務イベントを重複して起動しません。接続、認証、再接続などの低レベル状態はオーケストレーションイベントに含めません。
|
||||
|
||||
### 効果の画像
|
||||
|
||||

|
||||
|
||||
@@ -64,12 +64,15 @@ Box は**ローカルコンテナ**、**クラウドサンドボックス**、
|
||||
|
||||
| Profile | ネットワーク | マウント | リソース | 推奨シーン |
|
||||
|---------|---------|---------|---------|----------|
|
||||
| `default` | オフ | 読み書き | 既定制限 | 既定の選択 |
|
||||
| `default` | オン | 読み書き | 既定制限 | 既定の選択、API アクセスや依存関係のダウンロード |
|
||||
| `offline` | オフ | 読み書き | 既定制限 | ネットワーク不要のタスク、従来の default 設定を維持 |
|
||||
| `offline_readonly` | オフ | 読み取り専用 | より厳格 | 信頼できないファイルの読み込み |
|
||||
| `network_basic` | 基本ネットワーク | 読み書き | 既定制限 | API アクセス、依存関係インストール |
|
||||
| `network_extended` | フルネットワーク | 読み書き | 緩和 | 開発、デバッグ、複雑なタスク |
|
||||
|
||||
最小権限を優先:ネットワークが不要なら `default` または `offline_readonly`;`allowed_mount_roots` には必要なディレクトリのみを追加。
|
||||
`network_basic` は互換性のために維持され、設定は `default` と同じです。
|
||||
|
||||
最小権限を優先:ネットワークが不要なら `offline` または `offline_readonly`;`allowed_mount_roots` には必要なディレクトリのみを追加。
|
||||
|
||||
<Note>
|
||||
Host バックエンドはこれらの隔離ポリシーを適用しません。profile、CPU / メモリ / PID 制限、読み取り専用 rootfs、ネットワーク無効化を設定しても、ホストプロセスにサンドボックス境界は作られません。
|
||||
|
||||
@@ -126,6 +126,21 @@ LangBot 支持一键创建企业微信智能机器人并自动填写 BotId 和 S
|
||||
|
||||
同理,若想邀请机器人进入群聊,那么点击群聊的添加人员,在其中添加机器人。
|
||||
|
||||
### 编排事件
|
||||
|
||||
新版企业微信智能机器人适配器在长连接和 Webhook 模式下均提供以下业务事件,可在机器人的事件路由中分别选择处理器:
|
||||
|
||||
| 事件 | 使用场景与数据 |
|
||||
| --- | --- |
|
||||
| `message.received` | 收到用户消息,进入日常问答或任务处理流程。 |
|
||||
| `wecombot.enter_chat` | 用户进入机器人会话,可触发欢迎和使用引导。包含用户、会话 ID 和原始事件数据。 |
|
||||
| `wecombot.template_card_event` | 用户点击或提交模板卡片,可按 `task_id`、`event_key` 或 `selected_items` 分支处理。包含卡片类型、用户、会话和原始事件数据。 |
|
||||
| `feedback.received` | 用户对机器人回复提交反馈,可用于评价收集。 |
|
||||
|
||||
进入会话事件由企业微信推送,不代表添加好友。欢迎语必须在平台的 5 秒窗口内完成,建议使用快速、固定的文本;通过事件回复发送文本时,LangBot 会使用专用欢迎语接口,超时会明确报错。不要依赖耗时的模型调用生成欢迎语。
|
||||
|
||||
LangBot 交互表单和 Dify 表单的卡片回调继续由原有交互流程处理,不会同时触发模板卡片业务事件。连接、鉴权和重连等底层状态不作为编排事件。
|
||||
|
||||
### 效果图
|
||||
|
||||

|
||||
|
||||
@@ -64,12 +64,15 @@ Box 可以跑在**本机容器**、**云端沙箱**,也可以直接使用 **Bo
|
||||
|
||||
| Profile | 网络 | 挂载 | 资源 | 建议场景 |
|
||||
|---------|------|------|------|----------|
|
||||
| `default` | 关闭 | 读写 | 默认限制 | 默认选择 |
|
||||
| `default` | 开启 | 读写 | 默认限制 | 默认选择,可访问 API 或下载依赖 |
|
||||
| `offline` | 关闭 | 读写 | 默认限制 | 无需联网的任务,保留原 default 配置 |
|
||||
| `offline_readonly` | 关闭 | 只读 | 更严格 | 读取不可信文件 |
|
||||
| `network_basic` | 开启基础网络 | 读写 | 默认限制 | 需要访问 API 或下载依赖 |
|
||||
| `network_extended` | 开启完整网络 | 读写 | 更宽松 | 开发、调试、复杂任务 |
|
||||
|
||||
优先使用最小权限:不需要网络就用 `default` 或 `offline_readonly`;只把必要目录加入 `allowed_mount_roots`。
|
||||
`network_basic` 保留兼容,其配置与 `default` 相同。
|
||||
|
||||
优先使用最小权限:不需要网络就用 `offline` 或 `offline_readonly`;只把必要目录加入 `allowed_mount_roots`。
|
||||
|
||||
<Note>
|
||||
Host 后端不执行这些隔离策略。即使配置了 profile、CPU / 内存 / PID 限制、只读 rootfs 或网络关闭,主机进程也不受这些沙箱边界保护。
|
||||
|
||||
Reference in New Issue
Block a user