Plugin Introduction
Table of Contents
Plugin Categories
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.
Event Listeners
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.
Content Functions
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, which is a function embedded in the conversation and automatically called by GPT.
It's like the official ChatGPT plugins
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:
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
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 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