mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-30 04:15:45 +08:00
* 重构文档结构:移除 docs 目录,调整文件组织结构 * Reorder "插件 SDK API" section in docs.json * Refactor and clarify various documentation sections * Refine warnings and info boxes across multiple docs * Refactor and simplify Japanese documentation content * Update package.json to include mintlify as a dependency and add pnpm-lock.yaml for dependency management * Update blog link and add description in docs.json --------- Co-authored-by: Junyan Chin <[email protected]>
28 lines
2.0 KiB
Plaintext
28 lines
2.0 KiB
Plaintext
---
|
|
title: "Migration Guide"
|
|
---
|
|
|
|
This tutorial highlights certain considerations. Please read the current version plugin tutorial first, then use this document as a reference for plugin migration.
|
|
|
|
## Migrating from 3.x Supported Asynchronous Plugins
|
|
|
|
<Info title="Plugin characteristics:">
|
|
- Main time period: 2024.2 ~ 2025.8
|
|
- Registration method: Using `@handler` decorators to register event listeners and `@llm_func` decorators to register content functions (tools) in the plugin class in `main.py`; all handler functions are asynchronous functions (async def)
|
|
</Info>
|
|
|
|
- Plugin and component registration method: Changed from the previous single plugin class decorator registration method to manifest file registration method. See [Manifest File](/en/plugin/dev/basic-info); and separated different types of components independently. For details, see [Adding Components](/en/plugin/dev/components/add).
|
|
- Message chain entities: Now refactored. The construction method of each message chain element now requires explicit passing of **named parameters**. See [Message Platform Entities](/en/plugin/dev/apis/messages).
|
|
- Event listeners: Provides backward compatibility, but no longer provides `query: Query` object in context. For details, see [Pipeline Events](/en/plugin/dev/apis/pipeline-events).
|
|
- Command components: Now refactored. See [Command Components](/en/plugin/dev/components/command).
|
|
|
|
## Migrating from 2.x and 3.x Supported Synchronous Plugins
|
|
|
|
<Info title="Plugin characteristics:">
|
|
- Main time period: 2023.1 ~ 2024.2
|
|
- Registration method: Using `@on` decorators to register event listeners and `@func` decorators to register content functions (tools) in the plugin class in `main.py`; all handler functions are synchronous functions (def)
|
|
</Info>
|
|
|
|
- Synchronous to asynchronous: Plugin runtime has now changed to fully asynchronous (based on asyncio). Please change all plugin code involving IO operations to asynchronous writing.
|
|
- For detailed content, please refer to the above 3.x asynchronous plugin migration guide.
|