ltcai 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -8
- package/docs/CHANGELOG.md +59 -0
- package/kg_schema.py +179 -518
- package/knowledge_graph.py +183 -80
- package/latticeai/core/agent.py +2 -2
- package/latticeai/core/agent_prompts.py +101 -0
- package/latticeai/core/tool_registry.py +288 -0
- package/latticeai/server_app.py +5806 -0
- package/package.json +2 -2
- package/server.py +13 -6259
- package/tools.py +6 -5
package/tools.py
CHANGED
|
@@ -21,6 +21,7 @@ from typing import Any, Callable, Dict, List, Optional
|
|
|
21
21
|
|
|
22
22
|
_PLATFORM = platform.system() # "Darwin" | "Windows" | "Linux"
|
|
23
23
|
|
|
24
|
+
from latticeai.core.tool_registry import ToolRegistry
|
|
24
25
|
from p_reinforce import BRAIN_DIR, STRUCTURE
|
|
25
26
|
|
|
26
27
|
# ── Computer Use ──────────────────────────────────────────────────────────────
|
|
@@ -1512,13 +1513,13 @@ TOOL_HANDLERS: Dict[str, Callable[[Dict[str, Any]], Dict[str, Any]]] = {
|
|
|
1512
1513
|
}
|
|
1513
1514
|
|
|
1514
1515
|
|
|
1516
|
+
DEFAULT_TOOL_REGISTRY = ToolRegistry(TOOL_HANDLERS)
|
|
1517
|
+
|
|
1518
|
+
|
|
1515
1519
|
def registered_tools() -> frozenset:
|
|
1516
1520
|
"""Names dispatchable through ``execute_tool`` — the seam other modules verify against."""
|
|
1517
|
-
return
|
|
1521
|
+
return DEFAULT_TOOL_REGISTRY.registered_tools()
|
|
1518
1522
|
|
|
1519
1523
|
|
|
1520
1524
|
def execute_tool(action: str, args: Dict[str, Any]) -> Dict[str, Any]:
|
|
1521
|
-
|
|
1522
|
-
if handler is None:
|
|
1523
|
-
raise ToolError(f"Unknown action: {action}")
|
|
1524
|
-
return handler(args)
|
|
1525
|
+
return DEFAULT_TOOL_REGISTRY.execute(action, args, error_cls=ToolError)
|