-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path__init__.py
More file actions
67 lines (59 loc) · 1.37 KB
/
__init__.py
File metadata and controls
67 lines (59 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import importlib
import typing as t
from dreadnode.agent.tools.base import (
AnyTool,
FunctionCall,
FunctionDefinition,
Tool,
ToolCall,
ToolDefinition,
ToolMode,
Toolset,
discover_tools_on_obj,
tool,
tool_method,
)
if t.TYPE_CHECKING:
from dreadnode.agent.tools import execute, fs, interaction, memory, planning, reporting, tasking
__all__ = [
"AnyTool",
"FunctionCall",
"FunctionDefinition",
"Tool",
"ToolCall",
"ToolDefinition",
"ToolMode",
"Toolset",
"discover_tools_on_obj",
"execute",
"fs",
"interaction",
"memory",
"planning",
"reporting",
"tasking",
"tool",
"tool_method",
]
__lazy_submodules__: list[str] = [
"execute",
"fs",
"interaction",
"memory",
"planning",
"reporting",
"tasking",
]
__lazy_components__: dict[str, str] = {}
def __getattr__(name: str) -> t.Any:
if name in __lazy_submodules__:
module = importlib.import_module(f".{name}", __name__)
globals()[name] = module
return module
if name in __lazy_components__:
module_name = __lazy_components__[name]
module = importlib.import_module(module_name)
component = getattr(module, name)
globals()[name] = component
return component
raise AttributeError(f"module '{__name__}' has no attribute '{name}'")