Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: 更多组件的可扩展性 #712

Merged
merged 9 commits into from
Mar 12, 2024
Merged

Conversation

RockChinQ
Copy link
Owner

@RockChinQ RockChinQ commented Mar 8, 2024

概述

为以下组件增强可扩展性:

  • 命令算子
  • 启动阶段
  • 请求处理阶段
  • 内容过滤器
  • 长消息处理策略
  • 限速算法
  • 群消息响应规则
  • 消息平台适配器
  • 插件安装器
  • 插件加载器
  • LLM API 请求器
  • 分词器
  • Prompt 加载器

@RockChinQ RockChinQ linked an issue Mar 8, 2024 that may be closed by this pull request
@RockChinQ RockChinQ added this to the 3.1 milestone Mar 8, 2024
@RockChinQ RockChinQ added m: 插件 插件加载及管理模块 代码风格 代码风格或重构相关 labels Mar 8, 2024
@RockChinQ
Copy link
Owner Author

RockChinQ commented Mar 8, 2024

统一的组件扩展性

上述组件(以及潜在的更多组件)主要基于策略模式进行抽象,PR合并后将均以以下的模式实现高可扩展性:

组件抽象类

作为模板提供该组件被上层所需的接口。

组件实现

继承并实现抽象类,这是可扩展性的代码部分。

预注册

在模块导入阶段,通过 Python 的装饰器功能把实现类注册并保存到某个列表中(通常位于抽象类所处的模块)。

构造组件运行时对象

由组件使用者,根据配置文件选择需要的组件,并实例化和使用。

@RockChinQ RockChinQ marked this pull request as ready for review March 12, 2024 16:32
@RockChinQ RockChinQ merged commit 63303bb into master Mar 12, 2024
1 check failed
@RockChinQ RockChinQ deleted the feat/component-extensibility branch March 12, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
m: 插件 插件加载及管理模块 代码风格 代码风格或重构相关
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: 支持更多组件的可扩展性
1 participant