mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-11-05 23:33:03 +08:00
docs: update platform and usage documentation across multiple languagesDingTalk, Discord, and WeCom
This commit is contained in:
@@ -1,34 +1,3 @@
|
||||
# Using the Knowledge Base
|
||||
|
||||
LangBot natively supports RAG (Retrieval-Augmented Generation). You can create a built-in knowledge base and bind it to a pipeline, allowing the pipeline to answer questions based on the contents of the knowledge base. LangBot also supports connecting to external knowledge retrieval services (e.g., Dify, RAGFlow).
|
||||
|
||||
## Build a Built-in Knowledge Base
|
||||
|
||||
:::info
|
||||
- Creating and using a built-in knowledge base requires configuring an embedding model first. Please read [Configure Models](/en/deploy/models/readme).
|
||||
:::
|
||||
|
||||
On the knowledge base page, click the `Create Knowledge Base` button, fill in the name, select an already configured embedding model, then click `Create`.
|
||||
After creation, go to the "Documents" tab of your knowledge base and upload documents. LangBot will automatically parse and index these in the background.
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/knowledge/upload_docs.png" alt="create_kb" />
|
||||
|
||||
## Connect External Knowledge Base
|
||||
|
||||
On the knowledge base page, switch to the "External Knowledge Base" tab and add an external retriever. In the dialog, select the knowledge retriever plugin to use (please install the related plugin in Plugin Management first). Supported retrievers can be found in the [Plugin Marketplace](https://space.langbot.app/market?category=KnowledgeRetriever).
|
||||
|
||||
## Use the Knowledge Base
|
||||
|
||||
Go to your pipeline configuration, under the "AI" tab, choose `Local Agent` as the runner, then select the knowledge base you just created.
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/knowledge/use_local_agent.png" alt="use_kb" />
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/knowledge/use_kb.png" alt="use_kb" />
|
||||
|
||||
:::info
|
||||
LangBot's built-in knowledge base can be used only when the runner is set to `Local Agent`. For other runners, refer to their documentation.
|
||||
:::
|
||||
|
||||
Now you can use the knowledge base in `Chat Debug`, or through the bot linked to this pipeline:
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/knowledge/use_kb_in_chat.png" alt="use_kb_in_chat" />
|
||||
<script setup>
|
||||
window.location.href = '/en/usage/knowledge/readme'
|
||||
</script>
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
# Using MCP Servers
|
||||
|
||||
|
||||
LangBot supports SSE mode MCP servers. You can add MCP servers to leverage the tool calling capabilities in large language models for better handling of LLM requests.
|
||||
|
||||
:::info
|
||||
MCP service only supports SSE mode.
|
||||
- MCP servers recommended acquisition channel: [Composio MCP](https://mcp.composio.dev/)
|
||||
:::
|
||||
|
||||
## Enable Function Calling for Models
|
||||
|
||||
As shown in the image, enable the `Function Calling` feature for the model.
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/mcp/mcp_01.png" alt="enable function call" />
|
||||
|
||||
## Create MCP Server
|
||||
|
||||
Click `Plugin Management`, then `MCP Management`, as shown:
|
||||
|
||||
<img width="1000px" src="/assets/image/zh/deploy/mcp/mcp02.png" alt="server page" />
|
||||
|
||||
Click `Add` in the top right corner, then `Create MCP Server`,
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/mcp/mcp03.png" alt="create new mcp server" />
|
||||
|
||||
For example, to use the Fetch HTML server, fill in the corresponding URL, click `Test` to test the MCP server, and click `Submit` to add the server.
|
||||
|
||||
After adding, click the switch on the card to connect to the MCP server. Click the card to view the MCP server details:
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/mcp/mcp05.png" alt="detailed server" />
|
||||
|
||||
## Effect
|
||||
|
||||
You need to select `Local Agent` as the runner in the pipeline settings and use a model that supports function calling.
|
||||
|
||||
<img width="1000px" src="/assets/image/zh/deploy/mcp/mcp04.png" alt="dialog with mcp" />
|
||||
@@ -1,47 +1,3 @@
|
||||
# Configure Models (Models)
|
||||
|
||||
## LLM Model
|
||||
|
||||
Models will be used by pipelines to process messages. The first model you configure will be set as the model for the default pipeline.
|
||||
|
||||

|
||||
|
||||
You can add multiple models, and then select which model to use in the pipeline.
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/models/model_config.png" alt="model_config" />
|
||||
|
||||
Enter these four parameters: `Model Name`, `Model Provider`, `Request URL`, and `API Key`, then submit.
|
||||
|
||||
For model capabilities, please choose according to the specific model characteristics:
|
||||
|
||||
- Visual Capability: Needs to be enabled to recognize images
|
||||
|
||||
- Function Calling: Needs to be enabled to use Agent tools in conversations
|
||||
|
||||
:::info
|
||||
|
||||
*If you don't have an API Key, you can [get one from this relay station](https://api.qhaigc.net/)*
|
||||
|
||||
If you need to use third-party API relays or other model providers,
|
||||
|
||||
Select `OpenAI`
|
||||
|
||||
Fill in the relay's Base URL for the Request URL, for example:
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/models/other_provider.png" alt="other_provider" />
|
||||
|
||||
:::
|
||||
|
||||
## Embedding Model
|
||||
|
||||
Embedding models are used to compute vector representations of messages. If you need to use knowledge bases, please configure this model.
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/models/embedding_model.png" alt="embedding_model" />
|
||||
|
||||
Enter these four parameters: `Model Name`, `Model Provider`, `Request URL`, and `API Key`, then submit. After that, please configure the knowledge base to use this model.
|
||||
|
||||
### Using seekdb Built-in Embedding Model (Zero Configuration)
|
||||
The system has integrated the official embedding model provided by seekdb, no parameters required.
|
||||
- On the "Embedding Model" page, select "seekdb-built-in";
|
||||
- Click "Save" to use it immediately;
|
||||
- Then select this model in your knowledge base to take effect.
|
||||
<script setup>
|
||||
window.location.href = '/en/usage/models/readme'
|
||||
</script>
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
# Integrating Coze API
|
||||
|
||||
This document explains how to obtain the Token and Bot ID from the Coze platform and enter them into the LangBot pipeline configuration.
|
||||
|
||||
## 1. Obtaining the Token and Bot ID
|
||||
|
||||
1. Log in to the Coze platform and enter your developer console.
|
||||

|
||||
|
||||
2. In "API Management", create and copy the token.
|
||||

|
||||
|
||||
:::info
|
||||
In Coze authorization, coze.cn supports long-term authorization through "Service Identities and Credentials", while coze.com only provides Personal Access Tokens.
|
||||
:::
|
||||
|
||||
3. Select your own agent (or create a new one) from the project development section. The obtained ID is the `bot_id`.
|
||||

|
||||
|
||||
* Make sure to select the API option when publishing the agent
|
||||

|
||||
|
||||
Please securely store the following two pieces of information:
|
||||
- **token**: The token generated by the Coze platform
|
||||
- **bot_id**: The Bot ID
|
||||
|
||||
## 2. Entering the Configuration in LangBot
|
||||
|
||||
1. Open the LangBot WebUI and navigate to the configuration page of a pipeline (or create a new pipeline and enter its configuration page)
|
||||
|
||||
2. Under "AI Capabilities", select the runner as `Coze API`
|
||||
|
||||
3. In the runner's configuration items, enter:
|
||||
- **token**: Paste the API Token you copied from the Coze platform
|
||||
- **bot_id**: Paste the corresponding Bot ID
|
||||
- Please select the `API Base URL` according to the Coze site you are using: coze.cn please fill in `https://api.coze.cn`; coze.com please fill in `https://api.coze.com`
|
||||
|
||||

|
||||
|
||||
4. Click "Save" to complete the configuration
|
||||
|
||||
Once completed, you can invoke the Coze agent within this pipeline for dialogue processing
|
||||
|
||||
## Frequently Asked Questions (FAQ)
|
||||
|
||||
- **Save fails or invocation returns an error**: Please verify that the token and bot_id are correct and do not contain extra spaces
|
||||
- **Unable to select `Coze API`**: Please confirm whether the current version supports this runner. If not yet supported, please upgrade to a version that includes the Coze runner
|
||||
|
||||
For more general pipeline configuration instructions, please refer to [Modifying Dialogue Pipeline Configuration](/en/deploy/pipelines/readme)
|
||||
@@ -1,42 +0,0 @@
|
||||
# Using Dify with LangBot
|
||||
|
||||
[Dify](https://dify.ai) is an open-source large language model (LLM) application development platform. It combines the concepts of Backend as Service and LLMOps, enabling developers to quickly build production-grade generative AI applications.
|
||||
Dify can create chat assistants (including Chatflow), Agents, text generation applications, workflows, and other types of applications.
|
||||
|
||||
LangBot currently supports three types of Dify applications: `Chat Assistant` (including Chatflow), `Agent`, and `Workflow`.
|
||||
|
||||
## Creating an Application in Dify
|
||||
|
||||
Please follow the [Dify documentation](https://docs.dify.ai) to deploy Dify and create your application.
|
||||
|
||||
After publishing your application, go to the `Access API` page of your application to generate an API key.
|
||||
|
||||

|
||||
|
||||
Save the API server and API key for configuring LangBot's pipeline `AI Capability`.
|
||||
|
||||
:::info
|
||||
The above is an example for Dify cloud service version. If you are using the self-hosted community version, please use your own Dify service address as the `base-url` in LangBot, and add `/v1` as the path.
|
||||
|
||||
- If LangBot and Dify are deployed on the same host and both are deployed using Docker, you can refer to the article: [Network Configuration Details](/zh/workshop/network-details.html#langbot-%E5%92%8C%E6%B6%88%E6%81%AF%E5%B9%B3%E5%8F%B0%E5%9D%87%E8%BF%90%E8%A1%8C%E5%9C%A8-docker-%E5%AE%B9%E5%99%A8%E4%B8%AD). In this case, add `langbot-network` to the `networks` of all containers in the docker-compose.yaml file that starts Dify, add the container name `dify-nginx` to the `nginx` container, and finally set `base-url` to `http://dify-nginx/v1` in the LangBot configuration.
|
||||
- For other cases, please consult your company's operations team.
|
||||
:::
|
||||
|
||||
## Configuring LangBot
|
||||
|
||||
Open the LangBot WebUI page, add a new pipeline or switch to the AI capability configuration page in an existing pipeline.
|
||||
|
||||

|
||||
|
||||
::: info
|
||||
### Workflow Output Key
|
||||
|
||||
If you are using a Dify workflow application, please use `summary` as the key to pass the output content.
|
||||
|
||||

|
||||
|
||||
## Output Processing
|
||||
|
||||
When using a workflow application or Agent application, if you enable `track-function-calls` in LangBot's pipeline `Output Processing`, a message of `calling function xxx` will be output to the user when Dify executes each tool call.
|
||||
However, if you are using `ChatFlow` under the `chat` application (Chat Assistant -> Workflow Orchestration), it will only output the text returned by the Answer (direct reply) node regardless of the settings.
|
||||
:::
|
||||
@@ -1,31 +0,0 @@
|
||||
# Using Langflow with LangBot
|
||||
|
||||
[Langflow](https://langflow.com/) is an open-source project for building and deploying AI-based Agents and Workflows. It supports local and cloud deployment, and provides APIs for other applications to integrate.
|
||||
|
||||
LangBot currently supports using Langflow as the runner.
|
||||
|
||||
## Creating a Workflow in Langflow
|
||||
|
||||
Please follow the [Langflow documentation](https://langflow.com/docs/introduction) to deploy Langflow instance.
|
||||
|
||||
As an example of the default template's Simple Agent:
|
||||
|
||||

|
||||
|
||||
You can modify the workflow according to your needs:
|
||||
|
||||

|
||||
|
||||
## Configuring LangBot
|
||||
|
||||
Open the LangBot WebUI page, add a new pipeline or switch to the AI capability configuration page in an existing pipeline, and select `Langflow API` as the runner.
|
||||
|
||||

|
||||
|
||||
Fill in the other settings according to the prompts, including `Base URL` (fill in according to actual network conditions), `API Key`, `Flow ID`, etc. The API Key can be obtained from Langflow's Settings:
|
||||
|
||||

|
||||
|
||||
Flow ID can be obtained by clicking the `Share` -> `API access` button in the top right corner of the edit page and obtaining it from the example code:
|
||||
|
||||

|
||||
@@ -1,49 +0,0 @@
|
||||
# Using n8n with LangBot
|
||||
|
||||
[n8n](https://n8n.io/) is an open-source workflow automation platform that allows you to create, schedule, and execute various automated tasks.
|
||||
|
||||
LangBot currently supports triggering workflows and receiving responses through the `Webhook` node in n8n workflows.
|
||||
|
||||
## Using n8n as the runner
|
||||
|
||||
Please open the configuration page of an existing pipeline or create a new pipeline (recommended) and open the configuration page. Select `n8n Workflow API` as the runner in `AI`.
|
||||
|
||||

|
||||
|
||||
Then configure and fill in the other settings according to the content below.
|
||||
|
||||
## Configuring n8n Workflow Connection
|
||||
|
||||

|
||||
or
|
||||

|
||||
|
||||
Select `Webhook` or `On chat message` as the trigger and configure as follows:
|
||||
- Webhook:
|
||||

|
||||
- On chat message:
|
||||

|
||||
|
||||
:::info
|
||||
If you need streaming responses, set `Response Mode` to `Streaming`.
|
||||

|
||||
:::
|
||||
|
||||
:::info
|
||||
Authentication corresponds to the authentication methods in LangBot's pipeline configuration, which you can modify as needed.
|
||||
|
||||

|
||||
:::
|
||||
|
||||
Configure the node that calls the AI model as `AI Agent`, following the setup below:
|
||||
> For streaming responses, add the items highlighted in the red box. If you don't need streaming, you can skip this.
|
||||
|
||||

|
||||
|
||||
For the workflow response content in n8n, please use the `Respond to Webhook` node and configure it according to the image below (if you choose streaming responses with the `AI Agent` node, you do not need this step):
|
||||
|
||||

|
||||
|
||||
The response content key name in `Response Body` needs to match the `output key name` in LangBot's pipeline configuration.
|
||||
|
||||
After completing the n8n workflow configuration, please click `Active` at the top to enable the workflow.
|
||||
@@ -1,53 +1,3 @@
|
||||
# Modify Dialogue Pipeline Configuration (Pipelines)
|
||||
|
||||
The pipeline controls the processing flow after receiving a message, as well as the information exchange with the large language model. Each bot can be bound to one pipeline, and the same pipeline can be bound to multiple bots.
|
||||
|
||||
LangBot automatically creates a default pipeline when first started. When creating a bot, it is automatically bound to the default pipeline. When creating the first model, it is automatically set as the model for the default pipeline.
|
||||
|
||||

|
||||
|
||||
You can create multiple pipelines for different bots to adapt to different scenarios.
|
||||
|
||||
|
||||
|
||||
The current pipeline can be configured with the following features:
|
||||
|
||||
## AI Capabilities
|
||||
|
||||
You can choose to use: `Built-in Agent`, [`Dify`](https://dify.ai/), [`n8n`](https://n8n.io/)
|
||||
|
||||
AI capabilities are mainly divided into two parts: selecting the runner and configuring runner parameters.
|
||||
|
||||
The runner defines how to schedule the large model to process messages. The default is `Built-in Agent`, which is a multi-round Agent strategy implemented by LangBot. Only when this runner is selected will the models and tools configured internally in LangBot be used.
|
||||
|
||||
*<!--  -->*
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/pipelines/edit_pipeline_ai.png" alt="edit_pipeline" />
|
||||
|
||||
You can also choose to use external LLMOps platforms such as `Dify`, [`n8n`](https://n8n.io/). In this case, the models, prompts, tools, and other resources used will be provided by the LLMOps platform.
|
||||
|
||||
<img width="400px" src="/assets/image/zh/deploy/pipelines/more_runner.png" alt="more_runner" />
|
||||
|
||||
- For detailed steps on connecting to Dify, you can [refer to the tutorial](/en/deploy/pipelines/dify.html).
|
||||
- For detailed steps on connecting to n8n, you can [refer to the tutorial](/en/deploy/pipelines/n8n.html).
|
||||
|
||||
### Conversation Variables
|
||||
When using external LLMOps platforms, LangBot explicitly passes the following parameters, which you can add to the start node of the LLMOps platform workflow (the image below is an example of Dify):
|
||||
|
||||
- `launcher_type`: Launcher object type, `person` for private chat, `group` for group chat
|
||||
- `launcher_id`: Launcher object ID, user ID for private chat, group ID for group chat
|
||||
- `sender_id`: Sender ID
|
||||
- `user_message_text`: The plain text of the user message
|
||||
- `session_id`: User session ID, `person_<id>` for private chat, `group_<id>` for group chat
|
||||
- `conversation_id`: String, user session ID, generated by LangBot. It will be regenerated after the user resets the session
|
||||
- `msg_create_time`: Numeric type, timestamp (seconds) when this message was received
|
||||
- `group_name`: Group name, only set when receiving group messages
|
||||
- `sender_name`: Sender name
|
||||
|
||||
You can [customize any variable through plugins](/en/plugin/dev/apis/common.html#set-request-variables).
|
||||
|
||||

|
||||
|
||||
## Other Configurations
|
||||
|
||||
Please refer to the descriptions in the configuration form.
|
||||
<script setup>
|
||||
window.location.href = '/en/usage/pipelines/readme'
|
||||
</script>
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
# Deploy DingTalk Bot
|
||||
|
||||
Deploy LangBot to DingTalk.
|
||||
|
||||
## Create Bot
|
||||
|
||||
Enter the [DingTalk Developer Backend](https://open-dev.dingtalk.com/?spm=ding_open_doc.document.0.0.74f445e5MkawbT#/), log in and enter the organization. After successful login, enter the open platform, which looks like this:
|
||||

|
||||
|
||||
Click `Application Development` at the top, then click the blue button `Create Application` on the right, fill in the basic information of the bot, and click save.
|
||||
|
||||
Enter the bot's backend, for example, if we have a bot named langbot2, its management page looks like this:
|
||||

|
||||
|
||||
## Configure Bot
|
||||
|
||||
Click `Add Application Capability`, `Other Application Capabilities`, `Configure` in `Robot`, click configure and fill in the information, as shown below:
|
||||

|
||||
|
||||
Click `Publish` at the bottom of the page, after successful publication, click `Version Management and Publishing` at the bottom left of the bot page, as shown:
|
||||

|
||||
|
||||
If this is the first time creating a bot, the right side is empty, you need to click `Create New Version`, set information in it, then set `Application Visibility Range`, and click save.
|
||||
|
||||
Click `Event Subscription`, change the push method to `Stream Mode Push`.
|
||||
|
||||
If card streaming is needed, you must apply for card permissions in the permission management, as shown:
|
||||

|
||||
|
||||

|
||||
|
||||
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:
|
||||

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

|
||||

|
||||
|
||||
## 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.
|
||||
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**.
|
||||
|
||||
## Add Bot
|
||||
|
||||
This article uses DingTalk Windows desktop version as an example, click `Search` at the top, `Features`, then enter the name of the bot you just created, as shown:
|
||||

|
||||
|
||||
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.
|
||||
@@ -1,55 +0,0 @@
|
||||
# Connect to Discord Bot
|
||||
|
||||
## Create Bot
|
||||
|
||||
Go to the [Discord Developer Portal](https://discord.com/developers/applications), log in, and create an application.
|
||||
|
||||

|
||||
|
||||
Modify the basic information, click `Save Changes` to save.
|
||||
|
||||

|
||||
|
||||
Click `Bot` on the left, click `Reset Token`, copy the generated Token.
|
||||
|
||||

|
||||
|
||||
And check all options in `Privileged Gateway Intents` on this page, click `Save Changes` to save.
|
||||
|
||||

|
||||
|
||||
**Finally, click `OAuth2` on the left, copy the `Client ID` on the page.**
|
||||
|
||||
## Connect to LangBot
|
||||
|
||||
Click to add a new bot, fill in the `Client ID` and `Token` obtained in the previous step into the configuration.
|
||||
|
||||

|
||||
|
||||
:::warning
|
||||
|
||||
If you are using this adapter within mainland China, you may need to set up a network proxy.
|
||||
|
||||
:::
|
||||
|
||||
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: discord`, keep LangBot running.
|
||||
|
||||
## Invite Bot to Server
|
||||
|
||||
You need to create a server first, then invite the bot to the server.
|
||||
|
||||
Go to the `OAuth2` page, select `URL Generator`, select `bot`, check the permissions as shown in the image.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Click `Copy`, paste the generated URL into your browser to open it, and invite the bot to your server.
|
||||
|
||||

|
||||
|
||||
## Use Bot
|
||||
|
||||
Now you can use the bot normally in groups or private messages.
|
||||
|
||||

|
||||
@@ -1,63 +0,0 @@
|
||||
# Integrating KOOK Bot
|
||||
|
||||
## Create a Bot
|
||||
|
||||
Visit the [KOOK Developer Center](https://developer.kookapp.cn/), log in and access the console.
|
||||
|
||||

|
||||
|
||||
Click "Create Application" and fill in the application information.
|
||||
|
||||

|
||||
|
||||
After the application is created, enter the application details page.
|
||||
|
||||

|
||||
|
||||
You can view the basic information of the application on the application overview page.
|
||||
|
||||

|
||||
|
||||
## Get Bot Token
|
||||
|
||||
In the application page, click the "Bot" tab, copy the Bot Token and save it securely. You will need it later.
|
||||
|
||||

|
||||
|
||||
## Configure Bot Permissions
|
||||
|
||||
**Important:** In the "Bot" settings, find the "Message Filtering" option and click to configure.
|
||||
|
||||

|
||||
|
||||
Enable all message-related event permissions, including channel messages and private message events. Otherwise, the bot will not be able to receive messages.
|
||||
|
||||

|
||||
|
||||
## Invite the Bot
|
||||
|
||||
In the bot settings page, you can generate an invitation link to invite the bot to your server.
|
||||
|
||||

|
||||
|
||||
## Connect to LangBot
|
||||
|
||||
Open the LangBot Webui page, and click to create a new bot on the "Bots" page.
|
||||
|
||||

|
||||
|
||||
Select the KOOK platform, fill in the bot name and Bot Token.
|
||||
|
||||

|
||||
|
||||
After saving, the bot will appear in the list.
|
||||
|
||||

|
||||
|
||||
Click the enable button to start the bot. If successfully configured, the bot status will show as running.
|
||||
|
||||

|
||||
|
||||
## Using the Bot
|
||||
|
||||
Now in the KOOK server, the bot can receive and reply to messages normally. The bot supports both channel messages and private messages.
|
||||
@@ -1,86 +0,0 @@
|
||||
# Connect to Feishu Bot
|
||||
|
||||
## Create Bot
|
||||
|
||||
Go to the [Feishu Open Platform](https://open.feishu.cn/app), log in, and create an enterprise self-built application or store application. [(difference introduction)](https://open.feishu.cn/document/platform-overveiw/overview)
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Add bot capability to the application:
|
||||

|
||||
|
||||
Add the permissions shown in the image in the permission management:
|
||||
|
||||

|
||||
|
||||
If card streaming permissions are required, additionally add the following card creation and update permissions as shown in the image:
|
||||
|
||||

|
||||
|
||||
## Connect to LangBot
|
||||
|
||||
Find `app_id` and `app_secret` on the `Credentials and Basic Information` page.
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
Open LangBot's Webui configuration page, create a new bot
|
||||
|
||||
Fill in the relevant information in the form
|
||||
|
||||

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

|
||||
|
||||
After filling in, start LangBot. If configured successfully, the log will show `[01-29 23:42:56.796] manager.py (68) - [INFO] : Initializing platform adapter 1: lark`, keep LangBot running.
|
||||
|
||||
:::warning
|
||||
By default, WebSocket long connection mode is used, corresponding to the long connection subscription below. But in some cases (such as international version of Feishu), long connection mode is not available, in which case you need to use Webhook mode, corresponding to the `Send events to developer server` mode, please refer to the following configuration:
|
||||
|
||||
- `enable-webhook`: Set to `true`
|
||||
- `encrypt-key`: Set to `Encrypt Key` in the `Encryption Strategy` of the `Events and Callbacks` page
|
||||
|
||||
Note that in Webhook mode, LangBot needs to be deployed on a server with a public IP, and ensure that the firewall has opened the port configured above.
|
||||
:::
|
||||
|
||||
## Configure Event Subscription
|
||||
|
||||
Go to the `Events and Callbacks` page, configure the subscription method as `Long Connection`:
|
||||
|
||||

|
||||
|
||||
And add the event: `Receive Messages`
|
||||
|
||||

|
||||
|
||||
:::warning
|
||||
Webhook mode configuration method:
|
||||
|
||||

|
||||
|
||||
Please start LangBot first, fill in your server address and port here, the path is `/lark/callback`, click `Save`.
|
||||
|
||||
:::
|
||||
|
||||
## Publish Bot
|
||||
|
||||
Click `Create Version` at the top, fill in the version number and other information, click `Save` below.
|
||||
|
||||

|
||||
|
||||
Add the bot to a Feishu group to use it:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Private chat can also be used directly
|
||||
|
||||

|
||||
|
||||
## Common Issues
|
||||
- Store app bots cannot respond to chat messages immediately after creation/saving. Due to the [app_ticket event](https://open.feishu.cn/document/server-docs/application-v6/event/app_ticket-events) delay mechanism, you need to wait about 2 minutes before it can work normally.
|
||||
@@ -1,153 +0,0 @@
|
||||
# Integrating LINE Bot
|
||||
|
||||
This article explains how to connect LangBot with the LINE platform to implement LINE bot functionality.
|
||||
|
||||
## Creating a LINE Bot
|
||||
|
||||
### Register a LINE Developer Account
|
||||
|
||||
1. Visit the [LINE Developers website](https://developers.line.biz/) and log in with your LINE account
|
||||
2. After logging in, enter the developer console
|
||||
|
||||
### Create Provider and Channel
|
||||
|
||||
> [Developer Console](https://developers.line.biz/console)
|
||||
|
||||
1. In the developer console, create a new Provider (if you don't have one)
|
||||

|
||||
2. Under the Provider, click "Create"
|
||||

|
||||
3. Enter a name and click Create
|
||||

|
||||
|
||||
4. After being redirected, select Create a Message API
|
||||

|
||||
* Continue by clicking Create a Message API
|
||||

|
||||
* After being redirected, fill in the basic information
|
||||

|
||||
- Channel Name
|
||||
- Channel Description
|
||||
- Category
|
||||
- Subcategory
|
||||
- Email Address
|
||||
5. After filling in all information, click "Continue" to create
|
||||

|
||||
6. Check the information you entered, and if there are no issues, click Submit
|
||||

|
||||
7. Successfully created, proceed to use
|
||||

|
||||
|
||||
### Get Configuration Information
|
||||
|
||||
After creation, you will obtain the following important information, please record it:
|
||||
|
||||
1. Channel Secret
|
||||
> [Page after clicking use](https://manager.line.biz/account)
|
||||
* Select Settings
|
||||

|
||||
* Click Message API
|
||||

|
||||
* Enable Message API
|
||||

|
||||
* Select the Provider you just created and click Agree
|
||||

|
||||
* For privacy terms, simply click OK
|
||||

|
||||
* Click OK to complete creation
|
||||

|
||||
* Copy it
|
||||

|
||||
|
||||
2. Channel Access Token (need to click the "Issue" button to generate)
|
||||
* Click console or directly visit [Console](https://developers.line.biz/console/)
|
||||

|
||||
* Select the Provider you created and click Message API
|
||||

|
||||
* Click Message API
|
||||

|
||||
* Scroll to the bottom, click Issue
|
||||

|
||||
* Click the icon to copy
|
||||

|
||||
|
||||
## Connecting to LangBot
|
||||
|
||||
Next, open the LangBot configuration page:
|
||||
|
||||
1. Click "Bots", then click "Add"
|
||||

|
||||
2. Select "LINE" in "Platform/Adapter Selection"
|
||||

|
||||
|
||||
3. Fill in the configuration information:
|
||||
- Channel Secret: The Channel secret you obtained earlier
|
||||
- Channel Access Token: The Channel access token you obtained earlier
|
||||

|
||||
|
||||
4. Click "Save" to complete the configuration
|
||||

|
||||
|
||||
## Configure Webhook
|
||||
|
||||
::: info
|
||||
We recommend that you first refer to [Configure HTTP Reverse Proxy](/en/workshop/production/proxy-and-ssl) to configure the LangBot callback address.
|
||||
:::
|
||||
|
||||
* Get the Webhook callback URL from the LangBot configuration page
|
||||

|
||||
|
||||
* Click console or directly visit [Console](https://developers.line.biz/console/)
|
||||

|
||||
* Select the Provider you created and click Message API
|
||||

|
||||
* Click Message API
|
||||

|
||||
* Click Edit to fill in the connection
|
||||

|
||||
* Enter the connection (must be an HTTPS connection, which means you need an SSL certificate), click Update
|
||||

|
||||
|
||||
* Select Use Webhook
|
||||

|
||||
|
||||
5. Click the "Verify" button to test if the connection is successful
|
||||

|
||||
|
||||
|
||||
## Feature Configuration
|
||||
|
||||
In the LINE developer console, you can further configure the bot's features:
|
||||
|
||||
1. In the "Messaging API" tab, find the "LINE Official Account Features" section
|
||||
2. Enable or disable the following features as needed:
|
||||
- Auto-reply messages
|
||||
- Welcome messages when adding friends
|
||||
- Group and multi-person chat
|
||||
- Greeting when the bot joins a group
|
||||
|
||||
## Usage
|
||||
|
||||
After configuration, users can interact with your LINE bot through the following methods:
|
||||
|
||||
1. Scan the QR code provided in the LINE developer console to add the bot as a friend
|
||||
2. Send messages in the chat, and the bot will process and reply through LangBot
|
||||
|
||||
## Common Issues
|
||||
|
||||
### Webhook Verification Failed
|
||||
|
||||
- Ensure your server can be accessed via HTTPS
|
||||
- Check if the Webhook URL is correct
|
||||
- Confirm that the LangBot service is running properly
|
||||
|
||||
### Unable to Receive Messages
|
||||
|
||||
- Check if the Channel Access Token is valid
|
||||
- Confirm that the "Use Webhook" option is enabled
|
||||
- Check the LangBot logs for error messages
|
||||
|
||||
### Permission Issues
|
||||
|
||||
- Ensure you have enabled the necessary permissions for the bot in the LINE developer console
|
||||
- For some advanced features, a LINE Premium account may be required
|
||||
@@ -1,67 +0,0 @@
|
||||
# Deploy Message Platform Lagrange
|
||||
|
||||
## Lagrange Introduction
|
||||
|
||||
Lagrange is a QQNT protocol reverse engineering framework that is lightweight and relatively stable. Connect through the OneBot 11 protocol, you need to select `OneBot v11` as the adapter.
|
||||
|
||||
::: warning
|
||||
You need to use NT QQ to interact with the bot, old versions of QQ will not work properly
|
||||
:::
|
||||
|
||||
## Deployment Steps
|
||||
|
||||
The following only provides general steps for Windows, for detailed steps or other platforms, please refer to the [Lagrange official documentation](https://lagrangedev.github.io/Lagrange.Doc/v1/Lagrange.OneBot/)
|
||||
|
||||
### Environment Configuration
|
||||
|
||||
Install .NET 8 runtime, [Click here to go directly to Microsoft's official website to download](https://dotnet.microsoft.com/zh-cn/download/dotnet/thank-you/runtime-desktop-8.0.4-windows-x64-installer)
|
||||
|
||||
### Download the latest build from Github Actions
|
||||
|
||||
You need to log in to Github to download. If you don't need certain features, you can download from Release, see image 3
|
||||
|
||||
[Github Actions](https://github.com/KonataDev/Lagrange.Core/actions)
|
||||
|
||||
Follow the images to download:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### Final Steps
|
||||
|
||||
Extract the zip you downloaded, navigate to the directory containing Lagrange.OneBot.exe, open a cmd command prompt in this directory, and enter
|
||||
|
||||
```bash
|
||||
.\Lagrange.OneBot
|
||||
```
|
||||
|
||||
Run it once, if a QR code is output, you can directly scan it with the bot account to log in (if the QR code is not clear, you can look for the image file in the lagrange data directory).
|
||||
|
||||
If you cannot log in, please check if you have correctly filled in the signature address SignServerUrl in the lagrange configuration file appsettings.json. Please look for the signature address in the lagrange documentation.
|
||||
|
||||
## Modify Configuration
|
||||
|
||||
You need to configure Lagrange to connect to LangBot. Please edit Lagrange's configuration file appsettings.json and ensure that the connection configuration in Implementations matches the content in the image below:
|
||||
|
||||

|
||||
|
||||
The Type must be `ReverseWebSocket`;
|
||||
Host is the IP of the host running LangBot, if on the same host, you can write `127.0.0.1`;
|
||||
Suffix must be `/ws`;
|
||||
|
||||
## Lagrange Integration
|
||||
|
||||
Next, open the LangBot configuration page
|
||||
|
||||
Click on Bots, then click Add
|
||||
|
||||
Select `OneBot v11` for `Platform/Adapter Selection`
|
||||
|
||||

|
||||
|
||||
::: info
|
||||
Note, if you have network connection issues involving multiple docker containers, please refer to [Network Configuration Details](/en/workshop/network-details)
|
||||
:::
|
||||
@@ -1,27 +0,0 @@
|
||||
# Deploy Message Platform LiteLoaderQQNT
|
||||
|
||||
Connect through the OneBot 11 protocol, you need to select ``OneBot v11`` as the adapter.
|
||||
|
||||
# LiteLoaderQQNT
|
||||
|
||||
- [LiteLoaderQQNT's OneBot API plugin](https://github.com/LLOneBot/LLOneBot) injects into the QQ client and converts it to the OneBot 11 protocol
|
||||
|
||||
Installation tutorial for LiteLoaderQQNT: https://llonebot.github.io/zh-CN/guide/getting-started
|
||||
|
||||

|
||||
|
||||
Make sure the IP address in the address is the address of the host running LangBot (if running on the same network, use 127.0.0.1)
|
||||
|
||||
## Lagrange Integration
|
||||
|
||||
Next, open the LangBot configuration page
|
||||
|
||||
Click on Bots, then click Add
|
||||
|
||||
Select `OneBot v11` for `Platform/Adapter Selection`
|
||||
|
||||

|
||||
|
||||
::: info
|
||||
Note, if you have network connection issues involving multiple docker containers, please refer to [Network Configuration Details](/en/workshop/network-details)
|
||||
:::
|
||||
@@ -1,33 +0,0 @@
|
||||
# Deploy Message Platform NapCat
|
||||
|
||||
Connect through the OneBot 11 protocol, you need to select ``OneBot v11`` as the adapter.
|
||||
|
||||
## NapCat Installation Tutorial
|
||||
|
||||
Follow the [NapCat official documentation for installation](https://napcat.napneko.icu/guide/start-install)
|
||||
|
||||
## NapCat Configuration Tutorial
|
||||
|
||||
Only using webui operation as an example, for other configuration methods, please check the NapCat documentation.
|
||||
|
||||
After logging in, you can check the logs in the console or Bash, find `[NapCat] [WebUi] WebUi Publish Panel Url: http://x.x.x.x:6099/webui?token=xxxxx `
|
||||

|
||||
|
||||
Copy the Url to your browser or on Windows 11, press Ctrl and click the Url. After scanning the QR code to log in, you will enter the network configuration page.
|
||||
|
||||
Click Add Network Configuration, select WebSocket Client, click Enable, then fill in `ws://127.0.0.1:2280/ws` in the Url field and save.
|
||||

|
||||
|
||||
## NapCat Integration
|
||||
|
||||
Next, open the LangBot configuration page
|
||||
|
||||
Click on Bots, then click Add
|
||||
|
||||
Select `OneBot v11` for `Platform/Adapter Selection`
|
||||
|
||||

|
||||
|
||||
::: info
|
||||
Note, if you have network connection issues involving multiple docker containers, please refer to [Network Configuration Details](/en/workshop/network-details)
|
||||
:::
|
||||
@@ -1,80 +0,0 @@
|
||||
# Using QQ Official Bot API (Using webhook method)
|
||||
|
||||
This article only provides the deployment of test bots. For the official launch of bots, please follow the [release process](https://q.qq.com/qqbot/#/home).
|
||||
|
||||
:::warning
|
||||
QQ Official has issued an announcement prohibiting unauthorized access to AIGC features. Please use with caution.
|
||||
:::
|
||||
|
||||
|
||||
|
||||
## Register QQ Bot (Test Bot)
|
||||
|
||||
### Configure Basic Bot Information
|
||||
|
||||
Go to the [QQ Open Platform](https://q.qq.com/#/), find `Application Management` at the bottom, click Create Bot, fill in the basic information, and then enter the bot page, as shown:
|
||||
|
||||

|
||||
|
||||
The `Release Process` in the `Home` option is the step to launch the bot. Since you are deploying a test version bot, you only need to complete the `Information` and `Sandbox Configuration` sections.<br>
|
||||
|
||||
First fill in the information, then click on Sandbox Configuration.
|
||||
|
||||
#### Configure Sandbox Settings
|
||||
|
||||
Click on `Sandbox Configuration`.
|
||||
If you want to deploy in a QQ group, follow the requirements under `QQ Group ID` to select a group chat, and add users with private chat permissions in the message list configuration.<br>
|
||||
If you want to deploy in a QQ channel, follow the requirements under `Channel ID` to select a channel ID, with bot type 0.
|
||||
|
||||
#### Configure Development Management
|
||||
|
||||
Click on `Development Management`.
|
||||
|
||||

|
||||
|
||||
Record the `AppID`, `Token`, and `AppSecret`, and add the IP address of the server where LangBot is located to the IP whitelist.
|
||||
|
||||
## Connect to LangBot
|
||||
|
||||
Next, open the LangBot configuration page
|
||||
|
||||
Click on Bots, then click Add
|
||||
|
||||
Select `QQ Official API` for `Platform/Adapter Selection`
|
||||
|
||||

|
||||
|
||||
|
||||
## Configure Callback Address
|
||||
|
||||
LangBot must be deployed on a server with a public IP address, and HTTPS must be successfully enabled. Please follow the documentation [Configure HTTP Reverse Proxy and SSL](/en/workshop/production/proxy-and-ssl) for configuration.
|
||||
|
||||
|
||||
#### Subsequent Configuration
|
||||
|
||||
If Caddy fails to start, please read the [Caddy documentation](https://caddy2.dengxiaolong.com/docs/quick-starts/caddyfile) or join the LangBot community group for help.<br>
|
||||
|
||||
Here are some possible issues:
|
||||
|
||||
- Port 443 is not open
|
||||
- The domain is not resolved to your machine
|
||||
- Caddyfile was not saved successfully
|
||||
|
||||
### Set Management Portal Callback Address
|
||||
|
||||
|
||||
First **start LangBot**.
|
||||
|
||||
Click on `Callback Configuration` in the bot management portal, check all events under `Add Event`.
|
||||
|
||||
Go to the LangBot configuration page, enable and select the corresponding QQ bot, copy the Webhook callback address from the corresponding bot configuration page, replace the IP address and port with the domain name configured in Caddy, and enter it in the request address.
|
||||
|
||||
As shown in the image:
|
||||

|
||||
|
||||
|
||||
For example, if the domain is `testlb.com`, then enter `testlb.com/bots/xxxxxx-xxxxxx` in the request address, and click to confirm the configuration. If the callback address is saved successfully, it means the deployment is successful. If you see `Verification Failed`, please carefully check if the above configuration items are filled in correctly.
|
||||
|
||||
## Publication Method
|
||||
|
||||
Enter the release process in `Home` and follow the process to publish and launch the bot.
|
||||
@@ -1,22 +1,3 @@
|
||||
# Configure Bots (Bots)
|
||||
|
||||
Bots are used to receive message events from messaging platforms and call pipelines to process messages.
|
||||
|
||||

|
||||
|
||||
|
||||
| Platform | Status | Notes | Tutorial |
|
||||
| ------ | ---- | ---- | ---- |
|
||||
| Discord | ✅ | | [Tutorial](/en/deploy/platforms/discord) |
|
||||
| Telegram | ✅ | | [Tutorial](/en/deploy/platforms/telegram) |
|
||||
| Slack | ✅ | | [Tutorial](/en/deploy/platforms/slack) |
|
||||
| LINE | ✅ | | [Tutorial](/en/deploy/platforms/line) |
|
||||
| KOOK | ✅ | | [Tutorial](/en/deploy/platforms/kook) |
|
||||
| Lark | ✅ | | [Tutorial](/en/deploy/platforms/lark) |
|
||||
| DingTalk | ✅ | | [Tutorial](/en/deploy/platforms/dingtalk) |
|
||||
| WeCom (Enterprise WeChat) | ✅ | Enterprise internal bot | [Tutorial](/en/deploy/platforms/wecom/wecom) |
|
||||
| WeCom Intelligent Bot | ✅ | wecom intelligent bot | [Tutorial](/en/deploy/platforms/wecom/wecombot) |
|
||||
| WeCom Customer Service | ✅ | Enterprise external bot | [Tutorial](/en/deploy/platforms/wecom/wecomcs) |
|
||||
| WeChat Official Account | ✅ | WeChat public platform bot | [Tutorial](/en/deploy/platforms/wxoa) |
|
||||
| OneBot v11 | ✅ | Uses a personal QQ account as a bot, requires an independent protocol client, supports OneBot v11 | [NapCat](/en/deploy/platforms/qq/aiocqhttp/napcat) <br> [Lagrange](/en/deploy/platforms/qq/aiocqhttp/lagrange) <br> [LiteLoaderQQNT](/en/deploy/platforms/qq/aiocqhttp/llonebot) |
|
||||
| QQ Official Bot | ✅ | Connects to the QQ Open Platform bot API | [Tutorial](/en/deploy/platforms/qq/official_webhook) |
|
||||
<script setup>
|
||||
window.location.href = '/en/usage/platforms/readme'
|
||||
</script>
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
# Connect to Slack Bot
|
||||
|
||||
## Create Bot
|
||||
|
||||
Go to the [Slack App Platform](https://api.slack.com/apps).
|
||||
|
||||

|
||||
|
||||
Click `Create New App` in the top right corner, select `from a manifest`, select the workspace where you want to deploy the bot, select next, and choose to create the bot.
|
||||
|
||||
Enter the `Basic Information` option on the left, record the `signing_secret`.
|
||||
|
||||
Enter `OAuth & Permissions` on the left, scroll down to `Scopes`, add the following bot permissions:
|
||||
|
||||

|
||||
|
||||
|
||||

|
||||
|
||||
After adding the above permissions, click `Install to your workspace`, record the token starting with `xoxb-xxxxx`.<br>
|
||||
|
||||
**Note:**
|
||||
**If you didn't add all permissions at once, you'll need to reinstall the App later.**<br>
|
||||
|
||||
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
|
||||
|
||||
Enter `Event Subscriptions` on the left, turn on the switch, click `Subscribe to bot events`,
|
||||
add the following permissions:
|
||||

|
||||
|
||||
After completing all the above operations, open the LangBot Webui configuration page, add a new 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).
|
||||
:::
|
||||
|
||||
After filling in the Slack configuration items, **start LangBot**.
|
||||
Enable and open the Slack bot configuration page on the LangBot homepage, copy the WebHook URL from it, then in the `Request URL` of the Event Subscriptions you just configured, fill in the WebHook URL.
|
||||
|
||||
|
||||
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
|
||||
|
||||

|
||||
@@ -1,29 +0,0 @@
|
||||
# Connect to Telegram Bot
|
||||
|
||||
## Create Bot
|
||||
|
||||
Go to the [Telegram Bot Creation Page](https://t.me/botfather), follow the prompts, and create a bot.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
After creation, BotFather will return an API Token, please keep it safe. Next, turn off `Privacy Mode` to use it in group chats.
|
||||
|
||||

|
||||
|
||||
## Connect to LangBot
|
||||
|
||||
Open the LangBot Webui page, create a new bot
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||
## Use Bot
|
||||
|
||||
Now you can use the bot normally in groups or private messages.
|
||||
|
||||

|
||||
|
||||

|
||||
@@ -1,79 +0,0 @@
|
||||
# Deploy WeCom Bot
|
||||
|
||||
Deploy the WeCom (Enterprise WeChat) bot to integrate with LangBot.
|
||||
|
||||
:::info
|
||||
- This integration is for internal enterprise applications, used within your organization. If external customer support is needed, please refer to the [WeCom Customer Service integration solution](wecomcs.md).
|
||||
- The WeCom callback address requires a public IP and domain name. We recommend you first follow [Configure HTTP Reverse Proxy](/en/workshop/production/proxy-and-ssl) to configure the LangBot callback address.
|
||||
:::
|
||||
|
||||
## Record Corporate ID
|
||||
|
||||
Open the [WeCom Admin Portal](https://work.weixin.qq.com/), click `My Enterprise`, and record the `Corporate ID` at the bottom.
|
||||
|
||||

|
||||
|
||||
## Create Bot
|
||||
|
||||
Click `App Management`, then `Build Your Own`, and click `Create App`.
|
||||
|
||||

|
||||
|
||||
Fill in the basic information for the bot:
|
||||
|
||||

|
||||
|
||||
View and record the bot's secret:
|
||||
|
||||

|
||||
|
||||
Get it from the WeCom client as prompted.
|
||||
|
||||
## Enable Contact Sync Permission
|
||||
|
||||
:::info
|
||||
- This configuration is required for LangBot to support mass messaging. The related code can be found at libs/wecom_api/api.py.
|
||||
- This feature has not been implemented yet as LangBot is still under development.
|
||||
- This field can be filled with any random characters, but **cannot be empty**.
|
||||
:::
|
||||
|
||||
Click `Security and Management`, then `Management Tools`, `Contact Sync`; configure the trusted IP by adding the IP address of the server where LangBot is deployed.
|
||||
|
||||
Click `View Secret` and record it - this is the contacts_secret (Contact Sync Secret).
|
||||
|
||||

|
||||
|
||||
## Create Bot on LangBot
|
||||
|
||||
On the LangBot bot page, click `Create Bot`, enter a name, select `WeCom`, and fill in the Corporate ID, Bot Secret, and Contact Sync Secret.
|
||||
|
||||

|
||||
|
||||
Click submit to enter the bot edit page, then click enable. At this point you'll see the Webhook callback address—copy it:
|
||||
|
||||

|
||||
|
||||
## Set Callback Address
|
||||
|
||||
Return to the WeCom bot admin page, click `Receive Messages`, `Set API Reception`, and paste LangBot's Webhook callback address into the `URL` field:
|
||||
|
||||

|
||||
|
||||
Click to randomly generate the Token and EncodingAESKey, and record them. **Keep this page open.** Go back to the LangBot WeCom bot configuration page, enter the Token and EncodingAESKey, and click Save.
|
||||
|
||||

|
||||
|
||||
Return to the **page where you just filled in the Webhook callback address**, and click Save to complete the configuration. If you see **request URL failed**, please carefully double-check your configuration.
|
||||
|
||||
## Configure Corporate Trusted IP
|
||||
|
||||
Go back to this application's admin page, find `Enterprise Trusted IP` at the bottom, and add the IP address of your LangBot deployment server.
|
||||
|
||||

|
||||
|
||||
Click Save.
|
||||
|
||||
## FAQ
|
||||
|
||||
Q: Can't find the bot chat in WeCom?
|
||||
A: Go to the app's detail page in WeCom admin, click `Features` > `Send Message` > `Send Message`, choose your own account, send a message, and you will see the bot in your chat window.
|
||||
@@ -1,59 +0,0 @@
|
||||
# Deploying WeCom Intelligent Bot
|
||||
|
||||
|
||||
## Creating a Bot
|
||||
|
||||
First, log in to the [WeCom Admin Console](https://work.weixin.qq.com/wework_admin/frame#/).
|
||||
|
||||

|
||||
|
||||
Click `Security And Management` in the left sidebar, then click `Intelligent Bot` under `Management Tool`.
|
||||
|
||||
As shown:
|
||||
|
||||

|
||||
|
||||
Click `Create Bot`, scroll to the bottom of the page, click `Create via API Mode`, and enter the page:
|
||||
|
||||

|
||||
|
||||
Click to randomly generate Token and EncodingAESKey, then fill in the basic bot information above. **Pay attention to setting the visibility scope**.
|
||||
|
||||
Click `My Company` in the left sidebar and save the Company ID at the bottom.
|
||||
|
||||
## Configuring Callback URL
|
||||
|
||||
Start the LangBot main program, select the adapter `WeCom Intelligent Bot`, and fill in the configuration items.
|
||||
Among them, the token is Token, the Encoding-AESKey is EncodingAESKey, and the Bot ID can be filled in as xxx (or filled in randomly, it will be changed later). After filling in, click
|
||||
`Save`, and `Enable` the robot.
|
||||
|
||||

|
||||
|
||||
On the LangBot homepage, enable and select the corresponding bot, click to enter the configuration page, copy the Webhook callback address
|
||||
|
||||
::: info
|
||||
We recommend that you first refer to [Configure HTTP Reverse Proxy](/en/workshop/production/proxy-and-ssl) to configure the LangBot callback address.
|
||||
:::
|
||||
|
||||

|
||||
|
||||
Return to the WeCom robot configuration page and fill the copied webhook address into `URL Callback`. If the creation is successful, it will jump to the details page. If the message `Request URL Failed` appears, please double-check whether the above steps have been completed one by one.
|
||||
|
||||
Details page after successful creation:
|
||||

|
||||
|
||||
Copy the `Bot ID` from the WeCom robot details page, return to the LangBot management page, change the Bot ID of the deployed intelligent robot to the copied ID, and restart the robot.
|
||||
|
||||
## Start Using
|
||||
|
||||
Enter WeCom, click `➕`, as shown:
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||
## Effect Images
|
||||
|
||||

|
||||
@@ -1,25 +0,0 @@
|
||||
# Deploy WeCom Customer Service
|
||||
|
||||
:::info
|
||||
|
||||
This article details the process of deploying LangBot to a WeCom customer service account, which allows conversations between the customer service account and regular WeChat. If you only need to use it within WeCom, please refer to [WeCom Internal Application Implementation](wecom.md).
|
||||
|
||||
**Deploying a WeCom customer service account requires enterprise qualifications**. Please check the [WeCom Customer Service Integration Guide](https://developer.work.weixin.qq.com/document/path/94638) and provide the corresponding enterprise qualification certificates according to this document.
|
||||
|
||||
:::
|
||||
|
||||
## Effect Demonstration
|
||||
|
||||

|
||||
|
||||
## Connect to LangBot
|
||||
|
||||

|
||||
|
||||
The subsequent configuration method and configuration items are the same as [WeCom Internal Application](wecom.md), except that `contacts_secret` is not required.
|
||||
|
||||
## Notes
|
||||
|
||||
1. Be sure to follow the steps in the official WeCom documentation above and add the customer service account to `API Management`.
|
||||
2. The steps are the same as for WeCom internal applications, don't miss anything. You also need to save the callback address, because essentially it's just adding other permissions to the WeCom internal application.
|
||||
3. LangBot will not read sensitive information such as chat records and enterprise qualification content.
|
||||
@@ -1,51 +0,0 @@
|
||||
# Deploy WeChat Official Account Bot
|
||||
|
||||
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:
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
For more complex functionality, please contact the **LangBot team** for customized support.
|
||||
|
||||
## Create Bot
|
||||
|
||||
Enter the [WeChat Official Account Platform](https://mp.weixin.qq.com/), if you already have an official account, scan the QR code to log in and enter the console.
|
||||
If you haven't registered an official account before, click Register Now, select `Official Account`, fill in the information in sequence, and enter the console. The console looks like this:
|
||||

|
||||
|
||||
|
||||
## Set Callback Address
|
||||
|
||||
### Get Configuration Items
|
||||
|
||||
Click `Settings and Development`, `Development Interface Management`, and you'll see a page like this:
|
||||

|
||||
|
||||
Record the `Developer ID (AppID)`, `Developer Password (AppSecret)`, and add the server where LangBot is deployed to the `IP Whitelist`.
|
||||
|
||||
### Set Up Reverse Proxy for LangBot
|
||||
|
||||
Since WeChat Official Accounts only support http (port 80) and https (port 443), please follow the documentation [Configure HTTP Reverse Proxy and SSL](/en/workshop/production/proxy-and-ssl) for configuration.
|
||||
|
||||
### Save Callback Address
|
||||
|
||||
Click Set Server Configuration, enter `Token`, `EncodingAESKey`, and change the message encryption/decryption method to `Safe Mode`.
|
||||
|
||||
At this point, open the LangBot Webui page, create a new bot, and fill in the four configuration items obtained (AppID, AppSecret, token, EncodingAESKey)
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||
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`.
|
||||
|
||||
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.
|
||||
Reference in New Issue
Block a user