修改了nanobot,往Hermes agent的风格走,进度1/3
This commit is contained in:
31
app-instance/backend/beaver/engine/__init__.py
Normal file
31
app-instance/backend/beaver/engine/__init__.py
Normal file
@ -0,0 +1,31 @@
|
||||
"""Unified Beaver agent engine.
|
||||
|
||||
这里不做顶层 eager import,避免子模块导入时触发循环依赖。
|
||||
对外仍然保留同样的导出名称,但改成按需加载。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
__all__ = ["AgentLoop", "AgentProfile", "AgentRunResult", "EngineLoader", "EngineLoadResult"]
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
if name == "EngineLoader":
|
||||
from .loader import EngineLoader
|
||||
|
||||
return EngineLoader
|
||||
if name == "EngineLoadResult":
|
||||
from .loader import EngineLoadResult
|
||||
|
||||
return EngineLoadResult
|
||||
if name in {"AgentLoop", "AgentProfile", "AgentRunResult"}:
|
||||
from .loop import AgentLoop, AgentProfile, AgentRunResult
|
||||
|
||||
return {
|
||||
"AgentLoop": AgentLoop,
|
||||
"AgentProfile": AgentProfile,
|
||||
"AgentRunResult": AgentRunResult,
|
||||
}[name]
|
||||
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
||||
Reference in New Issue
Block a user