本次提交完成了一系列核心功能迭代与优化: 1. 新增并完善了多个领域模型与端口定义,补充了`__all__`导出规范 2. 优化了会话、绑定、出箱等模块的数据模型,修复了时间字段类型不一致问题 3. 新增了代理ID解析、缓存发布等接口,扩展了系统能力 4. 重构了去重中间件逻辑,优化了空内容校验规则 5. 新增了认证中间件的匿名访问支持,完善了鉴权流程 6. 优化了SSE连接管理,增加了单会话连接上限限制 7. 重构了消息日志与仓储相关代码,将数据类迁移至对应模型目录 8. 新增了重复绑定校验、绑定更新接口,完善了绑定服务逻辑 9. 优化了健康检查逻辑,新增了环境变量控制启动时间线展示 10. 重构了出箱重试工作线程,使用缓存端口替代直接redis操作,新增了消息处理标记逻辑 11. 完善了飞书、Web、钩子等通道的翻译器逻辑,补充了账户ID传递 12. 新增了多种自定义异常类型,优化了异常映射与错误处理流程 13. 完善了配置热重载逻辑,同步认证凭证与校验器配置 14. 重构了Redis缓存实现,增加了异常捕获与包装
69 lines
3.2 KiB
Python
69 lines
3.2 KiB
Python
_LAZY_IMPORTS = {
|
|
"AgentError": "yuxi.channel.domain.event",
|
|
"MessageBlocked": "yuxi.channel.domain.event",
|
|
"MessageReceived": "yuxi.channel.domain.event",
|
|
"MessageReplied": "yuxi.channel.domain.event",
|
|
"ABORT_CODE_TO_HTTP": "yuxi.channel.domain.exception",
|
|
"AgentCrashError": "yuxi.channel.domain.exception",
|
|
"ChannelError": "yuxi.channel.domain.exception",
|
|
"RecoverableError": "yuxi.channel.domain.exception",
|
|
"UnrecoverableError": "yuxi.channel.domain.exception",
|
|
"CallNext": "yuxi.channel.domain.middleware",
|
|
"Configurable": "yuxi.channel.domain.middleware",
|
|
"Middleware": "yuxi.channel.domain.middleware",
|
|
"Attachment": "yuxi.channel.domain.model",
|
|
"ChannelBinding": "yuxi.channel.domain.model",
|
|
"ChannelCapabilities": "yuxi.channel.domain.model",
|
|
"ChannelSession": "yuxi.channel.domain.model",
|
|
"ChannelType": "yuxi.channel.domain.model",
|
|
"DispatchResult": "yuxi.channel.domain.model",
|
|
"MessagePriority": "yuxi.channel.domain.model",
|
|
"MessageType": "yuxi.channel.domain.model",
|
|
"OutboxEntry": "yuxi.channel.domain.model",
|
|
"Peer": "yuxi.channel.domain.model",
|
|
"SendResult": "yuxi.channel.domain.model",
|
|
"StreamChatRequest": "yuxi.channel.domain.model",
|
|
"UnifiedMessage": "yuxi.channel.domain.model",
|
|
"AgentPort": "yuxi.channel.domain.port",
|
|
"BotLoopGuardPort": "yuxi.channel.domain.port",
|
|
"KeywordMatcherPort": "yuxi.channel.domain.port",
|
|
"CachePort": "yuxi.channel.domain.port",
|
|
"ChannelAdapterPort": "yuxi.channel.domain.port",
|
|
"ChannelRouteContributorPort": "yuxi.channel.domain.port",
|
|
"CircuitBreakerPort": "yuxi.channel.domain.port",
|
|
"ConfigReloadPort": "yuxi.channel.domain.port",
|
|
"ContentFilterPort": "yuxi.channel.domain.port",
|
|
"DomainEvent": "yuxi.channel.domain.port",
|
|
"EventPublisherPort": "yuxi.channel.domain.port",
|
|
"FilterResult": "yuxi.channel.domain.port",
|
|
"MetricsPort": "yuxi.channel.domain.port",
|
|
"QueuePort": "yuxi.channel.domain.port",
|
|
"RateLimitPort": "yuxi.channel.domain.port",
|
|
"SignatureVerifyPort": "yuxi.channel.domain.port",
|
|
"SsePushPort": "yuxi.channel.domain.port",
|
|
"WsConnectionPort": "yuxi.channel.domain.port",
|
|
"BindingRepositoryPort": "yuxi.channel.domain.repository",
|
|
"ChannelMessageData": "yuxi.channel.domain.model.message.channel_message_data",
|
|
"MessageLogData": "yuxi.channel.domain.model.message_log.message_log_data",
|
|
"MessageLogQuery": "yuxi.channel.domain.model.message_log.message_log_data",
|
|
"MessageLogRepositoryPort": "yuxi.channel.domain.repository",
|
|
"MessageRepositoryPort": "yuxi.channel.domain.repository",
|
|
"OutboxRepositoryPort": "yuxi.channel.domain.repository",
|
|
"SessionRepositoryPort": "yuxi.channel.domain.repository",
|
|
"MessageContext": "yuxi.channel.domain.service",
|
|
"Span": "yuxi.channel.domain.service",
|
|
"Pipeline": "yuxi.channel.domain.service",
|
|
"PipelineBuilder": "yuxi.channel.domain.service",
|
|
}
|
|
|
|
|
|
def __getattr__(name: str):
|
|
if name in _LAZY_IMPORTS:
|
|
module = __import__(_LAZY_IMPORTS[name], fromlist=[name])
|
|
return getattr(module, name)
|
|
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
|
|
|
|
def __dir__():
|
|
return sorted(set(globals()) | set(_LAZY_IMPORTS.keys()))
|