Files
LangBot/en/plugin/dev/components/add.mdx
T
Xiaoyu SuandJunyan Chin 310c566148 refactor: migration to mintlify
* 重构文档结构:移除 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]>
2026-02-21 23:55:53 +08:00

75 lines
2.0 KiB
Plaintext

---
title: "Adding Components"
---
Plugins consist of one or more components that provide different functionalities to LangBot. Currently supported component types include:
- Event Listeners (EventListener): Listen to events during pipeline execution and modify context or pipelines.
- Commands (Command): Triggered by user command messages starting with `!` (or other configured prefixes).
- Tools (Tool): Called by LLMs during execution of LangBot's built-in Local Agent.
- Knowledge Retrievers (KnowledgeRetriever): Provide external knowledge base retrieval capabilities for LangBot, supporting integration with various RAG systems.
## Adding Components
Execute the command in the plugin directory:
```bash
lbp comp <component_type>
```
For example, to add an event listener:
```bash
lbp comp EventListener
```
Follow the prompts to enter the component configuration (if any).
```bash
➜ HelloPlugin > lbp comp EventListener
Generating component EventListener...
Component EventListener generated successfully.
组件 EventListener 生成成功。
➜ HelloPlugin >
```
<Info title="The CLI will generate a `components` directory in the plugin directory and create corresponding component directories within it.">
```
.
├── assets
│ └── icon.svg
├── components
│ ├── __init__.py
│ └── event_listener
│ ├── __init__.py
│ ├── default.py
│ └── default.yaml
├── main.py
├── manifest.yaml
├── README.md
└── requirements.txt
```
At the same time, component discovery configuration will be added to the plugin's `manifest.yaml`:
```yaml
...
components:
EventListener:
fromDirs:
- path: components/event_listener/
...
```
To remove components, you can delete the corresponding information manually.
</Info>
## Component Types
For detailed usage of each component, please refer to:
- [EventListener](./event-listener)
- [Command](./command)
- [Tool](./tool)
- [KnowledgeRetriever](./knowledge-retriever)