mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 12:05:54 +00:00
feat: get plugin info
This commit is contained in:
@@ -98,6 +98,9 @@ class PluginRuntimeConnector:
|
||||
async def list_plugins(self) -> list[dict[str, Any]]:
|
||||
return await self.handler.list_plugins()
|
||||
|
||||
async def get_plugin_info(self, author: str, plugin_name: str) -> dict[str, Any]:
|
||||
return await self.handler.get_plugin_info(author, plugin_name)
|
||||
|
||||
async def emit_event(
|
||||
self,
|
||||
event: events.BaseEventModel,
|
||||
|
||||
@@ -372,6 +372,18 @@ class RuntimeConnectionHandler(handler.Handler):
|
||||
|
||||
return result['plugins']
|
||||
|
||||
async def get_plugin_info(self, author: str, plugin_name: str) -> dict[str, Any]:
|
||||
"""Get plugin"""
|
||||
result = await self.call_action(
|
||||
LangBotToRuntimeAction.GET_PLUGIN_INFO,
|
||||
{
|
||||
'author': author,
|
||||
'plugin_name': plugin_name,
|
||||
},
|
||||
timeout=10,
|
||||
)
|
||||
return result['plugin']
|
||||
|
||||
async def emit_event(
|
||||
self,
|
||||
event_context: dict[str, Any],
|
||||
|
||||
Reference in New Issue
Block a user