mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
The llm tool called upstream providers through the litellm fork, read provider keys, and never reached the MCP surface: its register() was a no-op and it skipped BaseTool's constructor. Kai had no Python tool. hanzo-tools-llm now carries two HIP-0300 tools over HanzoCloud: - llm (default action query): POST /v1/chat/completions with model enso-auto unless named, "auto" for Enso's pick, max_cost and max_latency_ms as X-Max-Cost and X-Max-Latency-Ms, returning id and the model that served; models: GET /v1/models, one row per model with the catalog's per-million prices, narrowed by family; feedback: POST /v1/ai/feedback with request_id, signal and a 1-3 rating. - kai_decide (default action decide): POST /v1/decisions with the TypeScript tool's schema and shape checks. The consensus, llm_manage and provider modules wrapped the upstream client and were never registered, so they go, with hanzo-consensus and the [full] extra. hanzo-tools-llm 0.2.1. Co-authored-by: Hanzo Dev <[email protected]>
hanzo-tools-core
Core infrastructure for Hanzo MCP tools.
Installation
pip install hanzo-tools-core
Components
BaseTool
Base class for all Hanzo tools.
from hanzo_tools.core import BaseTool
class MyTool(BaseTool):
name = "my_tool"
@property
def description(self) -> str:
return "My custom tool"
async def call(self, ctx, **params) -> str:
return "result"
ToolRegistry
Manage tool registration and discovery.
from hanzo_tools.core import ToolRegistry
ToolRegistry.register_tools(mcp_server, [MyTool()])
PermissionManager
Access control for file and command operations.
from hanzo_tools.core import PermissionManager
pm = PermissionManager(allowed_paths=["/home/user/project"])
if pm.can_access("/home/user/project/file.py"):
# proceed
Decorators
from hanzo_tools.core import auto_timeout
@auto_timeout("my_tool")
async def my_function():
# Auto-backgrounds after timeout
pass
License
MIT