Merge remote-tracking branch 'origin/main' into docs/online-experience
# Conflicts: # tests/agent-static-build.test.mjs # tests/fumapress-migration.test.mjs # tests/fumapress-static-build.test.mjs # tests/locale-static-build.test.mjs Co-authored-by: wangcham <[email protected]>
@@ -667,6 +667,15 @@
|
||||
"en/plugin/plugin-intro",
|
||||
"en/plugin/compatibility"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Enterprise support",
|
||||
"pages": [
|
||||
"en/enterprise/overview",
|
||||
"en/enterprise/service-scope",
|
||||
"en/enterprise/submit-ticket",
|
||||
"en/enterprise/procurement"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -974,6 +983,15 @@
|
||||
"zh/plugin/plugin-intro",
|
||||
"zh/plugin/compatibility"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "企业支持",
|
||||
"pages": [
|
||||
"zh/enterprise/overview",
|
||||
"zh/enterprise/service-scope",
|
||||
"zh/enterprise/submit-ticket",
|
||||
"zh/enterprise/procurement"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1284,6 +1302,15 @@
|
||||
"ja/plugin/plugin-intro",
|
||||
"ja/plugin/compatibility"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "企業サポート",
|
||||
"pages": [
|
||||
"ja/enterprise/overview",
|
||||
"ja/enterprise/service-scope",
|
||||
"ja/enterprise/submit-ticket",
|
||||
"ja/enterprise/procurement"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
title: "Enterprise Support"
|
||||
description: "LangBot Enterprise Support — Enterprise Support"
|
||||
---
|
||||
|
||||
Keep using the complete open-source LangBot with an official support relationship, issue triage, security updates, and procurement contracts and invoices. Your subscription also funds continued development.
|
||||
|
||||
LangBot remains freely available under Apache License 2.0. This subscription is not a commercial-use license and does not restrict organizations that do not subscribe.
|
||||
|
||||
## Enterprise Support
|
||||
|
||||
- Contract and invoice from 北京浪波智能科技有限公司
|
||||
- Annual enterprise support subscription certificate
|
||||
- Optional supporter listing with consent; anonymity available
|
||||
- Enterprise ticket intake; first human response within 2 business days
|
||||
- Quarterly public release/security digest and critical security notices
|
||||
- One 60-minute usage review per year
|
||||
- Priority review of public roadmap proposals; no development commitment
|
||||
|
||||
## Enterprise Assurance
|
||||
|
||||
- All Enterprise Support benefits
|
||||
- Registration of 1 production instance
|
||||
- Up to 4 additional remote consultations per year, 60 minutes each
|
||||
- Pre-upgrade compatibility advice and priority incident triage
|
||||
- Reproduced, confirmed LangBot Core defects enter the priority fix queue
|
||||
- One annual version, dependency and security status summary
|
||||
|
||||
[Choose your support plan](https://langbot.app/en/enterprise)
|
||||
|
||||
Annual fees are per contracting organization, not per seat. Prices are in CNY. Taxes, invoice type and service dates are specified in the formal quote and contract.
|
||||
|
||||
[Service scope and response policy](/en/enterprise/service-scope) · [Submit a support ticket](/en/enterprise/submit-ticket) · [Procurement and delivery](/en/enterprise/procurement)
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
title: "Procurement and delivery"
|
||||
description: "LangBot Enterprise Support — Procurement and delivery"
|
||||
---
|
||||
|
||||
1. Email your organization name, preferred plan and usage context.
|
||||
2. Confirm scope, taxes and invoicing, and sign an annual service contract.
|
||||
3. Pay as agreed and register contacts, Space accounts and service dates.
|
||||
4. Receive the certificate and service guide, then submit requests in Space.
|
||||
|
||||
[[email protected]](mailto:[email protected])
|
||||
|
||||
## Contract and invoicing
|
||||
|
||||
Contracting entity: **北京浪波智能科技有限公司**.
|
||||
|
||||
Service description: **Annual maintenance, release information and technical support for LangBot open-source software**.
|
||||
|
||||
Fees are annual per contracting organization, not per seat. Taxes, invoice type and service dates are confirmed in the formal quote and contract. Finance confirms the permitted invoice category; the service is not a donation or an additional commercial software license. Overseas invoicing, payment currency and support language must be confirmed; translated pages do not promise local tax invoices or local-language human support.
|
||||
|
||||
## Activation deliverables
|
||||
|
||||
- Service order and contract, service dates and designated contacts.
|
||||
- Annual support subscription certificate documenting a support relationship, not an additional software license.
|
||||
- Versioned scope and response policy, ticket instructions and registered Space accounts.
|
||||
- One registered production instance and consultation allowance for Assurance.
|
||||
- Optional supporter listing only with separate consent; anonymity is available.
|
||||
|
||||
Keep delivery records for quarterly public maintenance digests, tickets and consultations. Assurance also includes an annual version, dependency and security summary. Later website changes do not automatically alter existing contractual benefits.
|
||||
|
||||
## Renewal
|
||||
|
||||
Renewal requires agreement; no automatic charge is assumed. Start/end dates, cancellation and refunds follow the contract. Expiry does not restrict Apache 2.0 usage. Cloud resources, model credits and managed hosting are separate products.
|
||||
|
||||
Initially provide your organization, preferred plan and usage context. Supply billing details privately when needed for the contract, not in public issues or GitHub.
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
title: "Service scope and response policy"
|
||||
description: "LangBot Enterprise Support — Service scope and response policy"
|
||||
---
|
||||
|
||||
## Included
|
||||
|
||||
- LangBot Core defect assessment and triage
|
||||
- Official documentation guidance and upgrade compatibility advice
|
||||
- Public release information and security advisories
|
||||
|
||||
## Not included
|
||||
|
||||
- Deployment, operations, 24/7 coverage or on-site service
|
||||
- Troubleshooting customer networks, databases, Kubernetes or model providers
|
||||
- Maintenance of plugins, third-party adapters or private-protocol clients
|
||||
- Custom development or historical data migration
|
||||
- Recovery SLA, fixed resolution deadlines or compliance certification
|
||||
|
||||
## First response and resolution
|
||||
|
||||
A first response is a human assessment of scope, a request for missing information, or initial triage and next steps. Automated receipts do not count. Both plans include a first response within 2 business days, without a recovery or resolution deadline.
|
||||
|
||||
Intake hours are 09:00–18:00 Beijing time (Asia/Shanghai) on mainland China statutory working days, including officially adjusted weekend working days. Requests outside these hours start at 09:00 on the next working day. The deadline is the same time on the second subsequent working day. With no holidays or adjusted days, a Friday 14:00 request is due Tuesday 14:00; a Friday 20:00 request starts Monday 09:00 and is due Wednesday 09:00.
|
||||
|
||||
Missing information is requested within the first-response window. Further diagnosis depends on completeness and reproducibility. Priority triage does not provide a faster recovery SLA.
|
||||
|
||||
## Covered software and versions
|
||||
|
||||
Support covers the current stable LangBot Core release. Older versions receive upgrade guidance; defect assessment may require reproduction on the current stable release. Historical backports, LTS branches and private customer patches are not promised. Official plugins and third-party components are not automatically part of Core maintenance.
|
||||
|
||||
The base plan provides triage, documentation guidance and defect assessment, not ongoing remote investigation of customer environments. Assurance consultations require scheduling and use the four additional annual sessions of up to 60 minutes each. The annual 60-minute usage review is separate: at most five sessions in total. Unused sessions do not roll over.
|
||||
|
||||
Use one ticket per issue; duplicates may be merged. Public defects are maintained according to severity, impact and reproducibility. Priority fix queues do not guarantee a completion date. Priority roadmap review does not promise implementation or scheduling.
|
||||
|
||||
## Instance registration and security information
|
||||
|
||||
Assurance covers one registered production instance. Registration defines support coverage, not a limit on deployments permitted by Apache 2.0. Record the version, deployment outline, purpose and contacts; no license server or telemetry is required. Update registration by ticket before replacing an instance; additional environments are not automatically covered.
|
||||
|
||||
Quarterly digests reuse public release and security information. Critical notices follow applicable advisories confirmed by maintainers; the base plan receives general notices, without environment-specific impact assessment. Annual version, dependency and security summaries use the registered version and public information. They are not audits, penetration tests, compliance certifications or guarantees of no vulnerabilities.
|
||||
|
||||
## Service agreement
|
||||
|
||||
Support language, contacts, service dates and the applicable policy version are confirmed in the contract. After expiry, new subscription requests stop; existing tickets receive triage or handover as agreed, without an indefinite obligation to fix. Expiry does not affect open-source use.
|
||||
|
||||
Group chat is not an unlimited support channel. Monthly office hours are not a contractual entitlement. Custom development is excluded; general product requests may enter the public roadmap, and any separate engagement requires its own assessment and quote.
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
title: "Submit a support ticket"
|
||||
description: "LangBot Enterprise Support — Submit a support ticket"
|
||||
---
|
||||
|
||||
[Subscriber? Submit a ticket](https://space.langbot.app/profile?tab=tickets&language=en)
|
||||
|
||||
Sign in with the Space account registered in your contract. Open Profile → Tickets and choose Enterprise Support: issue intake or Enterprise Assurance: upgrade and consultation. Templates are available to signed-in users; staff verify the contract, registered account and service dates before confirming enterprise entitlements. A subscription number is not proof of identity.
|
||||
|
||||
## Information to provide
|
||||
|
||||
- Subscription/contract number, organization, request type and summary.
|
||||
- Defects: LangBot version, deployment method, expected and actual behavior, reproduction steps and business impact.
|
||||
- Redacted log excerpts; explain if unavailable. Do not include tokens, passwords, full conversations, personal customer data or raw configuration files.
|
||||
- Upgrade/consultation: registered instance, current/target versions where relevant, goals and preferred meeting times.
|
||||
- Documentation or procurement-material questions do not require invented logs or reproduction steps. Use the consultation form to describe the request; technical consultation sessions are an Assurance benefit.
|
||||
|
||||
Forms collect text and do not automatically collect instance data or generate a diagnostic archive. Only attach necessary, redacted screenshots. Do not post vulnerability details in public GitHub issues.
|
||||
|
||||
## What happens next
|
||||
|
||||
The team checks the subscription and scope, then provides documentation guidance, asks for information, schedules an eligible consultation, identifies a public Core defect, or explains an exclusion. Automatic email notifications are not a first human response.
|
||||
|
||||
Only necessary, redacted reproduction details for confirmed general defects enter public maintenance. Contracts, customer logs and business information are not automatically copied to GitHub. Continue in the same ticket instead of duplicating requests across channels.
|
||||
@@ -11,4 +11,4 @@ Collected at: https://blog.thelazy.top/tags/langbot
|
||||
|
||||
## 🥰 Community
|
||||
|
||||
Join our community on Discord: [](https://discord.gg/wdNEHETs87)
|
||||
Join our community on Discord: [Discord](https://discord.gg/wdNEHETs87)
|
||||
|
||||
@@ -30,19 +30,6 @@ If you run into problems, check [troubleshooting](/en/insight/troubleshooting) o
|
||||
Copy the prompt below into your AI assistant. It starts with the official documentation and adapts its help to your environment and goals.
|
||||
|
||||
```text
|
||||
Help me deploy and use LangBot. Read the official documentation first, then propose an approach suited to my environment.
|
||||
|
||||
Start with the English documentation index at https://langbot.app/docs/en/llms.txt and read these key pages:
|
||||
- Features: https://langbot.app/docs/en/insight/features.md
|
||||
- Platform support: https://langbot.app/docs/en/insight/platform-features.md
|
||||
- Bot configuration: https://langbot.app/docs/en/usage/platforms/readme.md
|
||||
- Model configuration: https://langbot.app/docs/en/usage/models/readme.md
|
||||
- Pipelines: https://langbot.app/docs/en/usage/pipelines/readme.md
|
||||
|
||||
First, find out which messaging platform and model I want to use and whether I already have a LangBot instance. If deployment is needed, ask about my operating system, server or local environment, and preference for cloud or self-hosting. Then use the index to read the relevant deployment and platform connection guides. Do not guess commands or configuration fields.
|
||||
|
||||
Help me deploy LangBot and configure the bot connection, model, and pipeline based on the documentation. If you have execution tools, work within the environment I authorize and verify the results; otherwise, give me instructions suited to my setup. Prefer reusing an existing instance. Ask before overwriting configuration, deleting data, or taking paid actions, and do not ask me to paste secrets into chat.
|
||||
|
||||
Finally, help me send a real test message and confirm that the bot replies. Once the basics work, guide me to knowledge bases, plugins, MCP, or Skills as needed. If you cannot read the docs or an operation fails, say so clearly. Do not report unverified steps as completed.
|
||||
Read https://langbot.app/llms.txt first and follow its official guidance to help me deploy and use LangBot, install the LangBot CLI, and configure and manage my instance with the CLI. Adapt to my goals and environment, reuse an existing instance when possible, and verify a real message and reply on my target messaging platform. Respond in English.
|
||||
```
|
||||
</Tip>
|
||||
|
||||
@@ -28,18 +28,58 @@ LangBot supports one-click DingTalk app creation with automatic credential filli
|
||||
|
||||

|
||||
|
||||
7. **Manually fill in the bot name** (must match the DingTalk bot name), and the **Robot Code** (required for image/file features — get it from DingTalk Developer Console > Bot Configuration)
|
||||
|
||||

|
||||
|
||||
8. Click **Submit** to complete
|
||||
7. Click **Submit** to complete. LangBot automatically identifies the bot.
|
||||
|
||||
<Warning>
|
||||
After one-click setup, normal text chat works immediately. However:
|
||||
- **Image/File support**: Requires the Robot Code (RobotCode) to be filled in. If not filled during one-click setup, get it from DingTalk Developer Console > Bot Configuration
|
||||
- **Streaming replies**: Requires manually configuring a card template ID — see the Card Template section below
|
||||
One-click setup fills in app credentials but does not create card templates. For streaming replies, import the LangBot streaming reply template, enable Use Card Replies and set Card Template ID to automatically enable streaming replies. Turn off the switch for plain text without deleting the template ID. For human input interactions, import the separate human input template and set Human Input Card Template ID. Enable the required card permissions in your DingTalk app.
|
||||
</Warning>
|
||||
|
||||
## Configure card templates (use the LangBot templates)
|
||||
|
||||
For card replies, import the templates supplied by LangBot instead of building components and binding variables manually. Enable the required card permissions for your DingTalk app, then choose the template for your use case:
|
||||
|
||||
| Purpose | Download | LangBot field |
|
||||
| --- | --- | --- |
|
||||
| Streaming replies with separate reasoning and answer regions | `dingtalk_stream_card.json` | Card Template ID |
|
||||
| Pause for user input, a choice, or confirmation | `dingtalk_human_input_card.json` | Human Input Card Template ID |
|
||||
|
||||
### Create and import the streaming reply template
|
||||
|
||||
1. In the DingTalk adapter configuration, click **Download Streaming Reply Card Template** below **Card Template ID**.
|
||||
2. Open [DingTalk Card Platform](https://open-dev.dingtalk.com/fe/card), select the same organization as your bot app, and click **New Template**.
|
||||
3. Enter a name. Set **Card Type** to **Message Card**, **Template Scenario** to **AI Card**, associate your bot app, and select **Build from Blank**. Click **Create Blank Template**. The screenshot shows these options in the Chinese interface.
|
||||
|
||||

|
||||
|
||||
4. In the card editor, choose **More → Import Card Template** and select `dingtalk_stream_card.json`.
|
||||
|
||||

|
||||
|
||||
<Note>
|
||||
The import option is inside the editor, not on the template list page. Importing replaces the current template contents, so use a new blank template. Keep the imported components, variables, and event bindings.
|
||||
</Note>
|
||||
|
||||
5. Review the preview, **save and publish** the template, and copy its ID. Saving a draft is insufficient: `param.templateUnpublished` means the template has not been published.
|
||||
6. Enable **Use Card Replies**, paste the ID into **Card Template ID** in LangBot, and save to enable streaming replies. Turning off the switch uses plain text and hides but preserves the template settings for later use.
|
||||
|
||||
The template includes LangBot branding and separate reasoning and answer regions. Reasoning is expanded during generation and collapsed by default when finished; users can expand it again. The footer offers answer copying, thumbs-up/down controls, and an AI-generated content label. The pipeline still controls whether reasoning is removed. If removed, the reasoning region is hidden. Ordinary messages with reasoning retained show literal `<think>` and `</think>` markers separated from the answer by blank lines.
|
||||
|
||||
Card Auto Layout is enabled by default; the supplied streaming reply template includes the required variables. For an existing bot saved with this option off, enable it and save the configuration. You can keep it off for a narrower card.
|
||||
|
||||
To update, download and import the latest template, then save and publish again. If you create a different template, also replace its ID in LangBot. Existing templates bound only to `content` remain compatible but do not offer the new separate reasoning region.
|
||||
|
||||
## Import the human input card template
|
||||
|
||||
Human input is used when a workflow or plugin waits for information, a choice, or confirmation before continuing, such as a Dify Human Input node. Ordinary chat and streaming replies alone do not require this template.
|
||||
|
||||
1. Next to **Human Input Card Template ID**, click **Download Human Input Card Template** to save `dingtalk_human_input_card.json`.
|
||||
2. Follow the creation steps above to create a separate **Message Card → AI Card → Build from Blank** template associated with your bot app.
|
||||
3. Choose **More → Import Card Template** in the editor and import the human input JSON. Keep its input fields, buttons, variables, and event bindings.
|
||||
4. **Save and publish**, enter this template's ID into **Human Input Card Template ID** in LangBot, and save the bot configuration.
|
||||
|
||||
Import the two templates separately and use their corresponding fields. The human input template does not replace the streaming reply template or automatically enable streaming replies.
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Manual Configuration
|
||||
@@ -71,45 +111,16 @@ If card streaming is needed, you must apply for card permissions in the permissi
|
||||
|
||||

|
||||
|
||||
Additionally, for card messages you mainly need to create a card template and record the template ID to fill in the configuration, the process is as follows:
|
||||
> The card content template ID can be obtained by logging into the developer backend > [Card Platform](https://open-dev.dingtalk.com/fe/card?spm=ding_open_doc.document.0.0.33cf2281L0fXsV)
|
||||
|
||||
Fill in information when creating a new template, as shown:
|
||||

|
||||
|
||||
Select a preset template (just choose the first one and modify the template content later), as shown:
|
||||

|
||||
Click Use
|
||||

|
||||
Create
|
||||

|
||||
|
||||
After clicking Create you'll be redirected to edit the template. As shown, you can freely edit your desired card message:
|
||||

|
||||
|
||||
For the main content, keep the default 'content' unchanged:
|
||||

|
||||
|
||||
Widescreen configuration parameters, you need to add . in the template variables. See [DingTalk Widescreen Configuration](https://open.dingtalk.com/document/development/configure-widescreen-cards)
|
||||

|
||||
|
||||
After editing and confirming everything is correct, save it and copy the template ID to fill in the configuration file:
|
||||

|
||||

|
||||
For card templates, follow the steps above to import and publish the templates supplied by LangBot.
|
||||
|
||||
### Fill in Configuration Information
|
||||
|
||||
Click `Credentials and Basic Information`, record `Client ID` and `Client Secret`,
|
||||
Click `Application Capabilities`, `Robot`, record the RobotCode and Robot Name.
|
||||
`markdown_card` is whether to enable Markdown form replies. When this configuration item is disabled, the `@Sender` configuration switch will not take effect.
|
||||
Click `Credentials and Basic Information`, record `Client ID` and `Client Secret`, and enter these credentials in the LangBot adapter configuration.
|
||||
`markdown_card` (Use Card Replies) controls both Markdown and streaming card replies. When enabled, a configured template enables streaming; otherwise ordinary Markdown is used. Disable it for plain text without clearing template settings. Human input cards are configured separately for workflow interactions.
|
||||
Record the above configuration items and fill them in the LangBot bot configuration form
|
||||
|
||||
Click [Card Platform](https://open-dev.dingtalk.com/fe/card?spm=ding_open_doc.document.0.0.33cf2281L0fXsV), copy the corresponding bound template ID from the template list, and fill it into the card template ID field.
|
||||
|
||||

|
||||
|
||||
Streaming related:
|
||||

|
||||
|
||||
**Start LangBot**.
|
||||
|
||||
@@ -121,3 +132,16 @@ This article uses DingTalk Windows desktop version as an example, click `Search`
|
||||
Click on the bot to chat with it.
|
||||
|
||||
If you want to add it to a group, click `Group Management`, `Robots`, `Add Robot` in the DingTalk group, then search for the bot name to use it in the group.
|
||||
|
||||
## Event subscriptions
|
||||
|
||||
Select Stream mode under Event Subscriptions in the DingTalk app console and enable the required events. This is separate from the robot message callback setting.
|
||||
|
||||
- `chat_add_member` maps to `group.member_joined`, once per affected member.
|
||||
- `chat_remove_member` / `chat_quit` map to `group.member_left`, distinguishing removal from voluntary departure.
|
||||
- `chat_update_title` / `chat_update_owner` map to `group.info_updated`.
|
||||
- Ordinary card interactions emit `dingtalk.card_action`. Recognized feedback uses `feedback.received`; managed input forms retain their existing interaction flow without duplicate triggers.
|
||||
- Group disbanding and other subscribed events use `platform.specific`, preserving the native event name in `action` and the original headers and payload in `data`.
|
||||
|
||||
Group events depend on application permissions and supported group types. Member notifications containing only unionId remain platform-specific; unionId is not treated as a messaging user ID. Message editing, recall, reactions, friend requests and bot mute events are not advertised without a confirmed corresponding push capability.
|
||||
|
||||
|
||||
@@ -41,12 +41,38 @@ If you choose an existing app, a list of your apps will be shown:
|
||||
|
||||

|
||||
|
||||
7. **Manually fill in the bot name** — it must match the Feishu bot name, otherwise the bot won't receive messages in groups
|
||||
7. The new adapter identifies the bot automatically; no bot name is needed to recognize group mentions. If the legacy adapter still shows this field, enter the same name as the Feishu bot.
|
||||
|
||||

|
||||
|
||||
8. Click **Submit** to complete
|
||||
|
||||
### Additional permissions and event subscriptions
|
||||
|
||||
<Note>
|
||||
An app created or authorized by QR code may not have all the permissions and event subscriptions your use case requires. Sending and receiving messages does not mean member join/leave events are subscribed. You can update the existing app in the developer console without creating another bot.
|
||||
</Note>
|
||||
|
||||
1. Open the [Feishu developer console](https://open.feishu.cn/app) or [Lark developer console](https://open.larksuite.com/app). Select the app you created or authorized, using its App ID to confirm.
|
||||
2. Under **Permissions**, add the permissions required for your features. Permissions control which data and operations the bot can access.
|
||||
3. Under **Events & Callbacks > Event Configuration**, subscribe to the events you need. Subscriptions control which notifications are sent to LangBot; granting permissions does not automatically subscribe to events.
|
||||
4. Save the changes and complete any release or administrator approval requested by the platform. Once effective, trigger a new event to verify delivery; earlier actions are not replayed by adding a subscription.
|
||||
|
||||
<Warning>
|
||||
**Remember to publish a new app version after adding events.** Complete the release under **Version Management & Release**, and wait for administrator approval if required. Adding and saving an event does not activate changes that are still pending release. LangBot may show a healthy connection while these events are not delivered.
|
||||
</Warning>
|
||||
|
||||
If member join/leave events still do not arrive after subscribing, first check for changes pending release or approval. Once the new version is effective, have a member join or leave a group containing the bot again, then check the event records in LangBot.
|
||||
|
||||
To receive group membership changes, the bot must be in the group and the app must subscribe to:
|
||||
|
||||
| Feature | Feishu event |
|
||||
| --- | --- |
|
||||
| User joins a group | `im.chat.member.user.added_v1` |
|
||||
| User leaves or is removed from a group | `im.chat.member.user.deleted_v1` |
|
||||
|
||||
The bot joining a group (`im.chat.member.bot.added_v1`) is a separate event and does not cover other members. Also configure **Event Routing** in LangBot to send these events to an Agent or plugin processor; pipelines only process message events.
|
||||
|
||||
---
|
||||
|
||||
## Create Bot
|
||||
|
||||
@@ -4,7 +4,114 @@ description: "Build a Slack AI bot with LangBot. Connect GPT, Claude, Dify and m
|
||||
icon: "/images/platforms/slack.svg"
|
||||
---
|
||||
|
||||
## Create Bot
|
||||
## Quick setup (recommended)
|
||||
|
||||
Use **Quick Slack setup** to create your app. LangBot configures bot scopes, message events, the messages tab and the OAuth return URL. You provide configuration tokens, approve installation in Slack, and add an App-Level Token when using Socket Mode.
|
||||
|
||||
### 1. Create a bot and choose a connection mode
|
||||
|
||||
In LangBot, open **Bots → Create bot**, enter a name, select **Slack**, and submit. On the configuration page, choose a connection mode and select **Quick Slack setup → Start**:
|
||||
|
||||

|
||||
|
||||
- **Socket Mode (recommended)**: LangBot connects to Slack. No public event webhook is required, making this suitable for local or private-network deployments.
|
||||
- **Webhook**: Slack sends events to LangBot through a publicly reachable HTTPS endpoint.
|
||||
|
||||

|
||||
|
||||
### 2. Get App Configuration Tokens
|
||||
|
||||
Open the [Slack apps page](https://api.slack.com/apps). Under **Your App Configuration Tokens**, select **Generate Token** and choose the target workspace. Copy both the **Access Token** and **Refresh Token**. If tokens already exist, use their copy buttons.
|
||||
|
||||

|
||||
|
||||
These tokens create and configure apps. **They are not the runtime Bot Token or App-Level Token.** Paste each into its matching field in the assistant and confirm the app name.
|
||||
|
||||
### 3. Confirm the URL and create the app
|
||||
|
||||
For Socket Mode, check the **OAuth return URL**. It returns your browser to LangBot after authorization, accepts HTTPS or `http://localhost`, and ends in `/api/v1/platform/adapters/slack/setup/callback`. Only your browser needs to reach it; this is not an event webhook. For remote deployments, do not use a server-internal address that your browser cannot reach.
|
||||
|
||||

|
||||
|
||||
For Webhook, the assistant shows a **Webhook URL** instead. Verify the public domain, HTTPS and reverse proxy, and preserve the `/bots/<bot UUID>` suffix. LangBot derives the OAuth return URL from it and completes Slack's event URL verification automatically.
|
||||
|
||||
Select **Create and configure**, then wait for **Authorize in Slack**.
|
||||
|
||||
### 4. Authorize installation in Slack
|
||||
|
||||
Select **Authorize in Slack**, review the app name, workspace and permissions, and select **Allow**. Workspace policy may require administrator approval. Return to the original LangBot assistant afterward.
|
||||
|
||||

|
||||
|
||||
### 5. Socket Mode: add an App-Level Token
|
||||
|
||||
Skip this step for Webhook. For Socket Mode, use **Open app settings** in the assistant and navigate to **Basic Information → App-Level Tokens → Generate Token and Scopes**:
|
||||
|
||||
1. Enter a Token Name, such as `langbot-socket`.
|
||||
2. Select **Add Scope**, then **connections:write**.
|
||||
3. Select **Generate**, copy the resulting `xapp-` token, and paste it into **App-Level Token** in the assistant.
|
||||
|
||||

|
||||
|
||||
Leave **Token rotation** disabled. The token must belong to the same Slack app you just created. Do not use the Access Token or Refresh Token from step 2 here.
|
||||
|
||||
### 6. Fill configuration, set routing and enable the bot
|
||||
|
||||
When the assistant reports successful authorization, select **Fill adapter configuration**. In Socket Mode, this button becomes available after you enter the App-Level Token. The assistant fills the Bot Token and other adapter credentials automatically.
|
||||
|
||||

|
||||
|
||||
Under **Event routing → Add action → Reply to received messages**, select a configured pipeline or Agent for `message.received` and keep the route enabled. Finally, select **Save and enable** at the top right.
|
||||
|
||||

|
||||
|
||||
### 7. Test a conversation
|
||||
|
||||
Open the app's **Messages** tab in Slack and send a direct message. You can also invite the bot to a channel and mention it. A reply confirms the integration works.
|
||||
|
||||

|
||||
|
||||
<Info>
|
||||
Configuration tokens are used only during the temporary setup session, not saved as runtime credentials. Sessions last 15 minutes. Cancelling does not delete an app already created in Slack, and starting again may create another app. If the return page shows an error, check whether the original assistant already reports successful authorization before restarting.
|
||||
</Info>
|
||||
|
||||
If no reply arrives, check that both the bot and message route are enabled, the handler works, and the bot logs show no errors. For Socket Mode, verify that the App-Level Token belongs to the same app and includes `connections:write`. For Webhook, check the public endpoint and Slack's **Verified** status.
|
||||
|
||||
## Events, interactions and upgrading existing apps
|
||||
|
||||
Quick setup configures the subscriptions and interaction endpoint below. Installation requests message, channel, user, file and reaction permissions; `reactions:read` enables reaction events. Normal channel replies still require an @mention. Subscribing to channel messages for edits, deletions and channel changes does not trigger replies to all channel traffic.
|
||||
|
||||
| Slack event | LangBot event |
|
||||
| --- | --- |
|
||||
| Direct messages, `app_mention` | `message.received` |
|
||||
| `message_changed` / `message_deleted` message subtypes | `message.edited` / `message.deleted` |
|
||||
| `reaction_added` / `reaction_removed` | `message.reaction`, distinguished by `is_add` |
|
||||
| `member_joined_channel` / `member_left_channel` | `group.member_joined` / `group.member_left` |
|
||||
| Membership events for the bot itself | `bot.invited_to_group` when an inviter is present; `bot.removed_from_group` on departure |
|
||||
| Channel rename, archive/unarchive, topic/purpose changes | `group.info_updated` |
|
||||
| `block_actions`, `view_submission`, `view_closed`, `shortcut`, `message_action` | `platform.specific`, with `action` set to `slack.` plus the callback type |
|
||||
| `app_home_opened`, `app_uninstalled`, `tokens_revoked` | `platform.specific`, with `action` set to `slack.` plus the event type |
|
||||
|
||||
Configure handlers in the bot's event routing; distinguish platform callbacks by `action`. Uninstallation and token revocation also produce bot warning logs and do not automatically send chat replies. Emoji reactions are not automatically treated as model feedback. Message IDs use Slack message timestamps (`ts`) together with the channel; replies preserve `thread_ts`.
|
||||
|
||||
Interactions are acknowledged first and processed asynchronously. Synchronous field validation errors in modal submission acknowledgements and external select-option loading are not supported. Set `notify_on_close: true` when opening a modal to receive `view_closed`. Receiving callbacks does not create buttons, shortcuts or modals. Both Socket Mode and Webhook support these handlers; actual delivery depends on Slack permissions, channel membership and connection availability.
|
||||
|
||||
**Upgrading LangBot does not automatically update an existing Slack app's permissions.** Keep the existing app and:
|
||||
|
||||
1. In **OAuth & Permissions → Bot Token Scopes**, retain existing scopes and add `reactions:read`. Verify `app_mentions:read`, `chat:write`, `channels:history`, `channels:read`, `groups:history`, `groups:read`, `im:history`, `im:read`, `im:write`, `mpim:history`, `mpim:read`, `users:read`, `files:read`, `files:write`, then **Reinstall to Workspace** to authorize the permissions.
|
||||
2. In **Event Subscriptions → Subscribe to bot events**, configure: `app_mention`, `message.im`, `message.channels`, `message.groups`, `message.mpim`, `reaction_added`, `reaction_removed`, `member_joined_channel`, `member_left_channel`, `channel_rename`, `group_rename`, `channel_archive`, `channel_unarchive`, `group_archive`, `group_unarchive`, `app_home_opened`, `app_uninstalled`, `tokens_revoked`. Edits/deletions and topic/purpose changes are message subtypes, not separate subscriptions.
|
||||
3. Enable **Interactivity & Shortcuts**. For Webhook, use the same LangBot `/bots/<bot UUID>` **Request URL** as event subscriptions. Socket Mode needs no public interaction URL.
|
||||
4. Save Slack settings and configure the corresponding LangBot routes. If reinstallation changes the Bot Token, update it and save the bot.
|
||||
|
||||
See the [Slack App Manifest reference](https://docs.slack.dev/reference/app-manifest/) for field definitions.
|
||||
|
||||
## Manual setup (Webhook)
|
||||
|
||||
The screenshots below show basic messaging setup. Use the current lists in “Events, interactions and upgrading existing apps” above for complete permissions, subscriptions and interactivity settings.
|
||||
|
||||
The manual Webhook instructions follow. For manual Socket Mode setup, enable Socket Mode in Slack, supply Bot Token and App-Level Token, and subscribe to `app_mention` and `message.im`. No event Request URL is needed.
|
||||
|
||||
### Create Bot
|
||||
|
||||
Go to the [Slack App Platform](https://api.slack.com/apps).
|
||||
|
||||
@@ -29,7 +136,7 @@ After adding the above permissions, click `Install to your workspace`, record th
|
||||
Enter the `App Home` tab on the left, scroll to the bottom where you'll find `Message Tab`, turn it on and check
|
||||
`Allow users to send Slash commands and messages from the messages tab`.
|
||||
|
||||
## Connect to LangBot
|
||||
### Connect to LangBot
|
||||
|
||||
Enter `Event Subscriptions` on the left, turn on the switch, click `Subscribe to bot events`,
|
||||
add the following permissions:
|
||||
@@ -39,10 +146,10 @@ After completing all the above operations, open the LangBot Webui configuration
|
||||
|
||||

|
||||
|
||||
## Start Bot
|
||||
### Start Bot
|
||||
|
||||
<Info>
|
||||
Since Slack officially requires https, please configure reverse proxy first according to the documentation [Configure HTTP Reverse Proxy and SSL](/en/workshop/production/proxy-and-ssl).
|
||||
Webhook mode requires public HTTPS; please configure reverse proxy first according to the documentation [Configure HTTP Reverse Proxy and SSL](/en/workshop/production/proxy-and-ssl).
|
||||
</Info>
|
||||
|
||||
After filling in the Slack configuration items, **start LangBot**.
|
||||
@@ -52,6 +159,6 @@ Enable and open the Slack bot configuration page on the LangBot homepage, copy t
|
||||
After filling in all the above configuration items, click save link. If it shows a green **Verified**, it means the deployment is successful.
|
||||
Otherwise, check if the above configuration items are filled in correctly.
|
||||
|
||||
## Effect Demonstration
|
||||
### Effect Demonstration
|
||||
|
||||

|
||||
|
||||
@@ -4,30 +4,77 @@ description: "Build a Telegram AI bot with LangBot. Connect GPT, Claude, Gemini,
|
||||
icon: "/images/platforms/telegram.svg"
|
||||
---
|
||||
|
||||
## Create Bot
|
||||
## Create a bot
|
||||
|
||||
Go to the [Telegram Bot Creation Page](https://t.me/botfather), follow the prompts, and create a bot.
|
||||
Open the official [BotFather](https://t.me/BotFather) in Telegram, send `/newbot`, and choose a name and a username ending in `bot`. Keep the returned Token private; do not include it in group messages or screenshots.
|
||||
|
||||

|
||||
This guide covers the new Telegram adapter in LangBot 4.11 (internal name `telegram-omni`). Do not select the deprecated legacy adapter.
|
||||
|
||||

|
||||
## Configure and enable
|
||||
|
||||
After creation, BotFather will return an API Token, please keep it safe. Next, turn off `Privacy Mode` to use it in group chats.
|
||||
1. Configure a working model provider and model in LangBot, then create a Pipeline, Agent, or plugin processor.
|
||||
2. Create a bot under **Bots**, select Telegram, and enter the Token.
|
||||
3. Bind a message processor to `message.received`. A Pipeline runs a conversation flow; an Agent handles events with tools. Plugin processors can also subscribe independently.
|
||||
4. Enable Markdown and streaming as needed, enable the bot, and save. Save again after changing processor bindings.
|
||||
5. Open the bot's private chat in Telegram, click **Start**, and send a test message. Check the processor's run status and reply tool result in LangBot as well.
|
||||
|
||||

|
||||
The adapter uses long polling and requires outbound access to `api.telegram.org`. An inbound Webhook is not required to receive messages. Only one polling instance should use a Token; do not enable the same bot in another LangBot instance simultaneously.
|
||||
|
||||
## Connect to LangBot
|
||||
### Choose a processor
|
||||
|
||||
Open the LangBot Webui page, create a new bot
|
||||
| Type | Configuration and checks |
|
||||
| --- | --- |
|
||||
| Pipeline | Set the model and trigger rules. Group mentions or prefixes must still match the rules. With streaming enabled, a streaming-capable processor can progressively update the Telegram message. |
|
||||
| Agent | Configure the model, instructions, and event tools. Instruct it to use `event_reply` or another sending tool; model text alone does not prove delivery to Telegram. |
|
||||
| Plugin processor | Install and configure the plugin processor, bind it to the bot, and save. Independent subscriptions can run alongside the main processor, so one message can produce two replies. |
|
||||
|
||||

|
||||
For attachment tasks, enable Box for the processor and use its sandbox tools and attachment delivery capabilities. Box must be ready. An external filesystem MCP server does not share Box's filesystem. Image understanding also requires a vision-capable model.
|
||||
|
||||
After filling in, start LangBot. If configured successfully, the log will show `[02-02 16:48:15.263] manager.py (68) - [INFO] : Initializing platform adapter 1: telegram`, keep LangBot running.
|
||||
The bot's streaming toggle does not make every tool call stream tokens. An Agent's `event_reply` sends a complete message; plugin streaming depends on its implementation. Verify actual Telegram updates and processor logs separately.
|
||||
|
||||
## Use Bot
|
||||
## Private chats and groups
|
||||
|
||||
Now you can use the bot normally in groups or private messages.
|
||||
Click **Start** in a private chat first. For groups, add the bot to a test group and follow the processor's trigger rules, for example with a command addressed to the bot or a reply to its message.
|
||||
|
||||

|
||||
Disabling **Privacy Mode** is not mandatory for every group scenario. Telegram delivers different messages for directed commands, replies, administrator bots, and ordinary group traffic. To receive ordinary group messages, adjust privacy mode in BotFather and re-add the bot when Telegram requires it, or grant administrator status where appropriate. See [Telegram's privacy mode documentation](https://core.telegram.org/bots/features#privacy-mode).
|
||||
|
||||

|
||||
Member-status and reaction updates must satisfy Telegram's administrator requirements for those update types. Grant only the permissions the feature needs; do not enable deletion, bans, or adding administrators merely to receive events. Telegram delivery rules and LangBot trigger rules both apply.
|
||||
|
||||
Upgrading a basic group to a supergroup changes its ID. The Bot API group ID in event logs can also differ from the Telegram Web URL; do not construct a group ID from that URL.
|
||||
|
||||
## Images, files, and streaming
|
||||
|
||||
Images and files arrive as message attachments. Test with a clearly captioned image and a text file whose content can be checked. Verify the actual returned image or file rather than a textual claim that it was sent.
|
||||
|
||||
Streaming text progressively updates a Telegram message; attachments are sent separately at completion. Generated files must use the processor's attachment output mechanism, not just return a sandbox path. Images Telegram cannot process as photos are retried as documents to preserve their original bytes.
|
||||
|
||||

|
||||
|
||||
## Other events
|
||||
|
||||
Bind an Agent or plugin processor to the required events. Pipelines primarily handle message flows; do not treat every non-message event as ordinary chat.
|
||||
|
||||
| Event | Trigger and meaning |
|
||||
| --- | --- |
|
||||
| `message.received` | A private or group message, including supported attachments. |
|
||||
| `message.edited` | An existing message is edited. |
|
||||
| `message.reaction` | A user adds or removes a reaction. `is_add` identifies the direction; `reaction` retains the removed emoji. |
|
||||
| `group.member_joined` | A member joins. |
|
||||
| `group.member_left` | A member leaves or is removed; inspect `is_kicked`. |
|
||||
| `group.member_banned` | A member is restricted, such as being muted; this does not mean they were removed. |
|
||||
| `bot.invited_to_group` | The bot is added to a group. |
|
||||
| `bot.removed_from_group` | The bot is removed, including when previously restricted. |
|
||||
| `bot.muted` | The bot loses permission to send messages. An indefinite restriction has `duration: null`. |
|
||||
| `bot.unmuted` | Sending permission is restored, even if other restrictions remain. |
|
||||
| `platform.specific` | Other platform events, such as permission changes or callbacks. Inspect `action` and `data`. |
|
||||
|
||||
Start with a logging-only plugin processor to confirm delivery before adding replies or moderation actions. A muted or removed bot may receive the event while no longer being able to reply in that group. Evaluate reception and sending permission separately.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- **No reply:** check enabled state, saved bindings, private-chat Start, group privacy mode, and trigger rules, then inspect the processor run.
|
||||
- **Delivered message but failed run:** expand the run and inspect tool results. A visible Telegram message alone does not prove the entire task succeeded.
|
||||
- **Model errors or timeouts:** check the provider and model separately from Telegram delivery.
|
||||
- **Only a file path is returned:** check Box, tool permissions, and whether the attachment sending tool actually ran.
|
||||
- **Duplicate replies:** check overlapping main/independent subscriptions and multiple polling instances.
|
||||
- **Missing reactions or member events:** check administrator status and event bindings. Test in a dedicated group without affecting real members.
|
||||
|
||||
@@ -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
|
||||
|
||||

|
||||
|
||||
@@ -33,4 +33,53 @@ Click Submit on the LangBot configuration page to enable the robot, copy the Web
|
||||
|
||||
Copy the Secret from the page, then open the newly created LangBot WeCom Customer Service robot, fill in the new Secret, and restart.
|
||||
|
||||
Go back to the WeCom Customer Service configuration page, click on Customer Service Accounts, create a customer service account, and you can start using it.
|
||||
## Get the customer service link and QR code
|
||||
|
||||
After configuring the callback, obtain an entry point that WeChat users can use to start a conversation.
|
||||
|
||||
1. Return to the [WeChat Customer Service console](https://kf.weixin.qq.com/kf), open **Customer Service Accounts** (`客服帐号`), and create or select the account you want to connect to LangBot.
|
||||
2. Open its integration page, scroll to **Integrate into apps or websites outside WeChat** (`在微信外App/网页中接入`), and click **Integrate** (`去接入`).
|
||||
|
||||

|
||||
|
||||
3. Find the account at the top of the integration page. Click **Copy Link** (`复制链接`) to obtain its customer service link, or **Generate QR Code** (`生成二维码`) to display its QR code.
|
||||
|
||||

|
||||
|
||||
<Note>
|
||||
The link in the screenshot is an example. Use the link or QR code generated for your own account. The Webhook callback URL delivers events to LangBot; the customer service link and QR code let users start a conversation.
|
||||
</Note>
|
||||
|
||||
## Test with WeChat
|
||||
|
||||
1. Enable the bot in LangBot and configure **Event Routing** to send **Message Received** events to the processor you want to use.
|
||||
2. Scan the generated QR code with regular WeChat, enter the customer service conversation, and send a message.
|
||||
3. Check the bot logs, session monitor, and the processor's execution logs in LangBot to confirm receipt and processing, then check for a reply in WeChat.
|
||||
|
||||
For a QR-code test, you do not need to configure the app association shown further down the integration page.
|
||||
|
||||
## Routable events
|
||||
|
||||
Select a processor for each event in the bot's **Event Routing** settings. Regular messages can use a Pipeline or Agent; other events require an Agent or plugin processor that supports them.
|
||||
|
||||
| Event | Event type |
|
||||
| --- | --- |
|
||||
| Message received | `message.received` |
|
||||
| Customer or representative recalled a message | `message.deleted` |
|
||||
| Customer entered through a service link | `wecomcs.enter_session` |
|
||||
| Outgoing message failed | `wecomcs.msg_send_fail` |
|
||||
| Representative availability changed | `wecomcs.servicer_status_change` |
|
||||
| Conversation accepted, transferred, closed or reopened | `wecomcs.session_status_change` |
|
||||
| Customer message rejection changed | `wecomcs.reject_customer_msg_switch_change` |
|
||||
|
||||
Recall events include the original message ID, operator and chat ID. Customer-service events retain account, customer and event-specific fields such as `welcome_code`, `fail_type` and `change_type`. Unknown events preserve their payload through `platform.specific`.
|
||||
|
||||
Entering through a service link triggers the entry event; reopening an existing chat from the chat list does not. Configure the processor's handling logic to send a welcome message; receiving the event alone does not send one.
|
||||
|
||||
### Reply windows and welcome messages
|
||||
|
||||
- Ordinary replies require the customer to send a message first and must be sent within 48 hours. Entering a session alone does not open this window. Error `95002` indicates that the sending time restriction was not met.
|
||||
- For entry events, the Agent's `event_reply` uses the dedicated event response API with `welcome_code`. WeChat only supplies this credential when welcome-message conditions are met. It permits one message and expires after 20 seconds. Prefer a fast, fixed welcome message instead of waiting for a long model response.
|
||||
- For session-status changes, `event_reply` uses `msg_code`, subject to its expiration and the current session state. Event replies currently support text. Missing, expired or used credentials cannot be reused; rerunning an old event does not extend their validity.
|
||||
|
||||
See the official [send message](https://developer.work.weixin.qq.com/document/path/94677) and [send event response](https://developer.work.weixin.qq.com/document/path/95122) documentation.
|
||||
|
||||
@@ -8,17 +8,46 @@ Deploy WeChat Official Account bot to connect with LangBot.
|
||||
|
||||
## LangBot WeChat Official Account Integration Modes
|
||||
|
||||
Currently, LangBot provides two ways to integrate with WeChat Official Accounts:
|
||||
The current Official Account adapter supports three modes. Save the bot configuration after changing the mode. Existing bots keep their selected mode; the default remains `drop`. The legacy adapter does not offer `auto`.
|
||||
|
||||
1. **Traditional Message Exchange Mode**
|
||||
- Official accounts require requests to be processed within **15 seconds**, AI-generated content that exceeds this timeout cannot be sent.
|
||||
- When AI content generation timeout occurs, LangBot will print request timeout information in the console.
|
||||
| Mode | How replies are delivered |
|
||||
| --- | --- |
|
||||
| `auto` | Returns a loading message, processes the request in the background, then tries the customer service API. If restricted, queues the answer for retrieval with the next message. |
|
||||
| `passive` | Returns a loading message and queues the answer. The user sends another message to retrieve it. Does not call the customer service API. |
|
||||
| `drop` (default) | Replies within the current callback. Suitable for replies completed within 5 seconds. Does not use the customer service API or fall back to retrieval. |
|
||||
|
||||
2. **"Send Any Text to Get Reply" Mode**
|
||||
- This method can break the **15 second** limit, but **very long text** may not be sent successfully.
|
||||
- When using this method, after sending a message to the official account, it will reply "AI is thinking, please send any content to get the answer". At this point, you need to send any content to get the answer.
|
||||
### How auto works
|
||||
|
||||
For more complex functionality, please contact the **LangBot team** for customized support.
|
||||
`auto` does not query the account's verification status in advance. When the processor sends its reply, LangBot calls the customer service API and uses the actual result:
|
||||
|
||||
- Success: the user receives the answer without sending another message.
|
||||
- Permission denied (`48001`), expired reply window (`45015`), exhausted quota (`45047`), or recipient not following the account (`43004`): the answer is queued for retrieval with the next message.
|
||||
- Other failures, including credentials, IP whitelist and network errors: an error is recorded instead of treating the failure as a permission restriction.
|
||||
|
||||
This decision is made for each reply. An initial loading message does not mean the answer has been generated; check processor execution logs if no answer arrives.
|
||||
|
||||
### Verification and reply windows
|
||||
|
||||
Callbacks require a response within **5 seconds**, regardless of verification. `drop` uses this callback; WeChat retries do not provide a reliable 15-second generation window. See the [official passive reply documentation](https://developers.weixin.qq.com/doc/service/guide/product/message/Passive_user_reply_message.html).
|
||||
|
||||
Customer service messages can be sent after the callback ends. WeChat currently requires enterprise verification for Official Accounts and Service Accounts to use this API. Identity verification alone does not grant this permission; actual account permissions and API responses determine availability.
|
||||
|
||||
| User action | Customer service message quota | Validity |
|
||||
| --- | --- | --- |
|
||||
| Sends a message | 5 messages | 48 hours |
|
||||
| Clicks an eligible custom menu, follows the account, or scans a QR code | 3 messages | 1 minute |
|
||||
|
||||
These are platform limits, not AI generation timeouts. Consult the [official customer service API documentation](https://developers.weixin.qq.com/doc/service/api/customer/message/api_sendcustommessage) for current rules.
|
||||
|
||||
### Retrieving replies
|
||||
|
||||
In `passive`, or after `auto` falls back, the next message retrieves the previous answer and is **not also processed as a new question**. If the answer is still being generated, the loading message is returned again. Retrieve the answer before sending a new question.
|
||||
|
||||
`LoadingMessage` applies to both `auto` and `passive`, not `drop`. For `auto`, use wording such as “Processing your request. If no answer arrives, send any message later to retrieve it.” If empty, LangBot acknowledges the callback without a visible loading message.
|
||||
|
||||
Queued replies are stored in memory and cleared when LangBot restarts or the bot configuration is reloaded. All modes remain subject to WeChat content and message-length limits.
|
||||
|
||||
Route incoming messages to a processor. Reply modes do not automatically send every Agent text output: approve the reply-to-current-conversation tool and instruct the Agent to use it. Plugin processors must call the reply API.
|
||||
|
||||
## Create Bot
|
||||
|
||||
@@ -52,8 +81,8 @@ At this point, open the LangBot Webui page, create a new bot, and fill in the fo
|
||||
|
||||

|
||||
|
||||
In the configuration items, the `Mode` option is the selected integration mode, where the default is `drop`. `drop` is the traditional message exchange mode, and `passive` is the "send any text to get reply" mode.
|
||||
Select `auto`, `passive`, or `drop` in `Mode` using the comparison above. The default is `drop`.
|
||||
|
||||
The `LoadingMessage` option is the loading message, which can be changed to other content, and is only valid when the mode is `passive`. Set `enable` to `true`.
|
||||
The `LoadingMessage` option controls the loading message for `auto` and `passive`. Set `enable` to `true`.
|
||||
|
||||
After filling in successfully, on the LangBot homepage, enable and select the corresponding bot, click to enter the configuration page, copy the Webhook callback address, return to the WeChat Official Account bot configuration page, and fill it into `URL`. For example, if the URL is filled as `https://your_domain_name/bots/xxxxx`, where `your_domain_name` is the domain name filled in Caddy. Click Save. If it can be saved successfully, it means the deployment is successful. If you see **System error, please try again later**, please recheck whether the above configuration content is filled in correctly.
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
After Width: | Height: | Size: 102 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 195 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 91 KiB |
|
After Width: | Height: | Size: 143 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 1.2 MiB |
@@ -0,0 +1,33 @@
|
||||
---
|
||||
title: "企業サポート購読"
|
||||
description: "LangBot エンタープライズサポート — 企業サポート購読"
|
||||
---
|
||||
|
||||
完全なオープンソース版 LangBot を使いながら、公式サポート窓口、問題の一次切り分け、セキュリティ情報、調達用の契約書と請求書を利用できます。購読料は継続的な開発も支えます。
|
||||
|
||||
LangBot は Apache License 2.0 の下で無料で提供されます。本サービスは商用利用ライセンスではなく、未契約の企業による利用も制限しません。
|
||||
|
||||
## 企業サポートプラン
|
||||
|
||||
- 北京浪波智能科技有限公司との契約・請求書発行
|
||||
- 年次サポート購読証明書
|
||||
- 同意に基づく支援企業一覧への掲載(匿名可)
|
||||
- 企業チケット受付、2 営業日以内の初回有人応答
|
||||
- 四半期ごとの公開リリース・セキュリティ情報まとめ、重大な問題の通知
|
||||
- 年 1 回、60 分のオンライン利用状況レビュー
|
||||
- 公開ロードマップ提案の優先審査(開発の確約なし)
|
||||
|
||||
## 企業保障プラン
|
||||
|
||||
- 企業サポートプランの全内容
|
||||
- 本番インスタンス 1 件の登録
|
||||
- 追加で年 4 回まで、各 60 分のリモート技術相談
|
||||
- 更新前の互換性相談と障害の優先切り分け
|
||||
- 再現・確認済みの LangBot Core 不具合を優先修正キューへ登録
|
||||
- 年 1 回のバージョン・依存関係・セキュリティ状態の説明
|
||||
|
||||
[サポートプランを選ぶ](https://langbot.app/ja/enterprise)
|
||||
|
||||
契約企業単位の年額料金で、人数課金ではありません。価格は人民元です。税金、請求書の種類、サービス期間は正式な見積・契約によります。
|
||||
|
||||
[サービス範囲と応答方針](/ja/enterprise/service-scope) · [サポートチケットの送信](/ja/enterprise/submit-ticket) · [調達と提供物](/ja/enterprise/procurement)
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
title: "調達と提供物"
|
||||
description: "LangBot エンタープライズサポート — 調達と提供物"
|
||||
---
|
||||
|
||||
1. 企業名、希望プラン、利用状況をメールで連絡。
|
||||
2. 範囲、税金、請求書を確認し、年間契約を締結。
|
||||
3. 契約に従い支払い、担当者・Space アカウント・期間を登録。
|
||||
4. 証明書とサービス説明を受領し、Space で依頼を送信。
|
||||
|
||||
[[email protected]](mailto:[email protected])
|
||||
|
||||
## 契約と請求書
|
||||
|
||||
契約主体:**北京浪波智能科技有限公司**。
|
||||
|
||||
契約対象:**LangBot オープンソースソフトウェアの年間保守、バージョン情報および技術サポートサービス**。
|
||||
|
||||
契約企業単位の年額料金で、人数課金ではありません。税金、請求書の種類、期間は正式見積と契約で確認します。財務担当が発行可能な区分を確認し、寄付や追加商用ライセンス料として扱いません。海外向け請求、通貨、対応言語は個別に確認します。翻訳ページは日本の税務請求書や日本語の有人対応を保証しません。
|
||||
|
||||
## 開始時の提供物
|
||||
|
||||
- 注文・契約書、期間、指定担当者。
|
||||
- 追加ソフトウェア利用許諾ではなくサポート関係を証明する年間購読証明書。
|
||||
- 版を明記した範囲・応答説明、工単案内、Space アカウント登録。
|
||||
- 保障プランの本番 1 インスタンス登録と相談枠。
|
||||
- 別途同意した場合の支援企業一覧への掲載(匿名可)。
|
||||
|
||||
四半期の公開保守まとめ、チケット、相談の記録を保存します。保障プランには年次のバージョン・依存関係・安全状態の説明も含みます。後日のページ更新は既存契約の特典を自動変更しません。
|
||||
|
||||
## 更新
|
||||
|
||||
更新は別途合意し、自動引き落としは前提としません。開始・終了、解約、返金は契約によります。満了後も Apache 2.0 の利用は制限しません。Cloud 資源、モデル利用枠、ホスティングは別商品です。
|
||||
|
||||
最初の連絡では企業名、希望プラン、利用概要をお送りください。請求情報は契約時に非公開の方法で提供し、公開 issue や GitHub に記載しないでください。
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
title: "サービス範囲と応答方針"
|
||||
description: "LangBot エンタープライズサポート — サービス範囲と応答方針"
|
||||
---
|
||||
|
||||
## 対象
|
||||
|
||||
- LangBot Core の不具合確認と一次切り分け
|
||||
- 公式ドキュメントの案内と更新互換性の助言
|
||||
- 公開リリース情報とセキュリティ告知
|
||||
|
||||
## 対象外
|
||||
|
||||
- 導入代行、運用代行、24 時間対応、常駐
|
||||
- 顧客のネットワーク、データベース、Kubernetes、モデル提供者の障害調査
|
||||
- プラグイン、第三者アダプター、非公開プロトコルクライアントの保守
|
||||
- カスタム開発、過去データの移行
|
||||
- 復旧 SLA、修正期限の保証、適合性認証
|
||||
|
||||
## 初回応答と解決
|
||||
|
||||
初回応答は担当者による範囲の確認、追加資料の依頼、一次切り分けと次の対応案を意味します。自動受付通知は含みません。両プランとも 2 営業日以内に初回応答しますが、復旧や修正の期限は保証しません。
|
||||
|
||||
受付時間は北京時間(Asia/Shanghai)の 09:00–18:00、中国本土の法定営業日(振替出勤日を含む)です。時間外の依頼は次の営業日 09:00 起算、期限は起算日の翌営業日から数えて 2 営業日目の同時刻です。休日・振替がない場合、金曜 14:00 の依頼は火曜 14:00、金曜 20:00 の依頼は月曜 09:00 起算で水曜 09:00 が期限です。
|
||||
|
||||
資料不足でも初回応答期限内に必要な資料を案内します。その後の調査は情報の完全性と再現性に依存します。優先切り分けは短時間での復旧 SLA ではありません。
|
||||
|
||||
## 対象ソフトウェアとバージョン
|
||||
|
||||
対象は LangBot Core の現行安定版です。旧版には更新案内を行い、不具合確認では現行安定版での再現をお願いする場合があります。過去版への修正、LTS、顧客専用パッチは約束しません。公式プラグインや第三者コンポーネントも自動的に Core 保守の対象にはなりません。
|
||||
|
||||
基本プランは一次切り分け、資料案内、不具合確認を含み、顧客環境の継続的な遠隔調査は含みません。保障プランの技術相談は予約制で、追加の年 4 回・各 60 分までの枠を使用します。年 1 回・60 分の利用状況レビューは別枠で、合計最大 5 回です。未使用枠は繰り越しません。
|
||||
|
||||
1 チケットにつき 1 問題とし、重複は統合する場合があります。公開の不具合は重大度、影響範囲、再現性により対応します。優先修正キューやロードマップ優先審査は、修正日、開発、納期を保証しません。
|
||||
|
||||
## インスタンス登録とセキュリティ情報
|
||||
|
||||
保障プランは登録された本番インスタンス 1 件を対象とします。登録はサポート範囲を定め、Apache 2.0 で許される導入数を制限しません。バージョン、構成概要、用途、担当者を記録し、ライセンスサーバーや遠隔測定は不要です。置換前にチケットで登録を更新してください。複数環境へ自動的に対象を拡張しません。
|
||||
|
||||
四半期まとめは公開情報を共用します。重大な問題の通知は保守者が確認した告知に基づき、基本プランでは一般通知を送り顧客環境への影響判定は約束しません。年次の状態説明は登録版と公開情報に基づき、監査、侵入試験、適合性認証、脆弱性ゼロの保証ではありません。
|
||||
|
||||
## 契約上の条件
|
||||
|
||||
対応言語、担当者、期間、適用する説明の版は契約で確認します。満了後の新規依頼は対象外です。既存チケットは契約に従い切り分けや引き継ぎを行い、無期限の修正義務にはなりません。オープンソースの利用は継続できます。
|
||||
|
||||
グループチャットでの無制限対応や毎月の Office Hour は契約特典ではありません。カスタム開発は対象外です。汎用的な提案は公開ロードマップへ提出でき、別案件は個別に可否と見積を検討します。
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
title: "サポートチケットの送信"
|
||||
description: "LangBot エンタープライズサポート — サポートチケットの送信"
|
||||
---
|
||||
|
||||
[契約済み:チケットを送信](https://space.langbot.app/profile?tab=tickets&language=ja)
|
||||
|
||||
契約に登録した Space アカウントでログインし、プロフィールのチケット画面から企業サポートの問題受付、または企業保障の更新・相談を選んでください。テンプレートはログインユーザーが利用できますが、企業特典は契約、登録アカウント、有効期間の確認後に適用されます。契約番号だけでは本人確認になりません。
|
||||
|
||||
## 提供する情報
|
||||
|
||||
- 購読・契約番号、企業名、依頼種類、概要。
|
||||
- 不具合:LangBot バージョン、導入方法、期待結果と実際の結果、再現手順、業務への影響。
|
||||
- 機密情報を除去したログ抜粋。取得できない場合は理由を記入。トークン、パスワード、会話全文、個人情報、設定ファイル原本を送信しないでください。
|
||||
- 更新・相談:登録インスタンス、該当する現在版と更新先、相談目的、希望日時。
|
||||
- 文書・調達資料の質問に架空のログや再現手順は不要です。相談フォームに内容を記入してください。技術相談枠は保障プランの特典です。
|
||||
|
||||
フォームはテキストを収集し、インスタンス情報の自動収集や診断パック生成は行いません。画像は必要な匿名化済み画面のみ添付してください。脆弱性の詳細を公開 GitHub issue に投稿しないでください。
|
||||
|
||||
## 受付後
|
||||
|
||||
契約と範囲を確認してから、文書案内、追加情報の依頼、対象となる相談予約、Core 不具合の確認、または対象外の説明を行います。自動メールは初回有人応答に含みません。
|
||||
|
||||
汎用不具合の公開保守には必要な匿名化済み再現情報のみを利用します。契約、顧客ログ、業務情報は GitHub に自動転送しません。同じチケットで情報を追加してください。
|
||||
@@ -11,4 +11,4 @@ description: "LangBot コミュニティリソース:オープンソース AI
|
||||
|
||||
## 🥰 コミュニティ
|
||||
|
||||
Discordコミュニティに参加してください: [](https://discord.gg/wdNEHETs87)
|
||||
Discordコミュニティに参加してください: [Discord](https://discord.gg/wdNEHETs87)
|
||||
|
||||
@@ -30,19 +30,6 @@ LangBotは、**オープンソースで本番運用に耐える**、LLM ネイ
|
||||
以下のプロンプトを AI アシスタントにコピーしてください。公式ドキュメントを読み、環境と目的に合った方法でサポートします。
|
||||
|
||||
```text
|
||||
LangBot の導入と利用を手伝ってください。まず公式ドキュメントを読み、私の環境に合った方法を提案してください。
|
||||
|
||||
日本語ドキュメント索引 https://langbot.app/docs/ja/llms.txt と、次の主要ページを読んでください。
|
||||
- 機能概要:https://langbot.app/docs/ja/insight/features.md
|
||||
- 対応プラットフォーム:https://langbot.app/docs/ja/insight/platform-features.md
|
||||
- ボット設定:https://langbot.app/docs/ja/usage/platforms/readme.md
|
||||
- モデル設定:https://langbot.app/docs/ja/usage/models/readme.md
|
||||
- パイプライン:https://langbot.app/docs/ja/usage/pipelines/readme.md
|
||||
|
||||
最初に、使いたいチャットプラットフォームとモデル、既存の LangBot 環境の有無を確認してください。導入が必要なら、OS、サーバーまたはローカル環境、クラウドかセルフホストかの希望を確認し、索引から該当する導入・接続ガイドを読んでください。コマンドや設定項目は推測しないでください。
|
||||
|
||||
ドキュメントに基づいて、導入、ボット接続、モデル、パイプラインの設定を支援してください。実行ツールがあれば、私が許可した環境内で実行して結果を検証し、なければ環境に合った操作手順を案内してください。既存の環境があれば優先して利用してください。設定の上書き、データ削除、課金を伴う操作は事前に確認し、チャットにシークレットを貼り付けるよう求めないでください。
|
||||
|
||||
最後に実際のテストメッセージを送り、ボットが返信することを確認するまで手伝ってください。基本機能が動いてから、必要に応じてナレッジベース、プラグイン、MCP、スキルを案内してください。文書を読めない場合や操作が失敗した場合は明示し、未検証の作業を完了したと報告しないでください。
|
||||
まず https://langbot.app/llms.txt を読み、公式の手順に従って LangBot の導入と利用、LangBot CLI のインストール、CLI によるインスタンスの設定と管理を手伝ってください。目的と環境に合わせ、既存のインスタンスがあれば再利用し、最後に対象のチャットプラットフォームで実際のメッセージと返信を確認してください。日本語で説明してください。
|
||||
```
|
||||
</Tip>
|
||||
|
||||
@@ -6,7 +6,7 @@ icon: "/images/platforms/dingtalk.svg"
|
||||
|
||||
DingTalk に LangBot をデプロイします。
|
||||
|
||||
## 一键設定(おすすめ)
|
||||
## ワンクリック設定(おすすめ)
|
||||
|
||||
LangBot は DingTalk アプリのワンクリック作成とクレデンシャルの自動入力に対応しています。手動でのコピペは不要です。
|
||||
|
||||
@@ -16,7 +16,7 @@ LangBot は DingTalk アプリのワンクリック作成とクレデンシャ
|
||||
|
||||

|
||||
|
||||
4. DingTalk で QR コードをスキャンし、手机端で组织を選択
|
||||
4. DingTalk で QR コードをスキャンし、スマートフォンで組織を選択
|
||||
|
||||

|
||||
|
||||
@@ -24,22 +24,62 @@ LangBot は DingTalk アプリのワンクリック作成とクレデンシャ
|
||||
|
||||

|
||||
|
||||
6. 認証成功後、手机端に「設定成功」と表示され、Client ID と Client Secret が LangBot WebUI に**自動入力**されます
|
||||
6. 認証成功後、スマートフォンに「設定成功」と表示され、Client ID と Client Secret が LangBot WebUI に**自動入力**されます
|
||||
|
||||

|
||||
|
||||
7. **ボット名を手動で入力**(DingTalk のボット名と一致させる必要があります)と**ロボットコード**(画像/ファイル機能に必須、DingTalk 開発者コンソール > ボット設定から取得)を入力
|
||||
|
||||

|
||||
|
||||
8. **送信** をクリックして完了
|
||||
7. **送信** をクリックして完了します。LangBot がボットの識別情報を自動的に取得します。
|
||||
|
||||
<Warning>
|
||||
一键設定後、テキストの送受信はすぐに利用できます。ただし:
|
||||
- **画像/ファイル対応**:ロボットコード(RobotCode)の入力が必要です。一键設定時に未入力の場合は、DingTalk 開発者コンソール > ボット設定から取得して入力してください
|
||||
- **ストリーミング返信**:カードテンプレート ID の手動設定が必要です。下記「ボットの設定」のカードテンプレート作成セクションを参照してください
|
||||
ワンクリック設定ではアプリの認証情報が入力されますが、カードテンプレートは作成されません。ストリーミング返信には LangBot の返信テンプレートをインポートし、Use Card Replies を有効にして Card Template ID を設定すると自動的に有効になります。スイッチを無効にすると、テンプレート ID を削除せずにプレーンテキストで返信できます。人工入力には別のテンプレートをインポートし、Human Input Card Template ID を設定してください。DingTalk アプリのカード権限も必要です。
|
||||
</Warning>
|
||||
|
||||
## カードテンプレートの設定(LangBot 提供のテンプレートを推奨)
|
||||
|
||||
カード返信には、LangBot が提供するテンプレートをインポートしてください。コンポーネントや変数を手動で設定する必要はありません。DingTalk アプリで必要なカード権限を有効にしてから、用途に応じたテンプレートを選びます。
|
||||
|
||||
| 用途 | ダウンロードするファイル | LangBot の設定項目 |
|
||||
| --- | --- | --- |
|
||||
| 思考と回答を分けて表示するストリーミング返信 | `dingtalk_stream_card.json` | Card Template ID |
|
||||
| ユーザーの入力・選択・確認を待って処理を続行 | `dingtalk_human_input_card.json` | Human Input Card Template ID |
|
||||
|
||||
### ストリーミング返信テンプレートの作成とインポート
|
||||
|
||||
1. DingTalk アダプター設定の **Card Template ID** の下にある **Download Streaming Reply Card Template** をクリックします。
|
||||
2. [DingTalk カードプラットフォーム](https://open-dev.dingtalk.com/fe/card)でボットアプリと同じ組織を選び、**新規テンプレート**を作成します。
|
||||
3. 名前を入力し、カード種類を **メッセージカード(消息卡片)**、シナリオを **AI カード(AI 卡片)** に設定します。現在のボットアプリを関連付け、作成方法で **空白から作成(空白搭建)** を選び、**空白テンプレートを作成(创建空白模板)** をクリックします。
|
||||
|
||||

|
||||
|
||||
4. エディター上部の **その他 → カードテンプレートをインポート(更多 → 导入卡片模板)** から `dingtalk_stream_card.json` を選択します。
|
||||
|
||||

|
||||
|
||||
<Note>
|
||||
インポート項目はテンプレート一覧ではなく、エディター内にあります。インポートすると現在の内容が置き換わるため、新しい空白テンプレートを使用してください。インポートしたコンポーネント、変数、イベントの設定は維持します。
|
||||
</Note>
|
||||
|
||||
5. プレビューを確認して**保存・公開**し、テンプレート ID をコピーします。下書きの保存だけでは送信できません。`param.templateUnpublished` はテンプレートが未公開であることを示します。
|
||||
6. LangBot の **Use Card Replies** を有効にし、**Card Template ID** に ID を入力して保存すると、ストリーミング返信が有効になります。スイッチを無効にするとプレーンテキストで返信し、テンプレート設定は非表示になりますが保持されます。再度有効にすると設定を再利用できます。
|
||||
|
||||
テンプレートには LangBot の表示があり、思考と回答を別々に表示します。生成中は思考欄が開き、完了後は折りたたまれます。クリックで再び展開できます。下部には回答のコピー、高評価・低評価、AI 生成コンテンツの表示があります。思考を削除するかどうかはパイプライン設定に従い、削除する場合は思考欄を表示しません。通常メッセージで思考を保持する場合は、`<think>` と `</think>` を文字として表示し、空行で回答と区切ります。
|
||||
|
||||
カードの自動ワイドレイアウトはデフォルトで有効です。提供する返信テンプレートには必要な変数が含まれています。既存のボットで無効にして保存している場合は、有効にして設定を保存してください。幅の狭い表示を希望する場合は無効のままでも使用できます。
|
||||
|
||||
更新時は最新版をダウンロードして再インポートし、保存・公開してください。別のテンプレートを作成した場合は LangBot 側の ID も変更します。`content` のみを使用する既存テンプレートも利用できますが、新しい思考欄の分離表示には対応しません。
|
||||
|
||||
## 人工入力カードテンプレートのインポート
|
||||
|
||||
人工入力は、ワークフローやプラグインがユーザーの情報入力・選択・確認を待ってから処理を続ける場面で使用します。Dify の Human Input ノードなどが該当します。通常のチャットやストリーミング返信だけなら、このテンプレートは不要です。
|
||||
|
||||
1. **Human Input Card Template ID** の横にある **Download Human Input Card Template** から `dingtalk_human_input_card.json` を保存します。
|
||||
2. 上記と同じ手順で、別の **メッセージカード → AI カード → 空白から作成** テンプレートを作り、ボットアプリを関連付けます。
|
||||
3. エディターの **その他 → カードテンプレートをインポート** から人工入力用 JSON を読み込みます。入力欄、ボタン、変数、イベントの設定は維持します。
|
||||
4. **保存・公開**し、その ID を LangBot の **Human Input Card Template ID** に入力して設定を保存します。
|
||||
|
||||
2 種類のテンプレートは別々にインポートし、対応する設定項目に ID を入力してください。人工入力テンプレートはストリーミング返信テンプレートの代わりにはならず、ストリーミング返信を自動で有効にすることもありません。
|
||||
|
||||
|
||||
---
|
||||
|
||||
## 手動設定
|
||||
@@ -71,45 +111,17 @@ LangBot は DingTalk アプリのワンクリック作成とクレデンシャ
|
||||
|
||||

|
||||
|
||||
さらに、カードメッセージの場合、主にカードテンプレートを作成し、テンプレート ID を記録して設定に入力する必要があります。手順は以下の通りです:
|
||||
> カードコンテンツテンプレート ID は、開発者バックエンドにログイン > [カードプラットフォーム](https://open-dev.dingtalk.com/fe/card?spm=ding_open_doc.document.0.0.33cf2281L0fXsV)から取得できます
|
||||
|
||||
新しいテンプレートを作成する際に情報を入力します。以下のように:
|
||||

|
||||
|
||||
プリセットテンプレートを選択します(最初のものを選択し、後でテンプレートの内容を変更します)。以下のように:
|
||||

|
||||
使用をクリック
|
||||

|
||||
作成
|
||||

|
||||
|
||||
作成をクリックすると、テンプレートの編集にリダイレクトされます。以下のように、希望するカードメッセージを自由に編集できます:
|
||||

|
||||
|
||||
メインコンテンツについては、デフォルトの「content」をそのままにしておきます:
|
||||

|
||||
|
||||
ワイドスクリーン設定パラメータ。テンプレート変数に . を追加する必要があります。参考[DingTalk ワイドスクリーン設定](https://open.dingtalk.com/document/development/configure-widescreen-cards)
|
||||

|
||||
|
||||
編集を終え、すべて正しいことを確認したら、保存してテンプレート ID をコピーし、設定ファイルに入力します:
|
||||

|
||||

|
||||
カードテンプレートは、上記の手順で LangBot 提供のテンプレートをインポートして公開してください。
|
||||
|
||||
### 設定情報の入力
|
||||
|
||||
「認証情報と基本情報」をクリックし、「Client ID」と「Client Secret」を記録します。
|
||||
「アプリケーション機能」、「ロボット」をクリックし、RobotCode とロボット名を記録します。
|
||||
`markdown_card` は Markdown 形式の返信を有効にするかどうかです。この設定項目が無効になっている場合、`@送信者` 設定スイッチは有効になりません。
|
||||
この認証情報を LangBot のアダプター設定に入力します。
|
||||
`markdown_card`(Use Card Replies)は Markdown とストリーミングカード返信の共通スイッチです。有効でテンプレートが設定されていればストリーミング、未設定なら通常の Markdown で返信します。無効にすると設定を保持したままプレーンテキストで返信します。ワークフローの人工入力カードは別途設定します。
|
||||
上記の設定項目を記録し、LangBot ボット設定フォームに入力します
|
||||
|
||||
[カードプラットフォーム](https://open-dev.dingtalk.com/fe/card?spm=ding_open_doc.document.0.0.33cf2281L0fXsV)をクリックし、テンプレートリストから対応するバインドされたテンプレート ID をコピーし、カードテンプレート ID フィールドに入力します。
|
||||
|
||||

|
||||
|
||||
ストリーミング関連:
|
||||

|
||||
|
||||
**LangBot を起動します**。
|
||||
|
||||
@@ -121,3 +133,16 @@ LangBot は DingTalk アプリのワンクリック作成とクレデンシャ
|
||||
ボットをクリックしてチャットします。
|
||||
|
||||
グループに追加したい場合は、DingTalk グループの「グループ管理」、「ロボット」、「ロボットを追加」をクリックし、ボット名を検索してグループで使用します。
|
||||
|
||||
## イベント購読
|
||||
|
||||
DingTalk アプリ管理画面のイベント購読で Stream モードを選択し、必要なイベントを有効にしてください。ロボットのメッセージ受信設定とは別の設定です。
|
||||
|
||||
- `chat_add_member` → `group.member_joined`(メンバーごとに通知)。
|
||||
- `chat_remove_member` / `chat_quit` → `group.member_left`(削除と自主退出を区別)。
|
||||
- `chat_update_title` / `chat_update_owner` → `group.info_updated`。
|
||||
- 通常のカード操作 → `dingtalk.card_action`。識別可能な評価は `feedback.received`、管理対象フォームは既存の対話処理に渡し、重複実行を防ぎます。
|
||||
- グループ解散などその他の購読イベントは `platform.specific` に渡し、`action` にイベント名、`data` に元のヘッダーとデータを保持します。
|
||||
|
||||
グループイベントにはアプリ権限とグループ種別の制限があります。unionId のみを含むメンバー通知はプラットフォーム固有イベントとして保持します。メッセージ編集・撤回・リアクション、友達申請、ボットのミュートなど、対応するプッシュが未確認のイベントは対応済みと表示しません。
|
||||
|
||||
|
||||
@@ -41,12 +41,38 @@ LangBot は Feishu アプリのワンクリック作成とクレデンシャル
|
||||
|
||||

|
||||
|
||||
7. **ボット名を手動で入力** — 飛書のボット名と一致させる必要があります。一致しない場合、グループ内でメッセージを受信できません
|
||||
7. 新しいアダプターはボットを自動識別するため、グループ内のメンション認識用のボット名は不要です。旧版アダプターでこの項目が表示される場合は、飛書のボット名と一致させてください。
|
||||
|
||||

|
||||
|
||||
8. **送信** をクリックして完了
|
||||
|
||||
### 権限とイベント購読の追加
|
||||
|
||||
<Note>
|
||||
QR コードで作成・認証したアプリには、必要な権限やイベント購読がすべて設定されているとは限りません。メッセージを送受信できても、メンバーの参加・退出イベントは未購読の場合があります。ボットを作り直す必要はなく、開発者コンソールで既存のアプリに設定を追加できます。
|
||||
</Note>
|
||||
|
||||
1. [Feishu 開発者コンソール](https://open.feishu.cn/app)または [Lark 開発者コンソール](https://open.larksuite.com/app)で、作成・認証したアプリを選択します。App ID で確認できます。
|
||||
2. **権限管理**で必要な権限を追加します。権限は、ボットが利用できるデータや操作を決めます。
|
||||
3. **イベントとコールバック > イベント設定**で必要なイベントを購読します。購読は LangBot に送信される通知を決める設定です。権限を追加するだけではイベントは購読されません。
|
||||
4. 設定を保存し、プラットフォームから求められるバージョン公開や管理者承認を完了します。有効になった後で再度イベントを発生させて確認してください。購読前の操作は自動再送されません。
|
||||
|
||||
<Warning>
|
||||
**イベントを追加した後は、アプリの新しいバージョンを公開してください。** 開発者コンソールの**バージョン管理と公開**で公開を完了し、管理者承認が必要な場合は承認を待ちます。イベントを追加・保存しただけでは、公開待ちの変更は有効になりません。LangBot が正常に接続されていても、これらのイベントが届かない場合があります。
|
||||
</Warning>
|
||||
|
||||
購読後もメンバーの参加・退出イベントが届かない場合は、まず公開待ち・承認待ちの変更がないか確認してください。新しいバージョンが有効になった後、ボットが参加しているグループでメンバーの参加・退出を再度行い、LangBot のイベント記録を確認します。
|
||||
|
||||
メンバーの参加・退出を受信するには、ボットが対象グループに参加し、次のイベントを購読している必要があります。
|
||||
|
||||
| 機能 | Feishu イベント |
|
||||
| --- | --- |
|
||||
| ユーザーのグループ参加 | `im.chat.member.user.added_v1` |
|
||||
| ユーザーの退出・グループからの削除 | `im.chat.member.user.deleted_v1` |
|
||||
|
||||
ボット自身の参加(`im.chat.member.bot.added_v1`)は別のイベントで、他のメンバーの参加・退出は含まれません。LangBot の**イベントルーティング**でも、対象イベントを Agent またはプラグイン処理器に振り分けてください。パイプラインはメッセージイベントのみを処理します。
|
||||
|
||||
---
|
||||
|
||||
## ボットの作成
|
||||
|
||||
@@ -4,7 +4,114 @@ description: "LangBot で Slack AI ボットを構築。GPT・Claude・Dify 等
|
||||
icon: "/images/platforms/slack.svg"
|
||||
---
|
||||
|
||||
## ボットの作成
|
||||
## クイック設定(推奨)
|
||||
|
||||
**Slack クイック設定**を使うと、LangBot がアプリの権限、メッセージイベント、メッセージタブ、OAuth 戻り先 URL を自動設定します。設定トークンを入力して Slack でインストールを承認し、Socket Mode の場合は App-Level Token を追加してください。
|
||||
|
||||
### 1. ボットを作成して接続方式を選ぶ
|
||||
|
||||
LangBot の **ボット → ボットを作成**で名前を入力し、**Slack** を選んで送信します。設定ページで接続方式を選び、**Slack クイック設定 → 開始**をクリックします。
|
||||
|
||||

|
||||
|
||||
- **Socket Mode(推奨)**:LangBot から Slack に接続するため、公開イベント Webhook は不要です。ローカル環境やプライベートネットワークに適しています。
|
||||
- **Webhook**:Slack がイベントを送信するため、公開 HTTPS エンドポイントが必要です。
|
||||
|
||||

|
||||
|
||||
### 2. App Configuration Tokens を取得する
|
||||
|
||||
[Slack アプリページ](https://api.slack.com/apps)を開き、**Your App Configuration Tokens → Generate Token** で対象のワークスペースを選択します。**Access Token** と **Refresh Token** をそれぞれコピーしてください。既存のトークンがある場合は、そのコピー用ボタンを使用できます。
|
||||
|
||||

|
||||
|
||||
これらはアプリの作成・設定用であり、**実行時に使う Bot Token や App-Level Token とは異なります**。アシスタントの対応する欄に入力し、アプリ名を確認します。
|
||||
|
||||
### 3. URL を確認してアプリを自動作成する
|
||||
|
||||
Socket Mode では **OAuth 戻り先 URL** を確認します。承認後にブラウザーを LangBot に戻す URL で、HTTPS または `http://localhost` を使用でき、末尾は `/api/v1/platform/adapters/slack/setup/callback` です。ブラウザーからアクセスできればよく、イベント Webhook ではありません。リモート環境では、ブラウザーから到達できないサーバー内部のアドレスを指定しないでください。
|
||||
|
||||

|
||||
|
||||
Webhook の場合は **Webhook URL** が表示されます。公開ドメイン、HTTPS、リバースプロキシを確認し、末尾の `/bots/<ボット UUID>` を維持してください。この URL から OAuth 戻り先 URL が生成され、Slack のイベント URL 検証も自動で行われます。
|
||||
|
||||
**作成して自動設定**をクリックし、**Slack で承認**が表示されるまで待ちます。
|
||||
|
||||
### 4. Slack でインストールを承認する
|
||||
|
||||
**Slack で承認**を開き、アプリ名、ワークスペース、権限を確認して **Allow** をクリックします。ワークスペースのポリシーによっては管理者の承認が必要です。完了後、元の LangBot アシスタントに戻ります。
|
||||
|
||||

|
||||
|
||||
### 5. Socket Mode:App-Level Token を追加する
|
||||
|
||||
Webhook の場合はこの手順をスキップします。Socket Mode ではアシスタントの**アプリ設定を開く**から **Basic Information → App-Level Tokens → Generate Token and Scopes** に進みます。
|
||||
|
||||
1. Token Name に `langbot-socket` などの名前を入力します。
|
||||
2. **Add Scope** で **connections:write** を選択します。
|
||||
3. **Generate** をクリックし、生成された `xapp-` トークンをコピーして、アシスタントの **App-Level Token** に入力します。
|
||||
|
||||

|
||||
|
||||
**Token rotation** は無効のままにしてください。作成した同じ Slack アプリのトークンを使用します。手順 2 の Access Token や Refresh Token をここに入力しないでください。
|
||||
|
||||
### 6. 設定を反映し、ルーティングを設定して有効化する
|
||||
|
||||
承認完了が表示されたら、**アダプター設定に入力**をクリックします。Socket Mode では App-Level Token を入力すると、このボタンが有効になります。Bot Token などの認証情報は自動で反映されます。
|
||||
|
||||

|
||||
|
||||
**イベントルーティング → アクションを追加 → 受信メッセージに返信**で、`message.received` に設定済みのパイプラインまたは Agent を指定し、ルートを有効にします。最後に右上の**保存して有効化**をクリックします。
|
||||
|
||||

|
||||
|
||||
### 7. 会話を確認する
|
||||
|
||||
Slack でアプリの **Messages** タブを開き、DM を送信します。ボットをチャンネルに招待してメンションすることもできます。返信が届けば接続成功です。
|
||||
|
||||

|
||||
|
||||
<Info>
|
||||
設定トークンは一時的な設定セッションでのみ使用し、実行用の認証情報として保存しません。セッションは 15 分間有効です。キャンセルしても作成済みの Slack アプリは削除されず、再実行すると別のアプリが作成される場合があります。戻り先ページでエラーが出ても、最初に元のアシスタントで承認完了になっていないか確認してください。
|
||||
</Info>
|
||||
|
||||
返信がない場合は、ボットとメッセージルートが有効か、処理先が正常に動作するか、ボットのログにエラーがないかを確認します。Socket Mode では同じアプリの App-Level Token と `connections:write` 権限を、Webhook では公開 URL と Slack の **Verified** 表示を確認してください。
|
||||
|
||||
## イベント、インタラクション、既存アプリの更新
|
||||
|
||||
クイック設定は以下の購読とインタラクションの受信設定を行います。インストール時にメッセージ、チャンネル、ユーザー、ファイル、リアクションの権限を要求し、リアクションには `reactions:read` を使用します。チャンネルの通常返信には引き続き @メンションが必要です。編集・削除やチャンネル変更のためのメッセージ購読によって、すべての会話に返信することはありません。
|
||||
|
||||
| Slack イベント | LangBot イベント |
|
||||
| --- | --- |
|
||||
| DM、`app_mention` | `message.received` |
|
||||
| `message_changed` / `message_deleted` サブタイプ | `message.edited` / `message.deleted` |
|
||||
| `reaction_added` / `reaction_removed` | `message.reaction`、`is_add` で区別 |
|
||||
| `member_joined_channel` / `member_left_channel` | `group.member_joined` / `group.member_left` |
|
||||
| ボット自身の参加・退出 | 招待者がある場合は `bot.invited_to_group`、退出は `bot.removed_from_group` |
|
||||
| チャンネル名、アーカイブ状態、トピック・用途の変更 | `group.info_updated` |
|
||||
| `block_actions`、`view_submission`、`view_closed`、`shortcut`、`message_action` | `platform.specific`、`action` は `slack.` とコールバック名 |
|
||||
| `app_home_opened`、`app_uninstalled`、`tokens_revoked` | `platform.specific`、`action` は `slack.` とイベント名 |
|
||||
|
||||
ボットのイベントルーティングでハンドラーを設定し、プラットフォームイベントは `action` で区別します。アンインストールとトークン失効は警告ログにも記録され、自動でチャット返信しません。リアクションをモデルへの評価とは自動判定しません。メッセージ ID は Slack の `ts` をチャンネルと組み合わせて識別し、スレッド返信は `thread_ts` を維持します。
|
||||
|
||||
インタラクションは受信確認後に非同期処理します。モーダル送信の確認応答での同期的な項目エラー返却と外部選択肢の読み込みには対応していません。`view_closed` を受信するにはモーダル作成時に `notify_on_close: true` が必要です。ボタン、ショートカット、モーダル自体は自動作成しません。Socket Mode と Webhook の両方で受信できますが、配信は Slack の権限、チャンネルへの参加、接続状態に依存します。
|
||||
|
||||
**LangBot の更新だけでは既存 Slack アプリの権限は更新されません。** アプリを作り直さず、次の設定を追加してください。
|
||||
|
||||
1. **OAuth & Permissions → Bot Token Scopes** で既存権限を維持し、`reactions:read` を追加します。`app_mentions:read`、`chat:write`、`channels:history`、`channels:read`、`groups:history`、`groups:read`、`im:history`、`im:read`、`im:write`、`mpim:history`、`mpim:read`、`users:read`、`files:read`、`files:write` を確認し、**Reinstall to Workspace** で再承認します。
|
||||
2. **Event Subscriptions → Subscribe to bot events** に `app_mention`、`message.im`、`message.channels`、`message.groups`、`message.mpim`、`reaction_added`、`reaction_removed`、`member_joined_channel`、`member_left_channel`、`channel_rename`、`group_rename`、`channel_archive`、`channel_unarchive`、`group_archive`、`group_unarchive`、`app_home_opened`、`app_uninstalled`、`tokens_revoked` を設定します。編集・削除とトピック・用途変更はメッセージのサブタイプであり、個別の購読は不要です。
|
||||
3. **Interactivity & Shortcuts** を有効にします。Webhook の **Request URL** はイベント購読と同じ LangBot `/bots/<ボット UUID>` を指定します。Socket Mode では公開インタラクション URL は不要です。
|
||||
4. Slack の設定を保存し、LangBot のイベントルートを設定します。再インストールで Bot Token が変わった場合は更新してボットを保存してください。
|
||||
|
||||
各フィールドは [Slack App Manifest リファレンス](https://docs.slack.dev/reference/app-manifest/)を参照してください。
|
||||
|
||||
## 手動設定(Webhook)
|
||||
|
||||
以下の画像は基本的な会話設定です。権限、イベント購読、インタラクションの完全な設定は、上の「イベント、インタラクション、既存アプリの更新」の最新リストを使用してください。
|
||||
|
||||
以下は手動 Webhook 設定です。手動で Socket Mode を使う場合は Slack 側で有効にし、Bot Token と App-Level Token を入力して `app_mention` と `message.im` を購読します。イベント Request URL は不要です。
|
||||
|
||||
### ボットの作成
|
||||
|
||||
[Slack App Platform](https://api.slack.com/apps)にアクセスします。
|
||||
|
||||
@@ -29,7 +136,7 @@ icon: "/images/platforms/slack.svg"
|
||||
左側の「App Home」タブに入り、一番下までスクロールして「Message Tab」を見つけ、オンにして
|
||||
「Allow users to send Slash commands and messages from the messages tab」をチェックします。
|
||||
|
||||
## LangBot に接続
|
||||
### LangBot に接続
|
||||
|
||||
左側の「Event Subscriptions」に入り、スイッチをオンにし、「Subscribe to bot events」をクリックし、
|
||||
次の権限を追加します:
|
||||
@@ -39,10 +146,10 @@ icon: "/images/platforms/slack.svg"
|
||||
|
||||

|
||||
|
||||
## ボットの起動
|
||||
### ボットの起動
|
||||
|
||||
<Info>
|
||||
Slack 公式が https を要求しているため、まずドキュメント [HTTP リバースプロキシと SSL の設定](/en/workshop/production/proxy-and-ssl)に従ってリバースプロキシを設定してください。
|
||||
Webhook には公開 HTTPS URL が必要なため、まずドキュメント [HTTP リバースプロキシと SSL の設定](/en/workshop/production/proxy-and-ssl)に従ってリバースプロキシを設定してください。
|
||||
</Info>
|
||||
|
||||
Slack 設定項目を入力した後、**LangBot を起動します**。
|
||||
@@ -52,6 +159,6 @@ LangBot ホームページで Slack ボットを有効にして開き、ボッ
|
||||
上記のすべての設定項目を入力した後、リンクを保存をクリックします。緑色の **Verified** が表示されれば、デプロイは成功です。
|
||||
それ以外の場合は、上記の設定項目が正しく入力されているかどうかを確認してください。
|
||||
|
||||
## 効果のデモンストレーション
|
||||
### 効果のデモンストレーション
|
||||
|
||||

|
||||
|
||||
@@ -4,30 +4,77 @@ description: "LangBot で Telegram AI ボットを構築。GPT・Claude・Gemini
|
||||
icon: "/images/platforms/telegram.svg"
|
||||
---
|
||||
|
||||
## ボットの作成
|
||||
## ボットを作成する
|
||||
|
||||
[Telegram Bot Creation Page](https://t.me/botfather)にアクセスし、プロンプトに従ってボットを作成します。
|
||||
Telegram の公式 [BotFather](https://t.me/BotFather) を開き、`/newbot` を送信します。名前と、末尾が `bot` のユーザー名を設定してください。発行された Token は秘密に保ち、グループやスクリーンショットに含めないでください。
|
||||
|
||||

|
||||
この手順は LangBot 4.11 の新しい Telegram アダプター(内部名 `telegram-omni`)向けです。非推奨の旧アダプターは選択しないでください。
|
||||
|
||||

|
||||
## 設定して有効にする
|
||||
|
||||
作成後、BotFather は API Token を返しますので、安全に保管してください。次に、グループチャットで使用するために「Privacy Mode」をオフにします。
|
||||
1. LangBot で利用可能なモデルプロバイダーとモデルを設定し、Pipeline、Agent、またはプラグインプロセッサーを作成します。
|
||||
2. 「ボット」で新規作成し、Telegram を選択して Token を入力します。
|
||||
3. `message.received` にメッセージプロセッサーを割り当てます。Pipeline は会話フロー、Agent はイベントとツールによる処理に適しています。プラグインは独立してイベントを購読することもできます。
|
||||
4. 必要に応じて Markdown とストリーミングを有効にし、ボットを有効化して保存します。割り当ての変更後も保存が必要です。
|
||||
5. Telegram のプライベートチャットで **Start** を押してテストメッセージを送信します。LangBot の実行記録でも状態と返信ツールの結果を確認してください。
|
||||
|
||||

|
||||
アダプターはロングポーリングを使用するため、LangBot から `api.telegram.org` への接続が必要です。受信用の Webhook を外部公開する必要はありません。同じ Token を複数のポーリングインスタンスで同時に使用しないでください。
|
||||
|
||||
## LangBot に接続
|
||||
### プロセッサーを選ぶ
|
||||
|
||||
LangBot Webui ページを開き、新しいボットを作成します
|
||||
| 方式 | 設定と確認 |
|
||||
| --- | --- |
|
||||
| Pipeline | モデルと起動条件を設定します。グループのメンションやプレフィックスの条件も満たす必要があります。ストリーミング対応プロセッサーでは Telegram のメッセージを段階的に更新できます。 |
|
||||
| Agent | モデル、指示、イベントツールを設定します。`event_reply` などの送信ツールを使うよう指示してください。モデルが文章を生成しただけでは Telegram に届きません。 |
|
||||
| プラグイン | プロセッサーをインストール・設定し、ボットに割り当てて保存します。独立購読とメインプロセッサーは並行して動くため、同じメッセージに二つの返信が返る場合があります。 |
|
||||
|
||||

|
||||
添付ファイルを扱う場合はプロセッサーの Box を有効にし、サンドボックスツールと添付送信機能を使用します。Box が正常に動作していることを確認してください。外部のファイルシステム MCP と Box は別のファイルシステムです。画像の理解には画像入力に対応したモデルも必要です。
|
||||
|
||||
入力後、LangBot を起動します。設定が成功した場合、ログに `[02-02 16:48:15.263] manager.py (68) - [INFO] : Initializing platform adapter 1: telegram` と表示されます。LangBot を実行し続けてください。
|
||||
ストリーミング設定を有効にしても、すべてのツール呼び出しが逐次表示になるわけではありません。Agent の `event_reply` は完成したメッセージを送信します。プラグインのストリーミングは実装によります。Telegram の実際の表示と実行ログをそれぞれ確認してください。
|
||||
|
||||
## ボットの使用
|
||||
## プライベートチャットとグループ
|
||||
|
||||
グループまたはプライベートメッセージでボットを通常どおり使用できるようになりました。
|
||||
プライベートチャットでは先に **Start** を押します。グループではテスト用グループにボットを追加し、ボット宛てコマンドやボットへの返信など、プロセッサーの起動条件に合わせて送信します。
|
||||
|
||||

|
||||
すべてのグループ利用で **Privacy Mode** を無効にする必要はありません。Telegram は宛先付きコマンド、返信、管理者ボット、通常のグループメッセージで配信条件が異なります。通常のメッセージも受信するには、BotFather でプライバシーモードを変更して必要に応じて再追加するか、用途に応じた管理者権限を付与します。[Telegram の公式説明](https://core.telegram.org/bots/features#privacy-mode)も参照してください。
|
||||
|
||||

|
||||
メンバー状態やリアクションの更新には、その更新種別に対する Telegram の管理者要件を満たす必要があります。必要な権限だけを付与し、受信のためだけに削除・メンバー制限・管理者追加などをすべて有効にしないでください。Telegram の配信条件と LangBot の起動条件の両方が適用されます。
|
||||
|
||||
通常のグループをスーパーグループに変更すると ID が変わります。ログの Bot API グループ ID は Telegram Web の URL に含まれる ID とも異なる場合があります。URL から ID を組み立てないでください。
|
||||
|
||||
## 画像・ファイル・ストリーミング
|
||||
|
||||
画像やファイルはメッセージの添付としてプロセッサーに渡されます。質問を明記した画像と内容を検証できるテキストファイルで確認し、「送信しました」という文章だけでなく、実際に返された添付を確認してください。
|
||||
|
||||
ストリーミングの文章は Telegram メッセージを更新して表示し、添付は完了時に別途送信します。生成ファイルは添付出力機能で送信し、サンドボックスのパスだけを返さないようにします。Telegram が写真として処理できない画像は、元の内容を保持するためファイルとして再送信します。
|
||||
|
||||

|
||||
|
||||
## その他のイベント
|
||||
|
||||
必要なイベントに Agent またはプラグインプロセッサーを割り当てます。Pipeline は主にメッセージフロー用です。非メッセージイベントをすべて通常チャットとして扱わないでください。
|
||||
|
||||
| イベント | 発生条件・意味 |
|
||||
| --- | --- |
|
||||
| `message.received` | プライベートまたはグループのメッセージ。対応する添付を含みます。 |
|
||||
| `message.edited` | 送信済みメッセージの編集。 |
|
||||
| `message.reaction` | リアクションの追加・削除。方向は `is_add`、削除した絵文字も `reaction` に残ります。 |
|
||||
| `group.member_joined` | メンバーの参加。 |
|
||||
| `group.member_left` | 退出または削除。`is_kicked` を確認します。 |
|
||||
| `group.member_banned` | ミュートなどの権限制限。グループからの削除とは異なります。 |
|
||||
| `bot.invited_to_group` | ボットの追加。 |
|
||||
| `bot.removed_from_group` | ボットの削除。直前に制限状態だった場合も含みます。 |
|
||||
| `bot.muted` | メッセージ送信権限を失った状態。無期限の場合は `duration: null`。 |
|
||||
| `bot.unmuted` | 送信権限の回復。その他の制限が残っていても発生します。 |
|
||||
| `platform.specific` | 権限変更やコールバックなど。`action` と `data` を確認します。 |
|
||||
|
||||
まず記録のみ行うプラグインで受信を確認してから、返信や管理操作を追加してください。ミュート・削除されたボットはイベントを受け取れても、元のグループに返信できない場合があります。受信成功と送信権限は別々に確認します。
|
||||
|
||||
## トラブルシューティング
|
||||
|
||||
- **返信がない**:有効化状態、保存済みの割り当て、Start、プライバシーモード、起動条件、実行記録を順に確認します。
|
||||
- **返信は届いたが実行は失敗**:実行記録を開いてツールの戻り値を確認します。Telegram に文章があるだけでは処理全体の成功とは判断できません。
|
||||
- **モデルのエラーやタイムアウト**:プロバイダーとモデルを、Telegram の配信問題とは分けて確認します。
|
||||
- **パスだけが返る**:Box、ツール権限、実際の添付送信ツール呼び出しを確認します。
|
||||
- **返信が重複する**:メイン処理と独立購読の重複、複数のポーリングインスタンスを確認します。
|
||||
- **リアクション・メンバーイベントが来ない**:管理者状態とイベントの割り当てを確認します。実メンバーに影響しない専用グループで試してください。
|
||||
|
||||
@@ -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 フォームは既存のコールバック処理を使用し、カードの業務イベントを重複して起動しません。接続、認証、再接続などの低レベル状態はオーケストレーションイベントに含めません。
|
||||
|
||||
### 効果の画像
|
||||
|
||||

|
||||
|
||||
@@ -33,4 +33,53 @@ LangBot 設定ページの提交をクリックして 로봇を有効化し、We
|
||||
|
||||
ページの Secret をコピーし、新しく作成した LangBot 企業微信カスタマーサービス 로봇を開き、新しい Secret を入力して再起動します。
|
||||
|
||||
企業微信カスタマーサービス設定画面に戻り、カスタマーサービスアカウントをクリックしてカスタマーサービスアカウントを作成すれば、使用できます。
|
||||
## 問い合わせリンクと QR コードを取得する
|
||||
|
||||
コールバックの設定後、WeChat ユーザーが問い合わせを開始するためのリンクまたは QR コードを取得します。
|
||||
|
||||
1. [WeChat カスタマーサービス管理画面](https://kf.weixin.qq.com/kf)に戻り、`客服帐号`(カスタマーサービスアカウント)から、LangBot に接続するアカウントを作成または選択します。
|
||||
2. アカウントの接続ページを開き、`在微信外App/网页中接入`(WeChat 外のアプリ・Web ページに接続)までスクロールして、`去接入` をクリックします。
|
||||
|
||||

|
||||
|
||||
3. 接続ページ上部の対象アカウントで、`复制链接` をクリックすると問い合わせリンクをコピーでき、`生成二维码` をクリックすると QR コードを表示できます。
|
||||
|
||||

|
||||
|
||||
<Note>
|
||||
スクリーンショットのリンクは例です。自分のアカウントで生成したリンクまたは QR コードを使用してください。Webhook コールバック URL は LangBot へのイベント通知用で、問い合わせリンクと QR コードはユーザーが会話を開始するためのものです。
|
||||
</Note>
|
||||
|
||||
## QR コードで動作を確認する
|
||||
|
||||
1. LangBot のボットを有効にし、イベントルーティングで「メッセージ受信」イベントを使用するプロセッサーに割り当てます。
|
||||
2. 通常の WeChat で生成した QR コードを読み取り、カスタマーサービスの会話を開いてメッセージを送信します。
|
||||
3. LangBot のボットログ、セッション監視、対象プロセッサーの実行ログで受信と処理を確認し、WeChat に返信が届くことを確認します。
|
||||
|
||||
QR コードで動作を確認するだけなら、接続ページ下部のアプリ連携を設定する必要はありません。
|
||||
|
||||
## ルーティングできるイベント
|
||||
|
||||
ボットのイベントルーティングで、イベントごとにプロセッサーを選択できます。通常のメッセージにはパイプラインまたは Agent、それ以外には対象イベントに対応した Agent またはプラグインプロセッサーを使用します。
|
||||
|
||||
| イベント | イベントタイプ |
|
||||
| --- | --- |
|
||||
| メッセージ受信 | `message.received` |
|
||||
| 顧客または担当者によるメッセージ撤回 | `message.deleted` |
|
||||
| 顧客がリンクから会話に参加 | `wecomcs.enter_session` |
|
||||
| メッセージ送信失敗 | `wecomcs.msg_send_fail` |
|
||||
| 担当者の受付状態変更 | `wecomcs.servicer_status_change` |
|
||||
| 会話の受付、転送、終了、再開 | `wecomcs.session_status_change` |
|
||||
| 顧客メッセージの受信拒否設定変更 | `wecomcs.reject_customer_msg_switch_change` |
|
||||
|
||||
撤回イベントには元のメッセージ ID、操作者、チャット ID が含まれます。カスタマーサービス固有のイベントにはアカウント、顧客、`welcome_code`、`fail_type`、`change_type` などの関連フィールドが含まれます。未知のイベントは `platform.specific` として元のデータを保持します。
|
||||
|
||||
会話への参加イベントはリンクから入った場合に発生し、既存のチャット一覧から開いても発生しません。歓迎メッセージを送るにはプロセッサーの処理を設定してください。イベントの受信だけでは送信されません。
|
||||
|
||||
### 返信期限と歓迎メッセージ
|
||||
|
||||
- 通常の返信には顧客からのメッセージが必要で、48 時間以内に送信する必要があります。会話への参加だけではこの条件を満たしません。エラー `95002` は送信期限の条件を満たしていないことを示します。
|
||||
- 参加イベントでの Agent の `event_reply` は、専用のイベント応答 API と `welcome_code` を使います。このコードは歓迎メッセージの条件を満たす場合のみ提供され、送信できるのは 1 件、有効期限は 20 秒です。時間のかかるモデル生成より、すぐに送信できる固定文面を推奨します。
|
||||
- 会話状態変更イベントの `event_reply` は `msg_code` を使用し、有効期限と現在の会話状態による制限を受けます。現在のイベント返信はテキストに対応しています。コードがない場合、期限切れの場合、使用済みの場合は再送できません。古いイベントを再実行しても有効期限は延長されません。
|
||||
|
||||
詳細は公式の[メッセージ送信](https://developer.work.weixin.qq.com/document/path/94677)と[イベント応答送信](https://developer.work.weixin.qq.com/document/path/95122)を参照してください。
|
||||
|
||||
@@ -8,17 +8,46 @@ WeChat Official Account ボットをデプロイして LangBot に接続しま
|
||||
|
||||
## LangBot WeChat Official Account 統合モード
|
||||
|
||||
現在、LangBot は WeChat Official Accounts と統合する 2 つの方法を提供しています:
|
||||
新しい公式アカウントアダプターでは、次の 3 種類を選択できます。変更後はボット設定を保存してください。既存の設定は自動変更されず、デフォルトは `drop` です。旧版アダプターには `auto` はありません。
|
||||
|
||||
1. **従来のメッセージ交換モード**
|
||||
- 公式アカウントはリクエストを **15 秒**以内に処理する必要があり、このタイムアウトを超える AI 生成コンテンツは送信できません。
|
||||
- AI コンテンツ生成のタイムアウトが発生すると、LangBot はコンソールにリクエストタイムアウト情報を出力します。
|
||||
| モード | 返信の仕組み |
|
||||
| --- | --- |
|
||||
| `auto` | 処理中のメッセージを返し、バックグラウンドで回答を生成します。カスタマーサービス API で送信し、利用制限がある場合は次のメッセージで受け取る方式に切り替えます。 |
|
||||
| `passive` | 処理中のメッセージを返し、回答を保存します。ユーザーが再度メッセージを送ると受け取れます。カスタマーサービス API は呼び出しません。 |
|
||||
| `drop`(デフォルト) | 現在のコールバック内で返信します。5 秒以内に完了する処理向けです。カスタマーサービス API や受け取り方式への切り替えは使用しません。 |
|
||||
|
||||
2. **「任意のテキストを送信して返信を取得」モード**
|
||||
- この方法は **15 秒**の制限を破ることができますが、**非常に長いテキスト**は正常に送信されない場合があります。
|
||||
- この方法を使用する場合、公式アカウントにメッセージを送信すると、「AI が考えています。回答を得るには任意のコンテンツを送信してください」と返信されます。この時点で、回答を得るために任意のコンテンツを送信する必要があります。
|
||||
### auto の判定方法
|
||||
|
||||
より複雑な機能については、カスタマイズされたサポートのために **LangBot チーム**にお問い合わせください。
|
||||
`auto` は認証状態を事前に取得しません。処理器が回答を送信する際にカスタマーサービス API を呼び出し、その結果で判定します。
|
||||
|
||||
- 成功した場合、追加メッセージを送らずに回答を受信できます。
|
||||
- 権限不足(`48001`)、返信期限切れ(`45015`)、送信枠の上限(`45047`)、受信者が未フォロー(`43004`)の場合、回答を保存し、次のメッセージで受け取れるようにします。
|
||||
- 認証情報、IP ホワイトリスト、ネットワークなどのその他のエラーは記録されます。一律に権限不足として扱うことはありません。
|
||||
|
||||
判定は返信ごとに行います。処理中の表示は回答の生成完了を意味しません。回答が届かない場合は処理器の実行ログを確認してください。
|
||||
|
||||
### 認証と返信期限
|
||||
|
||||
コールバックには認証の有無にかかわらず **5 秒以内**に応答する必要があります。`drop` はこの仕組みを使います。WeChat の再試行を安定した 15 秒の生成時間として利用することはできません。[公式の受動返信ドキュメント](https://developers.weixin.qq.com/doc/service/guide/product/message/Passive_user_reply_message.html)を参照してください。
|
||||
|
||||
カスタマーサービス API ではコールバック終了後も返信できます。現在の公式仕様では、公式アカウントとサービスアカウントは企業主体の認証が必要です。本人確認だけでこの権限が付与されるわけではありません。利用可否は実際の権限と API の応答で決まります。
|
||||
|
||||
| ユーザーの操作 | 送信可能数 | 有効期限 |
|
||||
| --- | --- | --- |
|
||||
| メッセージを送信 | 5 件 | 48 時間 |
|
||||
| 対象のカスタムメニューをクリック、フォロー、QR コードをスキャン | 3 件 | 1 分 |
|
||||
|
||||
これは AI の生成タイムアウトではなく、プラットフォームの制限です。最新の条件は[公式のカスタマーサービス API ドキュメント](https://developers.weixin.qq.com/doc/service/api/customer/message/api_sendcustommessage)を確認してください。
|
||||
|
||||
### 回答の受け取り
|
||||
|
||||
`passive` または `auto` の切り替え後は、次のメッセージは前の回答の受け取りに使われ、**同時に新しい質問として処理されません**。回答が未完成なら処理中の表示を再度返します。回答を受け取ってから新しい質問を送ってください。
|
||||
|
||||
`LoadingMessage` は `auto` と `passive` に適用され、`drop` には適用されません。`auto` では「処理中です。回答が届かない場合は、しばらくしてから任意のメッセージを送って受け取ってください」などを設定できます。空欄の場合は表示用のメッセージを送らずにコールバックの受信を確認します。
|
||||
|
||||
回答はメモリ上に保存され、LangBot の再起動やボット設定の再読み込みで消去されます。どのモードでも WeChat の内容や文字数の制限が適用されます。
|
||||
|
||||
イベントルーティングで処理器を接続してください。モードは Agent のすべてのテキスト出力を自動送信するものではありません。Agent には現在の会話への返信ツールを許可して使用するよう指示してください。プラグイン処理器は返信 API を呼び出す必要があります。
|
||||
|
||||
## ボットの作成
|
||||
|
||||
@@ -52,8 +81,8 @@ WeChat Official Accounts は http(ポート 80)と https(ポート 443)
|
||||
|
||||

|
||||
|
||||
設定項目の「Mode」オプションは、選択された統合モードです。デフォルトは「drop」です。「drop」は従来のメッセージ交換モードで、「passive」は「任意のテキストを送信して返信を取得」モードです。
|
||||
設定項目の「Mode」で、上記の比較を参考に `auto`、`passive`、`drop` を選択してください。デフォルトは `drop` です。
|
||||
|
||||
「LoadingMessage」オプションはローディングメッセージで、他のコンテンツに変更でき、モードが「passive」の場合にのみ有効です。「enable」を「true」に設定します。
|
||||
「LoadingMessage」は `auto` と `passive` の処理中メッセージを設定します。「enable」を「true」に設定します。
|
||||
|
||||
正常に入力した後、LangBot ホームページで対応するボットを有効にして選択し、設定ページをクリックして入り、Webhook コールバックアドレスをコピーし、WeChat Official Account ボット設定ページに戻って「URL」に入力します。たとえば、URL を「https://your_domain_name/bots/xxxxx」として入力します。ここで「your_domain_name」は Caddy に入力したドメイン名です。保存をクリックします。正常に保存できれば、デプロイは成功です。**システムエラー、後でもう一度お試しください**が表示された場合は、上記の設定内容が正しく入力されているかどうかを再確認してください。
|
||||
|
||||
@@ -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、ネットワーク無効化を設定しても、ホストプロセスにサンドボックス境界は作られません。
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export function deploymentGuidance() { return "## Canonical agent entry\n\nRead https://langbot.app/llms.txt first for deployment choices, optional managed hosting, CLI installation and operation, and end-to-end verification. This documentation index supplies the detailed guides referenced by that workflow.\n"; }
|
||||
@@ -167,10 +167,13 @@ export function renderOperation(spec, apiPath, method, locale) {
|
||||
return { route, title: operation.summary, description: `${method.toUpperCase()} ${apiPath}`, url, markdown };
|
||||
}
|
||||
|
||||
import { deploymentGuidance } from "./deployment-guidance.mjs";
|
||||
|
||||
function indexText(pages, locale) {
|
||||
const languages = locale ? [locale] : LOCALES;
|
||||
const prefix = locale ? `${locale}/` : "";
|
||||
const lines = ["# LangBot Documentation", "", "> Canonical documentation for LangBot: deployment, messaging integrations, plugins, development and HTTP API reference.", "", "## Agent resources", "", `- [Complete documentation text](${BASE}/${prefix}llms-full.txt)`, `- [All-language index](${BASE}/llms.txt)`, ""];
|
||||
lines.push(deploymentGuidance(locale), "");
|
||||
for (const language of languages) {
|
||||
lines.push(`## ${language}`, "", `- [${language} documentation index](${BASE}/${language}/llms.txt)`, `- [${language} complete documentation text](${BASE}/${language}/llms-full.txt)`, `- [${language} OpenAPI specification](${BASE}/openapi/service-api-${language}.json)`, "");
|
||||
for (const page of pages.filter((page) => page.route.startsWith(`${language}/`))) {
|
||||
@@ -214,7 +217,7 @@ export async function generateAgentDocs({ root = ROOT, output = path.join(root,
|
||||
const index = indexText(selected, locale);
|
||||
await writeFile(path.join(output, `${prefix}llms.txt`), index);
|
||||
await writeFile(path.join(output, `${prefix}llm.txt`), index);
|
||||
await writeFile(path.join(output, `${prefix}llms-full.txt`), `${selected.map((page) => page.markdown.trim()).join("\n\n---\n\n")}\n`);
|
||||
await writeFile(path.join(output, `${prefix}llms-full.txt`), `${deploymentGuidance(locale)}\n${selected.map((page) => page.markdown.trim()).join("\n\n---\n\n")}\n`);
|
||||
}
|
||||
return { pages: pages.length, documents: documents.length, operations: pages.length - documents.length };
|
||||
}
|
||||
|
||||
@@ -1785,6 +1785,90 @@
|
||||
<xhtml:link rel="alternate" hreflang="ja" href="https://langbot.app/docs/ja/develop/plugin-runtime" />
|
||||
<xhtml:link rel="alternate" hreflang="x-default" href="https://langbot.app/docs/en/develop/plugin-runtime" />
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://langbot.app/docs/en/enterprise/overview</loc>
|
||||
<xhtml:link rel="alternate" hreflang="en" href="https://langbot.app/docs/en/enterprise/overview" />
|
||||
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://langbot.app/docs/zh/enterprise/overview" />
|
||||
<xhtml:link rel="alternate" hreflang="ja" href="https://langbot.app/docs/ja/enterprise/overview" />
|
||||
<xhtml:link rel="alternate" hreflang="x-default" href="https://langbot.app/docs/en/enterprise/overview" />
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://langbot.app/docs/zh/enterprise/overview</loc>
|
||||
<xhtml:link rel="alternate" hreflang="en" href="https://langbot.app/docs/en/enterprise/overview" />
|
||||
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://langbot.app/docs/zh/enterprise/overview" />
|
||||
<xhtml:link rel="alternate" hreflang="ja" href="https://langbot.app/docs/ja/enterprise/overview" />
|
||||
<xhtml:link rel="alternate" hreflang="x-default" href="https://langbot.app/docs/en/enterprise/overview" />
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://langbot.app/docs/ja/enterprise/overview</loc>
|
||||
<xhtml:link rel="alternate" hreflang="en" href="https://langbot.app/docs/en/enterprise/overview" />
|
||||
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://langbot.app/docs/zh/enterprise/overview" />
|
||||
<xhtml:link rel="alternate" hreflang="ja" href="https://langbot.app/docs/ja/enterprise/overview" />
|
||||
<xhtml:link rel="alternate" hreflang="x-default" href="https://langbot.app/docs/en/enterprise/overview" />
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://langbot.app/docs/en/enterprise/procurement</loc>
|
||||
<xhtml:link rel="alternate" hreflang="en" href="https://langbot.app/docs/en/enterprise/procurement" />
|
||||
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://langbot.app/docs/zh/enterprise/procurement" />
|
||||
<xhtml:link rel="alternate" hreflang="ja" href="https://langbot.app/docs/ja/enterprise/procurement" />
|
||||
<xhtml:link rel="alternate" hreflang="x-default" href="https://langbot.app/docs/en/enterprise/procurement" />
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://langbot.app/docs/zh/enterprise/procurement</loc>
|
||||
<xhtml:link rel="alternate" hreflang="en" href="https://langbot.app/docs/en/enterprise/procurement" />
|
||||
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://langbot.app/docs/zh/enterprise/procurement" />
|
||||
<xhtml:link rel="alternate" hreflang="ja" href="https://langbot.app/docs/ja/enterprise/procurement" />
|
||||
<xhtml:link rel="alternate" hreflang="x-default" href="https://langbot.app/docs/en/enterprise/procurement" />
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://langbot.app/docs/ja/enterprise/procurement</loc>
|
||||
<xhtml:link rel="alternate" hreflang="en" href="https://langbot.app/docs/en/enterprise/procurement" />
|
||||
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://langbot.app/docs/zh/enterprise/procurement" />
|
||||
<xhtml:link rel="alternate" hreflang="ja" href="https://langbot.app/docs/ja/enterprise/procurement" />
|
||||
<xhtml:link rel="alternate" hreflang="x-default" href="https://langbot.app/docs/en/enterprise/procurement" />
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://langbot.app/docs/en/enterprise/service-scope</loc>
|
||||
<xhtml:link rel="alternate" hreflang="en" href="https://langbot.app/docs/en/enterprise/service-scope" />
|
||||
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://langbot.app/docs/zh/enterprise/service-scope" />
|
||||
<xhtml:link rel="alternate" hreflang="ja" href="https://langbot.app/docs/ja/enterprise/service-scope" />
|
||||
<xhtml:link rel="alternate" hreflang="x-default" href="https://langbot.app/docs/en/enterprise/service-scope" />
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://langbot.app/docs/zh/enterprise/service-scope</loc>
|
||||
<xhtml:link rel="alternate" hreflang="en" href="https://langbot.app/docs/en/enterprise/service-scope" />
|
||||
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://langbot.app/docs/zh/enterprise/service-scope" />
|
||||
<xhtml:link rel="alternate" hreflang="ja" href="https://langbot.app/docs/ja/enterprise/service-scope" />
|
||||
<xhtml:link rel="alternate" hreflang="x-default" href="https://langbot.app/docs/en/enterprise/service-scope" />
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://langbot.app/docs/ja/enterprise/service-scope</loc>
|
||||
<xhtml:link rel="alternate" hreflang="en" href="https://langbot.app/docs/en/enterprise/service-scope" />
|
||||
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://langbot.app/docs/zh/enterprise/service-scope" />
|
||||
<xhtml:link rel="alternate" hreflang="ja" href="https://langbot.app/docs/ja/enterprise/service-scope" />
|
||||
<xhtml:link rel="alternate" hreflang="x-default" href="https://langbot.app/docs/en/enterprise/service-scope" />
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://langbot.app/docs/en/enterprise/submit-ticket</loc>
|
||||
<xhtml:link rel="alternate" hreflang="en" href="https://langbot.app/docs/en/enterprise/submit-ticket" />
|
||||
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://langbot.app/docs/zh/enterprise/submit-ticket" />
|
||||
<xhtml:link rel="alternate" hreflang="ja" href="https://langbot.app/docs/ja/enterprise/submit-ticket" />
|
||||
<xhtml:link rel="alternate" hreflang="x-default" href="https://langbot.app/docs/en/enterprise/submit-ticket" />
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://langbot.app/docs/zh/enterprise/submit-ticket</loc>
|
||||
<xhtml:link rel="alternate" hreflang="en" href="https://langbot.app/docs/en/enterprise/submit-ticket" />
|
||||
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://langbot.app/docs/zh/enterprise/submit-ticket" />
|
||||
<xhtml:link rel="alternate" hreflang="ja" href="https://langbot.app/docs/ja/enterprise/submit-ticket" />
|
||||
<xhtml:link rel="alternate" hreflang="x-default" href="https://langbot.app/docs/en/enterprise/submit-ticket" />
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://langbot.app/docs/ja/enterprise/submit-ticket</loc>
|
||||
<xhtml:link rel="alternate" hreflang="en" href="https://langbot.app/docs/en/enterprise/submit-ticket" />
|
||||
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://langbot.app/docs/zh/enterprise/submit-ticket" />
|
||||
<xhtml:link rel="alternate" hreflang="ja" href="https://langbot.app/docs/ja/enterprise/submit-ticket" />
|
||||
<xhtml:link rel="alternate" hreflang="x-default" href="https://langbot.app/docs/en/enterprise/submit-ticket" />
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://langbot.app/docs/en/insight/community</loc>
|
||||
<xhtml:link rel="alternate" hreflang="en" href="https://langbot.app/docs/en/insight/community" />
|
||||
|
||||
@@ -23,7 +23,7 @@ function links(node, result = []) {
|
||||
}
|
||||
|
||||
test("every sitemap page has meaningful canonical Markdown and HTML discovery", async () => {
|
||||
assert.equal(urls.length, 494 + zhOnlyArticleRoutes.length);
|
||||
assert.equal(urls.length, 506 + zhOnlyArticleRoutes.length);
|
||||
for (const url of urls) {
|
||||
const route = relative(url);
|
||||
const text = await read(`${route}.md`);
|
||||
|
||||
@@ -170,8 +170,8 @@ test("MDX compatibility normalization removes internal .html route suffixes", ()
|
||||
test("canonical MDX and nested OpenAPI sources are discovered", async () => {
|
||||
const docs = JSON.parse(await readFile(path.join(root, "docs.json"), "utf8"));
|
||||
const pages = await collectMdxDocuments(root);
|
||||
assert.equal(pages.length, 320);
|
||||
assert.deepEqual(Object.fromEntries([...pages.reduce((acc, page) => acc.set(page.split("/", 1)[0], (acc.get(page.split("/", 1)[0]) ?? 0) + 1), new Map()).entries()]), { en: 101, zh: 118, ja: 101 });
|
||||
assert.equal(pages.length, 332);
|
||||
assert.deepEqual(Object.fromEntries([...pages.reduce((acc, page) => acc.set(page.split("/", 1)[0], (acc.get(page.split("/", 1)[0]) ?? 0) + 1), new Map()).entries()]), { en: 105, zh: 122, ja: 105 });
|
||||
assert.deepEqual(collectOpenApiSources(docs), [
|
||||
{ locale: "en", source: "openapi/service-api-en.json", directory: "en/api-reference" },
|
||||
{ locale: "zh", source: "openapi/service-api-zh.json", directory: "zh/api-reference" },
|
||||
@@ -216,7 +216,7 @@ test("prebuild is deterministic and preserves local assets and SEO files", async
|
||||
const first = await prepareFumapress({ root, outRoot: temp });
|
||||
const second = await prepareFumapress({ root, outRoot: temp });
|
||||
assert.deepEqual(first, second);
|
||||
assert.equal(first.documents, 320);
|
||||
assert.equal(first.documents, 332);
|
||||
assert.equal(first.fallbackDefaults, 0);
|
||||
assert.equal(first.localeOnlyDocuments, 17);
|
||||
assert.equal(first.redirects, 103);
|
||||
@@ -239,7 +239,7 @@ test("prebuild is deterministic and preserves local assets and SEO files", async
|
||||
assert.match(troubleshooting, /```dotenv\nLANGBOT_BOX_ROOT=/);
|
||||
assert.doesNotMatch(troubleshooting, /```env(?:\s|$)/m);
|
||||
const dingtalk = await readFile(path.join(temp, "content/docs/usage/platforms/dingtalk.mdx"), "utf8");
|
||||
assert.match(dingtalk, /!\[Don.t modify\]\(\/images\/zh\/deploy\/bots\/dingtalk\/dingtalk13\.png\)/);
|
||||
assert.match(dingtalk, /!\[DingTalk Open Platform\]\(\/images\/zh\/deploy\/bots\/dingtalk\/dingtalk1\.png\)/);
|
||||
assert.doesNotMatch(dingtalk, /\]\(\.\.\/\.\.\/\.\.\/images\//);
|
||||
await readFile(path.join(temp, "public/images/platforms/qq.svg"));
|
||||
await readFile(path.join(temp, "public/images/zh/plugin/dev/dist/github_release.png"));
|
||||
|
||||
@@ -46,7 +46,7 @@ function staticHtmlForUrlPath(urlPath) {
|
||||
|
||||
test("all canonical localized documents have static HTML", async () => {
|
||||
const documents = await collectMdxDocuments(root);
|
||||
assert.equal(documents.length, 320);
|
||||
assert.equal(documents.length, 332);
|
||||
const missing = [];
|
||||
for (const document of documents) {
|
||||
try {
|
||||
|
||||
@@ -35,6 +35,6 @@ test("every localized HTML payload includes the preference client provider", asy
|
||||
}
|
||||
}
|
||||
for (const locale of ["en", "zh", "ja"]) await visit(path.join(root, locale));
|
||||
// 497 canonical content pages plus one framework 404 page per locale.
|
||||
assert.equal(count, 500);
|
||||
// 509 canonical content pages plus one framework 404 page per locale.
|
||||
assert.equal(count, 512);
|
||||
});
|
||||
|
||||
@@ -222,9 +222,10 @@ test("guide preserves the introduction and adds ordered navigation plus a copyab
|
||||
assert.doesNotMatch(guide, /^### \d+\.|127\.0\.0\.1:5300|<Steps>/m);
|
||||
const prompt = guide.slice(assistant).match(/```text\n([\s\S]*?)\n```/);
|
||||
assert.ok(prompt, `${locale}: missing copyable prompt`);
|
||||
assert.ok(prompt[1].includes(`https://langbot.app/docs/${locale}/llms.txt`));
|
||||
assert.ok(prompt[1].includes("https://langbot.app/llms.txt"));
|
||||
assert.ok(prompt[1].includes("CLI"));
|
||||
assert.doesNotMatch(prompt[1], /https:\/\/langbot.app\/docs\//);
|
||||
for (const page of ["insight/features", "insight/platform-features", "usage/platforms/readme", "usage/models/readme", "usage/pipelines/readme"]) {
|
||||
assert.ok(prompt[1].includes(`https://langbot.app/docs/${locale}/${page}.md`));
|
||||
await readFile(new URL(`${locale}/${page}.mdx`, repoRoot), "utf8");
|
||||
}
|
||||
for (const [, href] of guide.matchAll(/(?<!!)\]\((\/[^)]+)\)/g)) {
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
title: "企业支持订阅"
|
||||
description: "LangBot 企业支持订阅 — 企业支持订阅"
|
||||
---
|
||||
|
||||
在继续使用完整开源 LangBot 的同时,获得官方维护关系、企业问题受理、安全更新和采购所需的合同与发票。您的订阅也将直接支持 LangBot 的持续开发。
|
||||
|
||||
LangBot 开源版本仍按 Apache License 2.0 免费提供。企业支持订阅不是商业使用许可,也不会限制未订阅企业继续使用开源版本。
|
||||
|
||||
## 企业支持计划
|
||||
|
||||
- 北京浪波智能科技有限公司签约、开票
|
||||
- 年度企业支持订阅证书
|
||||
- 官网企业支持者名单展示(可匿名,需授权)
|
||||
- 企业工单受理,2 个工作日内首次人工响应
|
||||
- 每季度公开版本与安全更新摘要、严重安全问题通知
|
||||
- 每年一次 60 分钟线上使用情况沟通
|
||||
- 公开 Roadmap 提案优先评审,不承诺开发
|
||||
|
||||
## 企业保障计划
|
||||
|
||||
- 包含企业支持计划全部权益
|
||||
- 1 个生产实例官方登记
|
||||
- 每年额外最多 4 次、每次 60 分钟远程技术咨询
|
||||
- 升级前兼容性咨询、故障优先分诊
|
||||
- 复现并确认的 LangBot Core 缺陷进入优先修复队列
|
||||
- 每年一份版本、依赖与安全状态说明
|
||||
|
||||
[选择适合您的支持计划](https://langbot.app/zh/enterprise)
|
||||
|
||||
按签约企业收取年费,不按人数计费。税费、发票类别及服务起止日期以正式报价与合同为准。
|
||||
|
||||
[服务范围与响应说明](/zh/enterprise/service-scope) · [提交支持工单](/zh/enterprise/submit-ticket) · [企业采购与交付](/zh/enterprise/procurement)
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
title: "企业采购与交付"
|
||||
description: "LangBot 企业支持订阅 — 企业采购与交付"
|
||||
---
|
||||
|
||||
1. 通过邮件联系,说明企业名称、拟订阅档位与使用情况。
|
||||
2. 确认支持范围、税费与发票事项,签订年度服务合同。
|
||||
3. 按合同完成付款,登记联系人、Space 账号及服务期限。
|
||||
4. 收到订阅证书与服务说明,通过 Space 提交支持请求。
|
||||
|
||||
[[email protected]](mailto:[email protected])
|
||||
|
||||
## 合同与开票
|
||||
|
||||
签约主体:**北京浪波智能科技有限公司**。
|
||||
|
||||
合同标的:**LangBot 开源软件年度维护、版本信息与技术支持服务**。
|
||||
|
||||
价格按签约企业收取年费,不按员工人数计费。税费、发票类别与服务期限以正式报价和合同为准;发票内容由财务根据可开票范围确认,不开具虚假的软件商用授权费或捐赠凭证。
|
||||
|
||||
## 开通交付
|
||||
|
||||
- 服务订单与合同、服务期限和指定联系人。
|
||||
- 年度企业支持订阅证书,注明其证明支持服务关系,不构成额外软件授权。
|
||||
- 版本化的服务范围与响应说明、Space 工单入口与账号登记。
|
||||
- 如为保障计划,登记 1 个生产实例以及技术咨询额度。
|
||||
- 官网支持者名称展示须单独授权,可选择匿名。
|
||||
|
||||
履约期间保存季度公开维护摘要、工单记录和咨询记录;保障计划另提供年度版本、依赖与安全状态说明。服务说明页面后续变更不自动修改存量合同权益。
|
||||
|
||||
## 续费与支持关系
|
||||
|
||||
续费另行确认,不默认自动扣款。服务开始、结束、取消或退款安排以合同为准。订阅到期不会限制 Apache 2.0 许可下的软件使用。Cloud 算力、模型额度与托管服务不包含在本订阅内。
|
||||
|
||||
联系时提供企业名称、意向档位和使用概况即可,合同签署前再按需补充开票资料;不要通过公开工单或 GitHub 发布银行和税务资料。
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
title: "服务范围与响应说明"
|
||||
description: "LangBot 企业支持订阅 — 服务范围与响应说明"
|
||||
---
|
||||
|
||||
## 包含
|
||||
|
||||
- LangBot Core 缺陷确认与分诊
|
||||
- 官方文档指引、升级兼容性建议
|
||||
- 公开版本信息与安全公告
|
||||
|
||||
## 不包含
|
||||
|
||||
- 代部署、代运维、7×24 值守、驻场
|
||||
- 企业网络、数据库、Kubernetes 或模型供应商故障排查
|
||||
- 插件、第三方适配器、私有协议客户端维护
|
||||
- 定制开发、历史数据迁移
|
||||
- 恢复 SLA、固定修复期限或合规认证
|
||||
|
||||
## 首次响应与处理时间
|
||||
|
||||
首次响应指人工确认问题范围、请求补充资料或给出初步分类与下一步建议,自动收件通知不算首次响应。两档均承诺 2 个工作日内首次响应,不承诺修复或恢复时间。
|
||||
|
||||
受理时间为北京时间(Asia/Shanghai)中国大陆法定工作日 09:00–18:00,含调休工作日。窗口外提交的请求从下一个工作日 09:00 起算;在窗口内提交的请求,截止时间为向后数第 2 个工作日的同一时刻。例如,周五 14:00 提交、期间无节假日或调休时,截止下周二 14:00;周五 20:00 提交则从周一 09:00 起算,截止周三 09:00。法定节假日顺延,调休工作日计入。
|
||||
|
||||
资料不全时,我们仍在首次响应期限内告知需要补充的材料。后续诊断取决于信息完整性与可复现性。保障档的优先分诊不意味着更短的恢复 SLA。
|
||||
|
||||
## 支持对象与版本
|
||||
|
||||
服务面向 LangBot Core 当前稳定版本。旧版本问题可先获得升级建议,缺陷确认可能要求在当前稳定版本复现;不承诺历史版本回补、LTS 分支或客户私有补丁。官方插件与第三方组件并不自动纳入 Core 维护范围。
|
||||
|
||||
基础计划提供工单分诊、文档指引和缺陷确认,不提供持续的客户环境远程排查。保障计划的技术咨询需预约,计入每年额外四次、每次 60 分钟额度。年度使用情况沟通另计一次 60 分钟,两项合计最多五次。未使用次数不结转。
|
||||
|
||||
一个工单对应一个问题,重复请求可合并。公共缺陷按严重程度、影响范围及可复现性安排维护;进入优先修复队列不构成固定修复时间承诺。Roadmap 提案优先评审不构成开发或排期承诺。
|
||||
|
||||
## 实例登记与安全说明
|
||||
|
||||
保障计划覆盖登记的 1 个生产实例;登记只是支持范围,不限制 Apache 2.0 允许的部署数量。记录版本、部署概要、用途及联系人,无需许可证或遥测。替换生产实例前通过工单更新登记,不自动扩大为多个生产环境的支持。
|
||||
|
||||
季度摘要复用公开版本与安全信息。严重安全问题通知基于维护团队确认的适用公告;基础计划发送通用通知,不承诺判定客户环境是否受影响。年度版本、依赖与安全状态说明基于登记版本和公开信息,不是安全审计、渗透测试、合规认证或零漏洞保证。
|
||||
|
||||
## 服务约定
|
||||
|
||||
服务语言、联系人、服务起止日期和服务说明版本在合同中确认。到期后停止接受新的订阅权益请求,已受理工单按合同约定完成分诊或交接,不延伸为无限期修复义务。服务到期不影响继续使用开源 LangBot。
|
||||
|
||||
不以群聊提供无限支持,不提供固定月度 Office Hour 合同权益。定制开发不属于订阅;通用需求可提交公开 Roadmap,其他项目是否承接及报价另行评估。
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
title: "提交支持工单"
|
||||
description: "LangBot 企业支持订阅 — 提交支持工单"
|
||||
---
|
||||
|
||||
[已订阅,提交工单](https://space.langbot.app/profile?tab=tickets&language=zh)
|
||||
|
||||
请使用合同登记的 Space 账号登录,进入个人资料的工单页,选择「企业支持:问题受理」或「企业保障:升级与咨询」。工单入口面向登录用户,企业权益由团队核验合同、登记账号和有效期后确认。订阅编号本身不能证明身份。
|
||||
|
||||
## 必填与补充资料
|
||||
|
||||
- 订阅/合同编号、企业名称、问题类型和问题概述。
|
||||
- 缺陷受理:LangBot 版本、部署方式、预期与实际行为、复现步骤、业务影响。
|
||||
- 相关日志填写脱敏后的片段;没有日志时解释原因。不提交访问令牌、密码、完整聊天记录、客户个人信息或原始配置文件。
|
||||
- 升级/咨询:登记实例、当前与目标版本(如适用)、咨询目标及可预约时间。
|
||||
- 资料或文档咨询无需编造日志和复现步骤,可使用升级与咨询入口说明需求;技术咨询额度仅适用于保障计划。
|
||||
|
||||
表单只收集文本信息,不会自动采集实例数据或生成诊断包。图片只用于必要的已脱敏截图。安全漏洞详情请勿直接提交到公开 GitHub issue。
|
||||
|
||||
## 后续处理
|
||||
|
||||
团队先核验订阅,再确认范围并分诊。可以是文档指引、索取补充资料、预约保障档咨询、确认公开 Core 缺陷,或说明不在服务范围。自动通知邮件不算首次人工响应。
|
||||
|
||||
经确认的通用缺陷只将必要且脱敏的复现信息提交公共维护流程;客户合同、日志和业务信息不自动同步到公开 GitHub。请在原工单补充资料,避免多渠道重复提交。
|
||||
@@ -30,20 +30,7 @@ LangBot 是一个**开源、生产级**的大语言模型(LLM)原生即时
|
||||
将下面的提示词复制给你的 AI 助手。它会从官方文档开始,结合你的环境与目标协助操作。
|
||||
|
||||
```text
|
||||
请帮助我部署和使用 LangBot,先阅读官方文档,再根据我的环境制定方案。
|
||||
|
||||
先读取中文文档索引 https://langbot.app/docs/zh/llms.txt ,并阅读以下关键文档:
|
||||
- 功能概览:https://langbot.app/docs/zh/insight/features.md
|
||||
- 平台支持:https://langbot.app/docs/zh/insight/platform-features.md
|
||||
- 机器人配置:https://langbot.app/docs/zh/usage/platforms/readme.md
|
||||
- 模型配置:https://langbot.app/docs/zh/usage/models/readme.md
|
||||
- 流水线:https://langbot.app/docs/zh/usage/pipelines/readme.md
|
||||
|
||||
先了解我想接入的聊天平台、使用的模型,以及是否已有 LangBot 实例。若需要部署,确认我的系统、服务器或本机环境,以及偏好云服务还是自部署;再从索引中读取对应的部署文档和平台接入文档,不要猜测命令或配置项。
|
||||
|
||||
根据文档帮助我完成部署、机器人连接、模型与流水线配置。若你有执行工具,在我授权的环境内执行并验证;否则给我适合当前环境的操作指导。已有实例请优先复用,涉及覆盖配置、删除数据或付费操作时先征求确认,不要让我在聊天中粘贴密钥。
|
||||
|
||||
最后帮助我发送一条真实测试消息,确认机器人能够回复。基础功能跑通后,再按需要引导我使用知识库、插件、MCP 或技能。文档无法读取或操作失败时请明确说明,不要把未验证的步骤说成已经完成。
|
||||
请先阅读 https://langbot.app/llms.txt ,按照其中的官方指引帮助我部署和使用 LangBot,安装 LangBot CLI,并通过 CLI 配置和管理实例。结合我的目标和环境执行,优先复用已有实例,最后验证目标聊天平台上的真实消息回复。请用中文与我沟通。
|
||||
```
|
||||
</Tip>
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
---
|
||||
title: "咨询方式"
|
||||
title: "企业支持与采购咨询"
|
||||
hidden: true
|
||||
---
|
||||
|
||||
作者长期提供定制服务,欢迎咨询:
|
||||
企业服务已统一为 [LangBot 企业支持订阅](/zh/enterprise/overview)。
|
||||
|
||||
- 微信:junyan_qin
|
||||
- QQ:1010553892
|
||||
查看 [服务范围](/zh/enterprise/service-scope) 与 [采购方式](/zh/enterprise/procurement),或联系 [[email protected]](mailto:[email protected])。
|
||||
|
||||
订阅提供有限官方支持,不包含代部署、代运维或定制开发。LangBot 仍按 Apache License 2.0 免费提供,企业无需购买商业使用许可。
|
||||
|
||||
@@ -27,18 +27,58 @@ LangBot 支持一键创建钉钉应用并自动填写凭证,无需手动复制
|
||||
|
||||

|
||||
|
||||
7. **手动填写机器人名称**(名称需与钉钉中创建的机器人一致),以及**机器人代码**(识图、上传文件等功能必填,需前往钉钉开发者后台 > 机器人配置中获取)
|
||||
|
||||

|
||||
|
||||
8. 点击**提交**,完成创建
|
||||
7. 点击**提交**,完成创建。当前版本会自动识别机器人身份。
|
||||
|
||||
<Warning>
|
||||
一键配置完成后即可正常进行文字收发消息。但有以下限制:
|
||||
- **图片/文件收发**:需要填写机器人代码(RobotCode)才能支持,如一键配置时未填写,请前往钉钉开发者后台 > 机器人配置中获取并补填
|
||||
- **流式回复**:需要手动配置卡片模板ID才能开启,参考下方「配置机器人」中的卡片模板创建步骤
|
||||
一键配置会填写应用凭据,不会自动创建卡片模板。开启「使用卡片回复」并填写「卡片模板 ID」即自动启用流式回复;关闭开关即可使用纯文本,无需删除模板 ID;使用按钮、输入框等人工交互,需要按下方步骤导入模板并填写「人工输入卡片模板 ID」。卡片功能还需在钉钉应用的权限管理中开通相应权限。
|
||||
</Warning>
|
||||
|
||||
## 配置卡片模板(推荐使用 LangBot 模板)
|
||||
|
||||
使用卡片回复时,推荐直接导入 LangBot 提供的模板,无需自行搭建组件或绑定变量。先在钉钉应用的权限管理中开通卡片相关权限,再按用途选择模板:
|
||||
|
||||
| 用途 | 下载文件 | LangBot 配置字段 |
|
||||
| --- | --- | --- |
|
||||
| 流式回复,分开展示思考与正文 | `dingtalk_stream_card.json` | 卡片模板 ID |
|
||||
| 等待用户填写、选择或确认后继续执行 | `dingtalk_human_input_card.json` | 人工输入卡片模板 ID |
|
||||
|
||||
### 创建并导入流式回复模板
|
||||
|
||||
1. 在 LangBot 的钉钉适配器配置中,点击「卡片模板 ID」下方的 **下载流式回复卡片模板**。
|
||||
2. 打开[钉钉卡片平台](https://open-dev.dingtalk.com/fe/card),确认组织与机器人应用一致,点击 **新建模板**。
|
||||
3. 填写模板名称,**卡片类型**选择「消息卡片」,**卡片模板场景**选择「AI 卡片」,**关联应用**选择当前机器人应用,**创建方式**选择「空白搭建」,点击 **创建空白模板**。
|
||||
|
||||

|
||||
|
||||
4. 进入卡片编辑器,在顶部点击 **更多 → 导入卡片模板**,选择下载的 `dingtalk_stream_card.json`。
|
||||
|
||||

|
||||
|
||||
<Note>
|
||||
导入入口在卡片编辑器内,不在模板列表页。导入会替换当前模板内容,请使用新建的空白模板。保留导入后的组件、变量和事件绑定。
|
||||
</Note>
|
||||
|
||||
5. 检查预览,**保存并发布**模板,再复制模板 ID。只保存草稿不能发送卡片;`param.templateUnpublished` 表示模板尚未发布。
|
||||
6. 返回 LangBot,开启 **使用卡片回复**,将 ID 填入 **卡片模板 ID** 并保存机器人配置,即自动启用流式回复。关闭开关后使用纯文本,模板 ID 等配置会隐藏并保留,再次开启即可恢复。
|
||||
|
||||
模板带有 LangBot 标识,思考与正文分区展示;思考区在输出时展开,完成后默认折叠,可点击展开。底部提供复制正文、赞/踩以及「内容由 AI 生成」标记。是否删除思考仍由流水线设置控制;删除后不展示思考区。普通消息保留思考时,会显示 `<think>`、`</think>` 标记并用空行分隔正文。
|
||||
|
||||
「卡片宽屏自动布局」默认开启,提供的流式回复模板已配置宽屏所需变量。已有机器人如果之前保存为关闭,需要手动开启并保存;如偏好窄卡片,也可关闭。
|
||||
|
||||
更新模板时,重新下载并导入最新版,保存并发布。如果新建了另一个模板,还需替换 LangBot 中的模板 ID。现有仅绑定 `content` 的模板仍可使用,但没有新版独立思考区的展示效果。
|
||||
|
||||
## 导入人工输入卡片模板
|
||||
|
||||
人工输入用于工作流或插件等待用户补充信息、选择选项或确认后再继续的场景,例如 Dify 的人工输入节点。普通聊天、仅展示流式回复不需要配置此模板。
|
||||
|
||||
1. 在「人工输入卡片模板 ID」旁点击 **下载人工输入卡片模板**,保存 `dingtalk_human_input_card.json`。
|
||||
2. 按上方相同步骤,另建一个 **消息卡片 → AI 卡片 → 空白搭建** 模板,并关联当前机器人应用。
|
||||
3. 在编辑器中选择 **更多 → 导入卡片模板**,导入人工输入 JSON。保留输入框、按钮、变量和事件绑定。
|
||||
4. **保存并发布**,将此模板的 ID 填入 LangBot 的 **人工输入卡片模板 ID**,保存机器人配置。
|
||||
|
||||
两种模板请分别导入、填写对应字段。人工输入模板不替代流式回复模板,也不会自动开启流式回复。
|
||||
|
||||
|
||||
---
|
||||
|
||||
## 手动配置
|
||||
@@ -70,47 +110,17 @@ LangBot 支持一键创建钉钉应用并自动填写凭证,无需手动复制
|
||||
|
||||

|
||||
|
||||
另外卡片消息主要创建卡片模板,并记录模板id填入配置信息,流程如下:
|
||||
> 卡片内容模板ID,可通过登录开发者后台 > [卡片平台](https://open-dev.dingtalk.com/fe/card?spm=ding_open_doc.document.0.0.33cf2281L0fXsV)获取
|
||||
|
||||
新建模板填写信息,如图:
|
||||

|
||||
|
||||
选择预设模板(直接选第一个然后进去后更改模板内容),如图:
|
||||

|
||||
点击使用
|
||||

|
||||
创建
|
||||

|
||||
|
||||
点击创建后会跳转到编辑模板。如图,这样你就可以尽情的编辑你想要的卡片消息了:
|
||||

|
||||
|
||||
主内容这里默认content不要改动即可:
|
||||

|
||||
|
||||
宽屏配置参数,需要在模板变量中添加.参考[钉钉宽屏配置](https://open.dingtalk.com/document/development/configure-widescreen-cards)
|
||||

|
||||
|
||||
编辑好没问题之后保存即可,并复制模板id用以填写配置文件:
|
||||

|
||||

|
||||
|
||||
卡片模板请按上方「配置卡片模板」步骤,直接导入 LangBot 提供的模板并发布。
|
||||
|
||||
### 填写配置信息
|
||||
|
||||
点击`凭证与基础信息`,记录`Client ID` 和 `Client Secret`,
|
||||
点击`应用能力`,`机器人`,记录下 RobotCode 和 机器人名称。
|
||||
`markdown_card` 为是否启用 Markdown 形式的回复,当此配置项关闭时,`@发送者` 配置开关不会生效。
|
||||
点击`凭证与基础信息`,记录`Client ID` 和 `Client Secret`。将这两项凭据填写到 LangBot 的适配器配置中。
|
||||
`markdown_card`(使用卡片回复)统一控制 Markdown 和流式卡片回复。开启且配置模板时自动流式输出,未配置模板时使用普通 Markdown 回复;关闭后使用纯文本,保留模板设置。人工输入卡片用于工作流交互,单独配置。
|
||||
将以上配置项 记录下来,填到 LangBot 机器人配置表单中。
|
||||
|
||||
点击[卡片平台](https://open-dev.dingtalk.com/fe/card?spm=ding_open_doc.document.0.0.33cf2281L0fXsV)模板列表复制绑定的对应的模板id填入卡片模板id
|
||||
|
||||
|
||||

|
||||
|
||||
流式相关:
|
||||

|
||||
|
||||
**启动 LangBot** 。
|
||||
|
||||
@@ -122,3 +132,16 @@ LangBot 支持一键创建钉钉应用并自动填写凭证,无需手动复制
|
||||
点击机器人即可和机器人聊天。
|
||||
|
||||
如果想要添加到群里,那么点击钉钉群的`群管理`,`机器人`,`添加机器人`,然后搜索机器人名称就可以在群中使用。
|
||||
|
||||
## 事件订阅
|
||||
|
||||
在钉钉应用后台的「事件订阅」选择 Stream 模式,并勾选需要的事件。机器人收消息与事件订阅是两个入口,只开启机器人 Stream 收消息不会收到群变动事件。
|
||||
|
||||
- `chat_add_member` → `group.member_joined`,多人变更逐人触发。
|
||||
- `chat_remove_member` / `chat_quit` → `group.member_left`,区分移除与主动退出。
|
||||
- `chat_update_title` / `chat_update_owner` → `group.info_updated`。
|
||||
- 普通卡片点击或提交 → `dingtalk.card_action`;可识别的点赞反馈仍使用 `feedback.received`,LangBot 管理的人工输入表单继续交给原交互流程,避免重复触发。
|
||||
- 群解散及其他已订阅事件使用 `platform.specific`,`action` 保留钉钉事件名,`data` 保留原始头部与事件数据。
|
||||
|
||||
群事件受钉钉的应用权限和群类型范围限制,并非所有机器人所在群都支持。仅有 unionId、缺少可用用户 ID 的成员通知保留为平台专属事件,不把 unionId 当作可发送消息的用户 ID。消息编辑、撤回、表情反应、好友申请及机器人禁言等尚未确认有对应通用推送,不声明为支持。
|
||||
|
||||
|
||||
@@ -41,12 +41,38 @@ LangBot 支持一键创建飞书应用并自动填写凭证,无需手动复制
|
||||
|
||||

|
||||
|
||||
7. **手动填写机器人名称**,名称必须与飞书机器人名称一致,否则机器人将无法在群内正常接收消息
|
||||
7. 新版适配器会自动获取机器人身份,无需填写用于识别群内 @ 的机器人名称。如果使用旧版适配器且仍显示该字段,请填写与飞书机器人一致的名称。
|
||||
|
||||

|
||||
|
||||
8. 点击**提交**,完成创建
|
||||
|
||||
### 补充权限和事件订阅
|
||||
|
||||
<Note>
|
||||
扫码创建或授权应用后,应用权限和事件订阅可能尚未覆盖你要使用的全部功能。能正常收发消息,不代表已经订阅了成员进退群等事件。无需重新创建机器人,可以到开发者平台为现有应用补充配置。
|
||||
</Note>
|
||||
|
||||
1. 打开[飞书开发者平台](https://open.feishu.cn/app)(海外版使用 [Lark 开发者平台](https://open.larksuite.com/app)),选择扫码时创建或授权的应用,可通过 App ID 核对。
|
||||
2. 在**权限管理**中,按需要添加功能所需的权限。应用权限决定机器人可以读取哪些数据、执行哪些操作。
|
||||
3. 在**事件与回调 > 事件配置**中,添加需要接收的事件。事件订阅决定飞书会向 LangBot 推送哪些通知;仅添加权限不会自动订阅事件。
|
||||
4. 按平台提示保存配置,并完成所需的版本发布或管理员审批。配置生效后,再触发一次事件验证,之前的操作不会因补充订阅而自动重放。
|
||||
|
||||
<Warning>
|
||||
**添加事件后,别忘记发布应用新版本。** 在开发者平台的**版本管理与发布**中完成发布;如需管理员审批,还需等待审批通过。仅在配置页添加并保存事件,待发布的配置尚未生效,即使 LangBot 显示连接正常,也可能收不到这些事件。
|
||||
</Warning>
|
||||
|
||||
如果添加订阅后仍收不到成员进退群等事件,先检查应用是否还有**待发布或待审批**的变更。确认新版本生效后,在机器人所在群内重新操作一次成员进群或退群,再查看 LangBot 的事件记录。
|
||||
|
||||
例如,监听群成员变化需要订阅以下两个事件,且机器人需要在对应群聊中:
|
||||
|
||||
| 功能 | 飞书事件 |
|
||||
| --- | --- |
|
||||
| 用户进群 | `im.chat.member.user.added_v1` |
|
||||
| 用户主动退群或被移出群聊 | `im.chat.member.user.deleted_v1` |
|
||||
|
||||
“机器人进群”是另一个事件(`im.chat.member.bot.added_v1`),只订阅它不会收到其他成员的进退群通知。订阅生效后,还需要在 LangBot 的**事件路由**中将对应事件交给 Agent 或插件处理器;流水线只处理消息事件。
|
||||
|
||||
---
|
||||
|
||||
## 手动配置
|
||||
|
||||
@@ -4,7 +4,114 @@ description: "用 LangBot 搭建 Slack AI 机器人,将 GPT、Claude、Dify
|
||||
icon: "/images/platforms/slack.svg"
|
||||
---
|
||||
|
||||
## 创建机器人
|
||||
## 快速配置(推荐)
|
||||
|
||||
推荐使用 **Slack 快速配置** 创建应用。LangBot 会自动配置机器人权限、消息事件、消息页和 OAuth 返回地址;你只需提供配置令牌、在 Slack 确认安装,并在长连接模式下补充 App-Level Token。
|
||||
|
||||
### 1. 创建机器人并选择接入方式
|
||||
|
||||
在 LangBot 的 **机器人 → 创建机器人** 中填写名称,选择 **Slack**,提交后进入配置页。选择接入方式,然后点击 **Slack 快速配置 → 开始**:
|
||||
|
||||

|
||||
|
||||
- **长连接(Socket Mode,推荐)**:LangBot 主动连接 Slack,无需公网事件 Webhook,适合本地或内网部署。
|
||||
- **Webhook**:Slack 向 LangBot 推送事件,需要可从公网访问的 HTTPS 地址。
|
||||
|
||||

|
||||
|
||||
### 2. 获取 App Configuration Tokens
|
||||
|
||||
打开 [Slack 应用页面](https://api.slack.com/apps),找到 **Your App Configuration Tokens**,点击 **Generate Token**,选择目标工作区。分别复制 **Access Token** 和 **Refresh Token**;已有令牌时,可以直接使用对应的复制按钮。
|
||||
|
||||

|
||||
|
||||
这两个令牌用于创建和配置应用,**不是机器人运行时使用的 Bot Token 或 App-Level Token**。在助手中分别填入对应字段,并确认应用名称。
|
||||
|
||||
### 3. 确认地址并自动创建应用
|
||||
|
||||
长连接模式下,确认 **OAuth 授权返回地址**。它用于授权完成后让浏览器返回 LangBot,支持 HTTPS 或 `http://localhost`,末尾为 `/api/v1/platform/adapters/slack/setup/callback`。只需你的浏览器能访问这个地址;它不是接收消息的 Webhook。远程部署时,不要填写浏览器所在电脑无法访问的服务器内部地址。
|
||||
|
||||

|
||||
|
||||
Webhook 模式下,助手显示的是 **Webhook 回调地址**。确认域名、HTTPS 和反向代理均可用,保留 `/bots/<机器人 UUID>` 后缀。LangBot 会从该地址生成 OAuth 返回地址,并自动完成 Slack 的事件地址验证。
|
||||
|
||||
点击 **创建并自动配置**,等待出现 **前往 Slack 授权**。
|
||||
|
||||
### 4. 在 Slack 安装授权
|
||||
|
||||
点击 **前往 Slack 授权**,核对应用名称、工作区和权限,然后点击 **Allow**。工作区策略可能要求管理员批准。完成后返回原来的 LangBot 配置助手。
|
||||
|
||||

|
||||
|
||||
### 5. 长连接模式:补充 App-Level Token
|
||||
|
||||
Webhook 模式可跳过本步。长连接模式中,点击助手的 **打开应用设置**,进入 **Basic Information → App-Level Tokens → Generate Token and Scopes**:
|
||||
|
||||
1. 填写 Token Name,例如 `langbot-socket`。
|
||||
2. 点击 **Add Scope**,选择 **connections:write**。
|
||||
3. 点击 **Generate**,复制生成的 `xapp-` 令牌,填回助手的 **App-Level Token**。
|
||||
|
||||

|
||||
|
||||
不需要开启 **Token rotation**。这里必须使用刚创建的同一个 Slack 应用的令牌,不能填入第 2 步的 Access Token 或 Refresh Token。
|
||||
|
||||
### 6. 回填配置、设置路由并启用
|
||||
|
||||
助手显示 **授权完成** 后,点击 **填入适配器配置**。长连接模式需先填入 App-Level Token,此按钮才可用。Bot Token 等适配器凭据会自动回填。
|
||||
|
||||

|
||||
|
||||
在 **事件路由 → 添加行为 → 回复收到的消息** 中,为 `message.received` 选择已配置好的流水线或 Agent,并保持该路由启用。最后点击页面右上角 **保存并启用**。
|
||||
|
||||

|
||||
|
||||
### 7. 验证对话
|
||||
|
||||
在 Slack 中打开应用的 **Messages** 页面,发送一条私聊消息。也可以将机器人加入频道后 @ 它。收到回复即表示接入成功。
|
||||
|
||||

|
||||
|
||||
<Info>
|
||||
配置令牌仅在短期配置会话中使用,不作为机器人运行凭据保存。会话有效期为 15 分钟;取消助手不会删除已创建的 Slack 应用。重新开始可能创建另一个应用,请勿因为授权返回页显示异常就反复创建,先检查原助手是否已显示“授权完成”。
|
||||
</Info>
|
||||
|
||||
如果没有回复,先确认机器人及消息路由已启用、处理器本身能够正常运行,并查看机器人日志。长连接模式检查 App-Level Token 是否属于同一应用且包含 `connections:write`;Webhook 模式检查公网地址和 Slack 的 **Verified** 状态。
|
||||
|
||||
## 事件、交互与已有应用升级
|
||||
|
||||
新版快速配置向导会自动配置下列事件订阅和交互入口。安装授权页会申请消息、频道、用户、文件和表情反应权限,其中 `reactions:read` 用于表情反应事件。频道中的普通回复仍只由 @ 机器人触发;为获取编辑、删除和频道信息变化而订阅的频道消息不会全部触发回复。
|
||||
|
||||
| Slack 事件 | LangBot 事件 |
|
||||
| --- | --- |
|
||||
| 私聊消息、`app_mention` | `message.received` |
|
||||
| `message_changed` / `message_deleted` 消息子类型 | `message.edited` / `message.deleted` |
|
||||
| `reaction_added` / `reaction_removed` | `message.reaction`,通过 `is_add` 区分 |
|
||||
| `member_joined_channel` / `member_left_channel` | `group.member_joined` / `group.member_left` |
|
||||
| 上述成员事件中的机器人自身 | 有邀请者时为 `bot.invited_to_group`;离开时为 `bot.removed_from_group` |
|
||||
| 频道重命名、归档/取消归档、主题/用途变化 | `group.info_updated` |
|
||||
| `block_actions`、`view_submission`、`view_closed`、`shortcut`、`message_action` | `platform.specific`,`action` 为 `slack.` 加回调类型 |
|
||||
| `app_home_opened`、`app_uninstalled`、`tokens_revoked` | `platform.specific`,`action` 为 `slack.` 加事件类型 |
|
||||
|
||||
在机器人的事件路由中为所需事件配置处理器;平台事件可按 `action` 区分。卸载和令牌撤销同时写入机器人警告日志,不自动发送聊天回复。表情反应是普通反应事件,不自动视为对模型的反馈。消息 ID 使用 Slack 消息时间戳 `ts`,需结合频道识别;线程回复保留 `thread_ts`。
|
||||
|
||||
交互回调先确认接收,再异步交给处理器;目前不支持在表单提交确认中同步返回字段校验错误,也不提供外部下拉选项加载。接收 `view_closed` 需要创建弹窗时设置 `notify_on_close: true`。回调不会自动创建按钮、快捷方式或弹窗。Socket Mode 和 Webhook 均支持上述接收逻辑,但实际投递受 Slack 授权、频道成员关系及连接状态限制。
|
||||
|
||||
**已有应用不会因升级 LangBot 自动获得新权限。** 无需重新创建应用,按以下步骤补齐:
|
||||
|
||||
1. 在 **OAuth & Permissions → Bot Token Scopes** 保留原权限,增加 `reactions:read`;确认包含 `app_mentions:read`、`chat:write`、`channels:history`、`channels:read`、`groups:history`、`groups:read`、`im:history`、`im:read`、`im:write`、`mpim:history`、`mpim:read`、`users:read`、`files:read`、`files:write`,然后 **Reinstall to Workspace** 重新授权。
|
||||
2. 在 **Event Subscriptions → Subscribe to bot events** 配置:`app_mention`、`message.im`、`message.channels`、`message.groups`、`message.mpim`、`reaction_added`、`reaction_removed`、`member_joined_channel`、`member_left_channel`、`channel_rename`、`group_rename`、`channel_archive`、`channel_unarchive`、`group_archive`、`group_unarchive`、`app_home_opened`、`app_uninstalled`、`tokens_revoked`。编辑/删除、主题/用途变化属于消息子类型,无需单独订阅。
|
||||
3. 在 **Interactivity & Shortcuts** 启用交互。Webhook 模式的 **Request URL** 与事件订阅使用同一个 LangBot `/bots/<机器人 UUID>` 地址;Socket Mode 不需要公网交互地址。
|
||||
4. 保存 Slack 设置,在 LangBot 配置相应事件路由。若重新安装后 Bot Token 改变,回填新值并保存机器人。
|
||||
|
||||
字段定义参考 [Slack App Manifest](https://docs.slack.dev/reference/app-manifest/)。
|
||||
|
||||
## 手动配置(Webhook)
|
||||
|
||||
下方截图展示基础对话配置;完整权限、事件订阅和交互配置请使用上方“事件、交互与已有应用升级”中的最新清单。
|
||||
|
||||
下面保留手动 Webhook 配置步骤。若手动使用长连接,请在 Slack 开启 Socket Mode,填写 Bot Token 和 App-Level Token,并订阅 `app_mention` 和 `message.im`;无需配置事件 Request URL。
|
||||
|
||||
### 创建机器人
|
||||
|
||||
前往 [Slack的App平台](https://api.slack.com/apps)。
|
||||
|
||||
@@ -30,7 +137,7 @@ icon: "/images/platforms/slack.svg"
|
||||
进入左侧 `App Home` 栏,滑到最下面有 `Message Tab`,打开并且勾选
|
||||
`Allow users to send Slash commands and messages from the messages tab`。
|
||||
|
||||
## 对接 LangBot
|
||||
### 对接 LangBot
|
||||
|
||||
进入左侧 `Event Subscriptions` ,打开开关,点击 `Subscribe to bot events`,
|
||||
将如下权限添加进去:
|
||||
@@ -40,10 +147,10 @@ icon: "/images/platforms/slack.svg"
|
||||
|
||||

|
||||
|
||||
## 启动机器人
|
||||
### 启动机器人
|
||||
|
||||
<Info>
|
||||
由于 Slack 官方要求使用 https,请根据文档[配置 HTTP 反向代理和 SSL](/zh/workshop/production/proxy-and-ssl) 先配置好反向代理。
|
||||
Webhook 模式要求公网 HTTPS 地址,请根据文档[配置 HTTP 反向代理和 SSL](/zh/workshop/production/proxy-and-ssl) 先配置好反向代理。
|
||||
</Info>
|
||||
|
||||
Slack 配置项在填写完成后,**启动 LangBot**。
|
||||
@@ -53,6 +160,6 @@ Slack 配置项在填写完成后,**启动 LangBot**。
|
||||
上述配置项都填写完成后,点击保存链接,若标识为绿色的**Verified**,那么就说明部署成功。
|
||||
否则查看上述配置项是否填写正确。
|
||||
|
||||
## 效果图
|
||||
### 效果图
|
||||
|
||||

|
||||
|
||||
@@ -6,28 +6,75 @@ icon: "/images/platforms/telegram.svg"
|
||||
|
||||
## 创建机器人
|
||||
|
||||
前往 [Telegram 机器人创建页面](https://t.me/botfather),按照提示操作,创建一个机器人。
|
||||
在 Telegram 打开官方 [BotFather](https://t.me/BotFather),发送 `/newbot`,依次设置名称和以 `bot` 结尾的用户名。保存 BotFather 返回的 Token,不要把它发到群里或放入截图。
|
||||
|
||||

|
||||
本文适用于 LangBot 4.11 的新版 Telegram 适配器(内部名称 `telegram-omni`)。不要选择标记为过时的旧版适配器。
|
||||
|
||||

|
||||
## 配置并启用
|
||||
|
||||
创建完成后,BotFather 会返回一个 API Token,请妥善保存。接下来关闭`Privacy Mode`,以便在群聊中使用。
|
||||
1. 在 LangBot 配置可用的模型供应商和模型,再创建 Pipeline、Agent 或插件处理器。
|
||||
2. 在「机器人」中新建机器人,选择 Telegram,填写 Token。
|
||||
3. 为 `message.received` 配置消息处理器。Pipeline 适合现有对话流程;Agent 通过事件与工具处理任务。插件处理器也可以独立订阅事件。
|
||||
4. 根据需要打开 Markdown 和流式回复,启用机器人并保存。修改处理器绑定后也要保存。
|
||||
5. 在 Telegram 私聊机器人,点击 **Start**,发送一条测试消息;同时在 LangBot 的处理器运行记录中检查状态和回复工具结果。
|
||||
|
||||

|
||||
适配器通过长轮询连接 Telegram,需要 LangBot 所在环境能访问 `api.telegram.org`。不需要为收消息额外暴露入站 Webhook。一个 Token 只应由一个轮询实例使用;不要同时在另一套 LangBot 中启用同一个机器人。
|
||||
|
||||
## 对接 LangBot
|
||||
### 选择处理器
|
||||
|
||||
打开 LangBot Webui 页面,创建一个新机器人
|
||||
| 方式 | 配置与检查 |
|
||||
| --- | --- |
|
||||
| Pipeline | 配置模型和触发条件。群聊的 @、前缀等触发条件仍需满足;开启流式回复后,支持流式的处理器可逐步更新 Telegram 消息。 |
|
||||
| Agent | 配置模型、指令及事件工具。要求 Agent 使用 `event_reply` 等工具回复;模型生成了文本不等于消息已发送到 Telegram。 |
|
||||
| 插件处理器 | 安装并创建相应插件处理器,将它绑定到机器人并保存。独立订阅可与主处理器并行,因此同一条消息可能产生两份回复。 |
|
||||
|
||||

|
||||
需要读写附件时,为相应处理器启用 Box,并使用其沙盒工具和附件发送能力。Box 必须处于可用状态。外部文件系统 MCP 与 Box 不是同一个文件系统。图片理解还需要支持视觉的模型。
|
||||
|
||||
填写完成后启动 LangBot,若成功配置,日志中会出现`[02-02 16:48:15.263] manager.py (68) - [INFO] : 初始化平台适配器 1: telegram`的字样,保持 LangBot 运行。
|
||||
机器人上的流式开关不会把所有工具调用都变成逐字输出。Agent 的一次 `event_reply` 是一次完整发送;插件是否流式取决于插件实现。请分别核对 Telegram 中的实际更新和处理器日志,不能只看开关。
|
||||
|
||||
## 使用机器人
|
||||
## 私聊与群聊
|
||||
|
||||
现在在群里或者私聊机器人都可以正常使用了。
|
||||
私聊应先点击 **Start**。群聊则先把机器人加入测试群,再按处理器触发规则发送消息,例如发给机器人的命令或回复机器人的消息。
|
||||
|
||||

|
||||
不必为了所有群聊场景都关闭 **Privacy Mode**。隐私模式会影响 Telegram 向机器人投递哪些消息;定向命令、回复和管理员身份的行为与普通群消息不同。如果需要接收群内普通消息,可以在 BotFather 中调整隐私模式,按 Telegram 的提示重新添加机器人,或按需要授予管理员身份。详见 [Telegram 官方隐私模式说明](https://core.telegram.org/bots/features#privacy-mode)。
|
||||
|
||||

|
||||
接收成员状态、表情等更新时,需要满足 Telegram 对相应更新的管理员要求。只授予实际功能需要的权限;不要为了接收事件直接打开删除消息、封禁成员、添加管理员等全部权限。Telegram 侧投递规则和 LangBot 处理器触发条件需要同时满足。
|
||||
|
||||
普通群升级为超级群后,群 ID 会改变。事件日志中的 Bot API 群 ID 与 Telegram Web 地址栏中的 ID 也不一定相同,不要直接从网页地址拼接群 ID。
|
||||
|
||||
## 图片、文件与流式回复
|
||||
|
||||
图片和文件可以作为消息附件进入处理器。测试时发送带有明确问题的图片、内容可校验的文本文件,并检查真实返回的图片或文件,而不仅是“已发送”的文本。
|
||||
|
||||
流式文本在 Telegram 中通过持续更新消息展示;附件在结束时单独发送。生成文件必须使用处理器提供的附件输出机制,不能只返回沙盒路径。Telegram 无法作为照片处理的图片会尝试以文件发送,便于保留原始内容。
|
||||
|
||||

|
||||
|
||||
## 其他事件
|
||||
|
||||
在机器人中为所需事件绑定 Agent 或插件处理器。Pipeline 主要用于消息流程,不应把所有非消息事件都当作普通聊天测试。
|
||||
|
||||
| 事件 | 触发与含义 |
|
||||
| --- | --- |
|
||||
| `message.received` | 收到私聊或群聊消息,包括支持的附件。 |
|
||||
| `message.edited` | 编辑已发送的消息。 |
|
||||
| `message.reaction` | 用户新增或移除消息表情;`is_add` 区分方向,`reaction` 保留被移除的表情。 |
|
||||
| `group.member_joined` | 成员加入群。 |
|
||||
| `group.member_left` | 成员离开或被移出;检查 `is_kicked`。 |
|
||||
| `group.member_banned` | 成员权限受到限制,例如禁言;不代表成员已被移出。 |
|
||||
| `bot.invited_to_group` | 机器人被加入群。 |
|
||||
| `bot.removed_from_group` | 机器人被移出群,包括此前处于受限状态的机器人。 |
|
||||
| `bot.muted` | 机器人失去发送消息权限。永久限制的 `duration` 为 `null`。 |
|
||||
| `bot.unmuted` | 机器人恢复发送消息权限,即使仍受其他权限限制。 |
|
||||
| `platform.specific` | 其他平台事件,例如权限状态变化或回调。根据 `action` 和 `data` 处理。 |
|
||||
|
||||
先用只记录事件的插件处理器确认投递,再添加回复或管理操作。机器人被禁言或移出时,收到事件并不意味着仍有权限在原群回复。权限不足的发送失败应与事件接收成功分别判断。
|
||||
|
||||
## 排查问题
|
||||
|
||||
- **无响应**:检查机器人启用状态、保存后的绑定、私聊 Start、群隐私模式和触发规则,然后查看对应处理器运行记录。
|
||||
- **消息发出了但运行失败**:展开运行记录核对工具返回值;仅有 Telegram 消息不是整次任务成功的证明。
|
||||
- **模型报错或超时**:检查供应商和模型。上游模型错误与 Telegram 投递问题分别排查。
|
||||
- **附件只有路径**:检查 Box、模型工具权限,以及是否真正调用了附件发送工具。
|
||||
- **重复回复**:检查主处理器与独立订阅是否同时处理同一事件,以及是否有多个轮询实例。
|
||||
- **收不到表情或成员事件**:检查机器人管理员身份和事件绑定;先在专用测试群操作,避免影响真实成员。
|
||||
|
||||
@@ -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 表单的卡片回调继续由原有交互流程处理,不会同时触发模板卡片业务事件。连接、鉴权和重连等底层状态不作为编排事件。
|
||||
|
||||
### 效果图
|
||||
|
||||

|
||||
|
||||
@@ -33,5 +33,54 @@ description: "用 LangBot 配置企业微信客服,提供 AI 驱动的客服
|
||||
|
||||
复制页面中的 Secret,然后打开新建好的 LangBot 企业微信客服机器人,填写入新的 Secret,重新启动。
|
||||
|
||||
回到企业微信客服配置页面,点击客服账号,创建客服账号,即可使用。
|
||||
## 获取客服链接和二维码
|
||||
|
||||
完成回调配置后,还需要获取供微信用户发起咨询的入口。
|
||||
|
||||
1. 回到[微信客服后台](https://kf.weixin.qq.com/kf),进入`客服帐号`,创建或选择需要接入 LangBot 的客服帐号。
|
||||
2. 打开该帐号的接入页面,向下找到`在微信外App/网页中接入`,点击`去接入`。
|
||||
|
||||

|
||||
|
||||
3. 在接入页面顶部找到对应的客服帐号。点击`复制链接`可获取客服咨询链接,点击`生成二维码`可查看该帐号的咨询二维码。
|
||||
|
||||

|
||||
|
||||
<Note>
|
||||
截图中的客服链接仅作示例,请使用自己帐号生成的链接或二维码。Webhook 回调地址用于微信向 LangBot 推送消息,客服链接和二维码用于用户发起咨询。
|
||||
</Note>
|
||||
|
||||
## 扫码测试
|
||||
|
||||
1. 确认 LangBot 中的机器人已启用,并在`事件路由`中将`收到消息`交给需要使用的处理器。
|
||||
2. 使用普通微信扫描刚生成的二维码,进入客服会话后发送一条消息。
|
||||
3. 在 LangBot 中查看机器人的日志、会话监控及对应处理器的运行日志,确认消息已接收并处理,再检查微信中是否收到回复。
|
||||
|
||||
如果只是扫码测试,获取二维码后即可发起咨询,无需继续配置页面下方的 App 关联。
|
||||
|
||||
## 可路由的事件
|
||||
|
||||
在机器人的「事件路由」中,可以分别为以下事件选择处理器。普通消息可交给流水线或 Agent;其他事件可交给支持相应事件的 Agent 或插件处理器。
|
||||
|
||||
| 事件 | 事件类型 |
|
||||
| --- | --- |
|
||||
| 收到消息 | `message.received` |
|
||||
| 客户或接待人员撤回消息 | `message.deleted` |
|
||||
| 客户通过链接进入会话 | `wecomcs.enter_session` |
|
||||
| 客服消息发送失败 | `wecomcs.msg_send_fail` |
|
||||
| 接待人员状态变更 | `wecomcs.servicer_status_change` |
|
||||
| 客服会话接入、转接、结束或重新接入 | `wecomcs.session_status_change` |
|
||||
| 拒收客户消息设置变更 | `wecomcs.reject_customer_msg_switch_change` |
|
||||
|
||||
撤回事件包含原消息 ID、操作者和会话 ID。客服专属事件保留客服帐号、客户及事件相关字段,例如 `welcome_code`、`fail_type` 和 `change_type`;处理器可按字段决定后续操作。未知事件仍通过 `platform.specific` 保留原始数据。
|
||||
|
||||
进入会话事件只在客户通过客服链接进入时触发,从已有聊天列表打开会话不会触发。接入事件不等于自动发送欢迎语,仍需配置相应处理逻辑。
|
||||
|
||||
### 回复窗口与欢迎语
|
||||
|
||||
- 普通消息回复要求客户先主动发消息,且在 48 小时内回复;仅进入会话不会开启此窗口。错误码 `95002` 表示不满足发送时间限制。
|
||||
- Agent 的 `event_reply` 在进入会话事件中使用专用事件回复接口和 `welcome_code`,不会当作普通消息发送。微信只在符合欢迎语条件时提供此凭据,每个凭据只能发送一条消息,有效期仅 20 秒。建议使用快速固定文案,避免等待耗时较长的模型生成。
|
||||
- 会话状态变化事件的 `event_reply` 使用 `msg_code`,仍受凭据有效期和当前会话状态限制。当前事件回复支持文本;凭据缺失、过期或已使用时无法补发,重新执行旧事件不能延长有效期。
|
||||
|
||||
详见微信官方的[发送消息](https://developer.work.weixin.qq.com/document/path/94677)和[发送事件响应消息](https://developer.work.weixin.qq.com/document/path/95122)。
|
||||
|
||||
|
||||
@@ -1,59 +1,142 @@
|
||||
---
|
||||
title: "微信公众号"
|
||||
description: "用 LangBot 搭建微信公众号 AI 机器人,将大模型接入你的微信公众号。"
|
||||
description: "通过微信开发者平台配置消息推送,将微信公众号接入 LangBot。"
|
||||
icon: "/images/platforms/wechat.svg"
|
||||
---
|
||||
|
||||
部署微信公众号机器人接入 LangBot 。
|
||||
本教程使用微信公众平台完成账号注册和主体实名认证,在微信开发者平台配置应用密钥、消息推送和 API IP 白名单。
|
||||
|
||||
## LangBot 微信公众号接入模式
|
||||
## 1. 注册公众号并完成主体实名认证
|
||||
|
||||
目前,LangBot 提供两种方式接入微信公众号:
|
||||
进入[微信公众平台](https://mp.weixin.qq.com/)。已有公众号可直接扫码登录;尚未注册时,点击「立即注册」,选择「公众号」,按提示完成注册。
|
||||
|
||||
1. **传统收发消息模式**
|
||||
- 公众号要求请求必须在 **15 秒内** 处理完成,超时的 AI 生成内容将无法发送。
|
||||
- 当 AI 生成内容超时发生后,LangBot 会在控制台打印请求超时信息。
|
||||
进入「设置与开发 → 账号设置 → 账号详情」,找到页面底部的「主体信息」,点击「详情」。如果显示「待完善」,请先完成主体信息。
|
||||
|
||||
2. **“发送任意文字回复消息”模式**
|
||||
- 该方法可突破 **15 秒** 限制,但 **过长的文本** 可能无法成功发送。
|
||||
- 使用此方法时,给公众号发消息,公众号会回复“AI正在思考中,请发送任意内容获取回答”,此时,需要发送任意内容获取回答。
|
||||

|
||||
|
||||
如需更复杂的功能,请联系 **LangBot 团队** 进行定制化支持。
|
||||
在主体信息页面点击「实名验证」,按照微信提示完成实名认证。
|
||||
|
||||
## 创建机器人
|
||||

|
||||
|
||||
进入[微信公众平台](https://mp.weixin.qq.com/),如果已经有公众号账号,那么直接扫码登录,进入控制台。
|
||||
如果之前没有注册过公众号,那么点击立即注册,选择 `公众号`,依次填写信息,进入控制台。控制台是这样的:
|
||||

|
||||
<Note>
|
||||
这里需要完成的是「主体信息」中的实名验证。账号详情中还有「申请微信认证」「个人认证」等入口,请按截图进入主体信息页面操作。
|
||||
</Note>
|
||||
|
||||
## 2. 获取应用信息并创建 LangBot 机器人
|
||||
|
||||
## 设置回调地址
|
||||
前往[微信开发者平台](https://developers.weixin.qq.com/platform),进入公众号设置,选择要接入的公众号,打开「基础信息」。页面包含 AppID、「开发密钥」以及「域名与消息推送配置」。
|
||||
|
||||

|
||||
|
||||
在 LangBot 中新建机器人,选择「微信公众号」适配器,进入机器人配置页:
|
||||
|
||||
1. 复制微信开发者平台中的 **AppID**,填写到 LangBot 的「应用 ID」。
|
||||
2. 在微信开发者平台的「开发密钥」区域点击 AppSecret 的「重置」,按提示获取密钥,填写到 LangBot 的「应用密钥」。首次使用时,如果按钮显示为「启用」,先按提示启用 AppSecret。
|
||||
3. 点击 LangBot 的「保存并启用」,保存机器人并启用。
|
||||
|
||||
下面是 LangBot 适配器配置区域。图中的「令牌」和「消息加解密密钥」会在下一步与微信平台一起配置。
|
||||
|
||||

|
||||
|
||||
## 3. 启用消息推送并配置回调
|
||||
|
||||
回到微信开发者平台,在「基础信息」页面下方的「域名与消息推送配置」区域,点击「消息推送」旁的「启用」。
|
||||
|
||||
在「配置消息推送」弹窗中按以下顺序填写,暂时不要点击「确定」:
|
||||
|
||||
1. **URL**:复制 LangBot 机器人配置页显示的完整「Webhook 回调地址」并粘贴。地址通常为 `https://你的域名/bots/机器人UUID`,请保留完整路径。
|
||||
2. **Token**:自行设置一个符合微信页面要求的 Token,并将同一个值填入 LangBot 的「令牌」。两边必须完全一致。
|
||||
3. **EncodingAESKey**:点击微信平台的「随机生成」,复制生成的值,填入 LangBot 的「消息加解密密钥」。
|
||||
4. **消息加密**:选择「安全模式(推荐)」。
|
||||
5. **数据格式**:选择 **XML**。
|
||||
|
||||

|
||||
|
||||
两个平台的配置对应关系如下:
|
||||
|
||||
| 微信开发者平台 | LangBot |
|
||||
| --- | --- |
|
||||
| AppID | 应用 ID |
|
||||
| AppSecret | 应用密钥 |
|
||||
| URL | Webhook 回调地址(从 LangBot 复制) |
|
||||
| Token | 令牌 |
|
||||
| EncodingAESKey | 消息加解密密钥 |
|
||||
|
||||
保持微信平台弹窗开启,回到 LangBot **再次保存机器人**。确认机器人已启用且配置成功应用后,再回到微信平台点击「确定」。微信会访问回调地址进行验证,通过后消息推送配置即完成。
|
||||
|
||||
<Tip>
|
||||
**微信公众号需要公网域名和 HTTPS。** 如果你没有服务器,[LangBot Cloud](https://space.langbot.app/cloud) 自带域名解析,注册即可直接使用。
|
||||
Webhook 回调地址需要能够从公网访问,建议使用 HTTPS。自部署可参考[配置 HTTP 反向代理和 SSL](/zh/workshop/production/proxy-and-ssl),将公网域名转发到 LangBot 服务。使用 HTTP 时需使用 80 端口,HTTPS 使用 443 端口。
|
||||
|
||||
如页面显示的仍是本地地址,请将实例 `data/config.yaml` 中的 `api.webhook_prefix` 设置为公网地址,例如 `https://bot.example.com`,重启 LangBot 后重新复制回调地址。[LangBot Cloud](https://space.langbot.app/cloud) 提供可直接使用的公网回调地址。
|
||||
</Tip>
|
||||
|
||||
### 获取配置项
|
||||
### 常见错误:请求失败,HTTP 返回非 200
|
||||
|
||||
点击`设置与开发`,`开发接口管理`,出现这样的页面:
|
||||

|
||||
如果点击微信平台的「确定」后出现此提示,请依次检查:
|
||||
|
||||
记录下来`开发者ID(AppID)`,`开发者密码(AppSecret)`,并将部署 LangBot 的服务器添加入`IP白名单`。
|
||||
- **URL 正确且公网可达**:使用 LangBot 显示的完整回调地址,包含 `/bots/机器人UUID`。本机地址、内网地址或仅填写域名首页均不能作为此机器人的回调地址。
|
||||
- **机器人已保存并启用**:填写 Token 和 EncodingAESKey 后,需要先在 LangBot 保存,再在微信平台确认。
|
||||
- **字段一致**:Token、EncodingAESKey 必须与 LangBot 完全一致;AppID、AppSecret 必须属于当前选择的公众号,复制时不要带入多余空格或换行。
|
||||
- **转发配置有效**:检查反向代理或隧道是否仍在运行、HTTPS 证书是否有效,以及回调是否被登录验证或访问控制拦截。
|
||||
|
||||
### 为 LangBot 设置反向代理
|
||||
旧界面可能显示「系统发生错误,请稍后重试」,同样可以按上述项目检查,并查看 LangBot 的机器人日志定位错误。
|
||||
|
||||
由于微信公众号的只支持http(80端口),https(443端口),请根据文档[配置 HTTP 反向代理和 SSL](/zh/workshop/production/proxy-and-ssl) 操作。
|
||||
## 4. 配置 API IP 白名单
|
||||
|
||||
### 保存回调地址
|
||||
在微信开发者平台「基础信息 → 开发密钥」中找到 **API IP 白名单**,填入部署 LangBot 的服务器访问微信 API 时使用的**公网出站 IP**,保存配置。截图中未启用 AppSecret 时,该项会提示「启用 AppSecret 后,可配置」。
|
||||
|
||||
点击设置服务器配置,输入`Token`,`EncodingAESKey`,并将消息加解密方式改为`安全模式`。
|
||||
可以从服务器或云平台的网络配置中查找出站 IP。如果 LangBot 通过 NAT 网关或代理访问微信 API,应填写实际出口的公网 IP;存在多个出口时,按微信页面要求将它们加入白名单。
|
||||
|
||||
至此,打开 LangBot Webui 页面,创建一个新的机器人,将获取到的四个配置项( AppID , AppSecret , token , EncodingAESKey )填入
|
||||
<Note>
|
||||
回调 URL 用于微信向 LangBot 推送事件;API IP 白名单用于 LangBot 调用微信接口。使用反向代理或 Cloudflare Tunnel 提供回调地址时,白名单仍应填写 LangBot 访问微信 API 的出站 IP,而不是回调域名解析出的 CDN 地址。
|
||||
</Note>
|
||||
|
||||

|
||||
## 接入模式与后续使用
|
||||
|
||||
在配置项中,`Mode`选项为选择的接入模式,其中默认为`drop`,`drop` 为传统收发消息模式,`passive` 为发送任意文字获取回复模式。
|
||||
在新版「微信公众号」适配器的「接入模式」中选择回复方式,保存后生效。已有机器人不会自动切换模式;默认值仍为 `drop`。旧版适配器不提供 `auto`,请使用新版适配器。
|
||||
|
||||
`LoadingMessage`选项为加载信息,可以更改为其他内容,仅在模式为`passive`下有效。将 `enable` 设置为 `true` 。
|
||||
| 接入模式(Mode) | 回复机制 | 适用场景 |
|
||||
| --- | --- | --- |
|
||||
| `auto` | 先返回加载提示,后台生成回复;通过客服接口发送,受限时改为下一条消息领取。 | 希望生成完成后直接收到回复,或不确定账号是否具有客服接口权限。 |
|
||||
| `passive` | 先返回加载提示,后台生成回复;用户再发任意内容领取,不调用客服接口。 | 没有客服接口权限,或希望始终使用领取方式。 |
|
||||
| `drop`(默认) | 在当前微信回调内直接返回回复,不调用客服接口,也不会自动转为领取方式。 | 能在 5 秒内完成的快速回复;不适合耗时较长的 AI 生成。 |
|
||||
|
||||
填写成功后,在 LangBot 主页中,启用并选择对应的机器人,点击进入配置页面,复制其中的 Webhook 回调地址,返回微信公众号机器人配置页面,填写到`URL`。比如 URL 填写为`https://your_domain_name/bots/xxxxx`,其中的 `your_domain_name` 就是 Caddy 中填写的域名。点击保存。如果可以保存成功,那么意味着部署成功。如果出现**系统发生错误,请稍后重试**,那么请重新检查以上配置内容是否填写正确。
|
||||
### auto 如何自动选择回复方式?
|
||||
|
||||
`auto` 不会预先查询或要求填写账号认证状态,而是在处理器发送回复时,根据微信客服接口的实际返回结果决定:
|
||||
|
||||
1. 收到用户消息后,先返回加载提示,处理器在后台继续运行。
|
||||
2. 处理器生成并发送回复时,LangBot 尝试调用客服接口。成功后,用户直接收到回复,不必再发消息领取。
|
||||
3. 微信明确返回无接口权限(`48001`)、超过回复时限(`45015`)、下发额度用尽(`45047`)或接收者未关注(`43004`)时,LangBot 缓存回复。用户随后向公众号发送任意内容,即可通过这次回调领取。
|
||||
|
||||
这个判断针对每次回复,不会把账号永久标记为“无权限”。AppID、AppSecret、IP 白名单错误以及网络异常等其他失败会记录报错,不会一律当作权限不足并回退。收到加载提示只能说明消息已进入处理流程;排查未收到回答时,还需要查看处理器执行日志。
|
||||
|
||||
### 认证与回复窗口有什么关系?
|
||||
|
||||
**被动回调和客服消息是两种不同的回复渠道。** 微信要求被动回调在 **5 秒内**响应;认证不会延长这个时间。`drop` 使用的就是被动回调,不能把微信重试当成稳定的 15 秒生成窗口。[被动回复官方说明](https://developers.weixin.qq.com/doc/service/guide/product/message/Passive_user_reply_message.html)
|
||||
|
||||
客服接口允许在回调结束后发送回复。微信官方当前标明,公众号、服务号需企业主体已认证才能调用;前文的「主体实名验证」不等于取得客服接口权限。具体以账号实际权限和微信接口返回为准。
|
||||
|
||||
| 用户操作 | 客服消息下发额度 | 有效期 |
|
||||
| --- | --- | --- |
|
||||
| 发送消息 | 5 条 | 48 小时 |
|
||||
| 点击符合条件的自定义菜单、关注、扫描二维码 | 3 条 | 1 分钟 |
|
||||
|
||||
这些是微信客服接口的限制,不是 AI 的生成超时设置,也不是所有事件都享有 48 小时窗口。规则可能调整,请以[微信客服消息官方文档](https://developers.weixin.qq.com/doc/service/api/customer/message/api_sendcustommessage)为准。
|
||||
|
||||
### 如何领取回复和设置加载提示?
|
||||
|
||||
在 `passive` 或 `auto` 回退后,用户发送的下一条消息用于领取上一轮回答,**不会同时作为新的问题交给处理器**。如果回答尚未生成,仍会返回加载提示;稍后再发送任意内容即可。领取完成后,再发送新的问题。
|
||||
|
||||
`LoadingMessage` 对 `auto` 和 `passive` 都有效,对 `drop` 无效。可以按模式修改,例如:
|
||||
|
||||
- `auto`:「正在处理,请稍候。若未收到回复,请稍后发送任意内容领取。」
|
||||
- `passive`:「AI 正在思考中,请稍后发送任意内容获取回复。」
|
||||
|
||||
将加载提示留空时,LangBot 只向微信确认接收,不发送可见的加载消息。待领取回复保存在内存中,重启 LangBot 或重新加载机器人配置会清空,因此请在修改配置后重新发起对话。三种模式仍受微信消息内容和长度限制。
|
||||
|
||||
### 连接处理器
|
||||
|
||||
完成平台配置后,在 LangBot 的「事件路由」中将「收到消息」连接到需要使用的流水线、Agent 或插件处理器,再关注公众号并发送消息。
|
||||
|
||||
接入模式只决定回复如何送达,不会自动把 Agent 的所有文本输出发送到微信。使用 Agent 时,请批准「回复当前会话」工具,并在指令中要求使用该工具回复;使用插件处理器时,需要插件调用回复接口。
|
||||
|
||||
@@ -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 或网络关闭,主机进程也不受这些沙箱边界保护。
|
||||
|
||||