feat(plugin_system): 引入插件HTTP端点系统
引入了全新的 `BaseRouterComponent` 组件类型,允许插件开发者通过继承并实现 `register_endpoints` 方法来创建 FastAPI 路由。 - 插件系统现在可以自动发现并注册这些路由组件,并将它们挂载到主 FastAPI 应用的 `/plugins/<plugin_name>` 前缀下。 - 新增了全局配置 `[plugin_http_system]`,提供了总开关、API 速率限制和 API 密钥认证 (`X-API-Key`) 等功能,以确保端点的安全性和稳定性。 - 更新了 `hello_world_plugin` 插件,增加了一个简单的 `/greet` 端点作为实现示例。
This commit is contained in:
committed by
Windpicker-owo
parent
fea007b429
commit
717d4ba555
@@ -34,6 +34,7 @@ from src.config.official_configs import (
|
||||
PermissionConfig,
|
||||
PersonalityConfig,
|
||||
PlanningSystemConfig,
|
||||
PluginHttpSystemConfig,
|
||||
ProactiveThinkingConfig,
|
||||
ReactionConfig,
|
||||
ResponsePostProcessConfig,
|
||||
@@ -414,6 +415,9 @@ class Config(ValidatedConfigBase):
|
||||
proactive_thinking: ProactiveThinkingConfig = Field(
|
||||
default_factory=lambda: ProactiveThinkingConfig(), description="主动思考配置"
|
||||
)
|
||||
plugin_http_system: PluginHttpSystemConfig = Field(
|
||||
default_factory=lambda: PluginHttpSystemConfig(), description="插件HTTP端点系统配置"
|
||||
)
|
||||
|
||||
|
||||
class APIAdapterConfig(ValidatedConfigBase):
|
||||
|
||||
Reference in New Issue
Block a user