Update update.md and plugin-intro.md to match Chinese structure

Co-Authored-By: Junyan Qin <Chin> <[email protected]>
This commit is contained in:
Devin AI
2025-05-13 15:34:30 +00:00
co-authored by Junyan Qin <Chin>
parent dbeb04eb38
commit af72d002dd
2 changed files with 54 additions and 150 deletions
+5 -83
View File
@@ -1,93 +1,15 @@
# Update LangBot
This guide explains how to update your LangBot installation to the latest version.
## Using Docker (or one-click deployment based on Docker)
## Docker Deployment
If you deployed LangBot using Docker, follow these steps to update:
1. Pull the latest image:
Please execute in the `docker-compose.yaml` directory:
```bash
docker pull rockchin/langbot:latest
docker compose up --force-recreate --pull always -d
```
2. Stop and remove the current container:
```bash
docker stop langbot
docker rm langbot
```
3. Start a new container with the latest image:
```bash
docker run -d --name langbot \
-p 5300:5300 \
-v /path/to/data:/app/data \
rockchin/langbot:latest
```
Replace `/path/to/data` with the path to your data directory.
This command will pull the latest LangBot image and rebuild the container.
## Manual Deployment
If you deployed LangBot manually, follow these steps to update:
1. Navigate to your LangBot directory:
```bash
cd /path/to/langbot
```
2. Pull the latest changes:
```bash
git pull
```
3. Update dependencies:
```bash
pip install -r requirements.txt
```
4. Restart LangBot:
```bash
python main.py
```
## Baota Panel Deployment
If you deployed LangBot using the Baota Panel, follow these steps to update:
1. Log in to your Baota Panel
2. Navigate to the LangBot website
3. Click on "Site Settings"
4. Click on "Update from Git"
5. Click "Update" to pull the latest changes
6. Restart the website
## Configuration Changes
After updating, check the [release notes](https://github.com/RockChinQ/LangBot/releases) for any configuration changes. You may need to update your `data/config.yaml` file to accommodate new features or changes.
## Database Migration
LangBot automatically handles database migrations during updates. However, it's always a good idea to back up your data directory before updating.
## Troubleshooting
If you encounter issues after updating, check the following:
1. Make sure your configuration file is compatible with the new version
2. Check the logs for any error messages
3. Ensure all dependencies are installed correctly
4. Verify that your model providers are still configured correctly
If problems persist, you can:
1. Join the [community chat](https://qm.qq.com/q/Nnz7Vbj8OU) for help
2. Open an issue on [GitHub](https://github.com/RockChinQ/LangBot/issues)
3. Revert to a previous version if necessary
Download the latest release's `langbot-<version>-all.zip` from the Assets section on the [Releases](https://github.com/RockChinQ/LangBot/releases) page, extract it to the original deployment directory, and restart.
+49 -67
View File
@@ -1,84 +1,66 @@
# Plugin Introduction
LangBot supports a powerful plugin system that allows you to extend its functionality. Plugins can add new commands, event handlers, and even integrate with external services.
:::info Table of Contents
[[toc]]
:::
## What Can Plugins Do?
## Plugin Categories
Plugins can:
**Plugins** are extension modules for LangBot, containing two types of executable content: **event listeners** and **content functions**. Event listeners are driven by events in the main program, while content functions are driven by content generated by GPT. Both driving methods are uniformly wrapped in the plugin class.
- Add new commands to the bot
- Handle and respond to various events (messages, group invitations, etc.)
- Integrate with external services and APIs
- Modify the behavior of the bot
- Add new functions that can be called by the LLM during conversations
- Extend the core components of LangBot
### Event Listeners
## Plugin Market
Plugins listen to various events during LangBot's operation. When an event occurs, LangBot calls the listener registered by the plugin with event-related information. Plugins can register listeners to be triggered in specific situations.
You can find and install plugins from the [LangBot Plugin Market](https://plugins.langbot.app).
### Content Functions
## Installing Plugins
Content functions differ from event-triggered plugins in that during a conversation, when the conversation content matches the description of a content function, GPT specifies which function to call, and LangBot makes the call.
This is implemented based on [GPT's Function Calling capability](https://platform.openai.com/docs/guides/gpt/function-calling), which is a function embedded in the conversation and automatically called by GPT.
### Method 1: Install via WebUI
> It's like the official ChatGPT plugins
1. Access the WebUI at `http://your-server-ip:5300`
2. Navigate to the "Plugins" section
3. Click "Install Plugin"
4. Enter the plugin's GitHub repository URL or select from the featured plugins
5. Click "Install"
### Method 2: Manual Installation
1. Download or clone the plugin repository
2. Place the plugin files in the `data/plugins` directory
3. Restart LangBot or use the `!plugin reload` command
## Managing Plugins
You can manage plugins using the following commands:
For example, if we provide GPT with a function `access_the_web` and provide detailed descriptions of it and its parameters, then when we talk to GPT about content similar to the following:
```
!plugin list
Q: Please search for QQ bot projects on GitHub?
Q: Please search for some good cloud service provider websites for me?
Q: Read and summarize this article: https://zhuanlan.zhihu.com/p/607570830
Q: Search for the weather in Qingyuan today
```
Lists all installed plugins.
GPT will respond with a function call request for `access_the_web`, LangBot will call the content function provided by the plugin, and return the call result to GPT for it to generate a new response.
Of course, the function calling feature is not limited to web access, it can also implement image processing, scientific calculations, trip planning, and other functions that require function calls. Theoretically, we can implement the same functionality as `ChatGPT Plugins` through content functions.
## Plugin Usage
### Installation
> This only provides the basic installation method for plugins, for details please check each plugin's documentation or consult its developer
#### Install from Plugin GitHub Repository
In the WebUI's plugin management page, click the `Install` button, enter the plugin's GitHub repository address, and click the `Install` button.
#### From Plugin Market
Install from the plugin market in the WebUI's plugin management page.
#### Manual Installation
Place the obtained plugin program in the `plugins` directory. For specific usage, please check each plugin's documentation or consult its developer.
### Management
#### !plugin Commands
```
!plugin enable <plugin_id>
!plugin List all installed plugins
!plugin get <repository address> Install a plugin from a GitHub repository address (requires administrator privileges)
!plugin update all Update all plugins (requires administrator privileges, only supports plugins installed from repositories)
!plugin update <plugin name> Update the specified plugin
!plugin del <plugin name> Delete a plugin (requires administrator privileges)
!plugin on <plugin name> Enable a plugin (requires administrator privileges)
!plugin off <plugin name> Disable a plugin (requires administrator privileges)
!func List all content functions
```
Enables the specified plugin.
```
!plugin disable <plugin_id>
```
Disables the specified plugin.
```
!plugin info <plugin_id>
```
Displays information about the specified plugin.
```
!plugin reload
```
Reloads all plugins.
## Popular Plugins
Here are some popular plugins for LangBot:
- **WebSearch**: Allows the bot to search the web and provide information
- **ImageGen**: Generates images using AI models like DALL-E or Stable Diffusion
- **Weather**: Provides weather information for specified locations
- **Translator**: Translates text between languages
- **Calculator**: Performs mathematical calculations
- **Schedule**: Schedules messages to be sent at specific times
- **GroupManager**: Provides group management features like welcome messages and anti-spam
## Developing Plugins
If you want to develop your own plugins, check out the [Plugin Development Tutorial](/en/plugin/dev/tutor).