feat 辅助识别异步接口 && ChatGPT插件支持辅助名称识别

This commit is contained in:
jxxghp
2023-10-12 11:41:57 +08:00
parent af2f52a050
commit 2a9a36ac88
22 changed files with 275 additions and 101 deletions

View File

@ -32,6 +32,12 @@ class EventManager(metaclass=Singleton):
except Empty:
return None, []
def check(self, etype: EventType):
"""
检查事件是否存在响应
"""
return etype.value in self._handlers
def add_event_listener(self, etype: EventType, handler: type):
"""
注册事件处理

View File

@ -87,6 +87,17 @@ class MetaBase(object):
return self.cn_name
return ""
@name.setter
def name(self, name: str):
"""
设置名称
"""
if StringUtils.is_all_chinese(name):
self.cn_name = name
else:
self.en_name = name
self.cn_name = None
def init_subtitle(self, title_text: str):
"""
副标题识别

View File

@ -177,6 +177,12 @@ class PluginManager(metaclass=Singleton):
return None
return getattr(self._running_plugins[pid], method)(*args, **kwargs)
def get_plugin_ids(self) -> List[str]:
"""
获取所有插件ID
"""
return list(self._plugins.keys())
def get_plugin_apps(self) -> List[dict]:
"""
获取所有插件信息