Request API
Operations for the currently processing user request (message). Only available inEventListener and Command components. Access methods:
- In event handler methods of
EventListener: Internal methods ofevent_context: context.EventContextobject - In subcommand handler methods of
Command: Internal methods ofcontext: ExecuteContextobject
Direct Reply Message
Directly reply with a message chain to the session where the current request is located. For message chain construction methods, please refer to Message Platform Entities.Get Bot UUID
Get the UUID of the bot that originated the current request.Set Request Variables
Some information in a single request is stored in request variables. When using external LLMOps platforms like Dify, these variables are explicitly passed to LLMOps platforms.Get Request Variables
Get a single request variable.Get All Request Variables
LangBot API
These APIs can be called in any plugin component. Access methods:- In the plugin root directory
main.py: Internal methods of theselfobject, these APIs are all provided by the plugin class parent classBasePlugin. - In any plugin component class: Internal methods of the
self.pluginobject.
Get Plugin Configuration
Plugin configuration format can be written inmanifest.yaml, and users need to fill it out according to the plugin configuration format in LangBot’s plugin management. Plugin code can then call this API to get plugin configuration information.
Get LangBot Version
Get the LangBot version number, returned as a string in formatv<major>.<minor>.<patch>.
Get Configured Bot List
Returns a list of all bot UUIDs.Get Bot Information
Get bot information.Send Proactive Message
Send proactive messages through bot UUID and target session ID. For message chain construction methods, please refer to Message Platform Entities.Get Configured LLM Model List
Returns a list of UUIDs for all configured LLM models.Invoke LLM Model
Invoke an LLM model, returns an LLM message. Non-streaming.Set Plugin Persistent Data
Persistently store plugin data. Data stored through this interface can only be accessed by this plugin. Values need to be converted to bytes manually.Get Plugin Persistent Data
Get All Plugin Persistent Data Keys
Delete Plugin Persistent Data
Get Workspace Persistent Data
Data stored through this interface can be accessed by all plugins. Values need to be converted to bytes manually.Get Workspace Persistent Data
Get All Workspace Persistent Data Keys
Delete Workspace Persistent Data
Get Plugin File-typed Config Field Data
file or array[file.