mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
Say what pip installs, and fix two examples that no longer import
pip install hanzoai on 3.12 gets 8.5.156, which has no Client; on 3.9 to 3.11 it gets the 2.1 line, a different client. The README said neither. It showed KeysApi and MemoryApi, which the generated client does not have, and mapped hanzo-agent and hanzo-agents to copies here that PyPI does not publish. examples/agent and examples/tools imported AgentsApi and ToolsApi, which the document now names AgentApi and ToolApi. Both flows ran against a local server after the change. The per-agent runs read is generated without its ref, so the agent flow reads /v1/agent/runs and keeps its own rows. The status table and the Retry-After lines come from runs against a local server: a capability call is one request, two on a 401; a generated operation sleeps for Retry-After on 429 or 503 and retries three times. Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""tools — list the tools this key can reach.
|
||||
|
||||
``GET /v1/tools`` (operationId ``get_tools``), the catalog behind the
|
||||
``GET /v1/tool`` (operationId ``get_tool``), the catalog behind the
|
||||
MCP surface: each entry is a tool name, its description and its input schema.
|
||||
|
||||
A note on the MCP endpoints, because it is easy to pick the wrong one. There is a
|
||||
@@ -14,14 +14,14 @@ served. When ``/v1/mcp`` is added to the spec, this flow should move to it.
|
||||
python -m examples.tools
|
||||
"""
|
||||
|
||||
from hanzoai.cloud import ToolsApi
|
||||
from hanzoai.cloud import ToolApi
|
||||
|
||||
from examples.client import client, run
|
||||
|
||||
|
||||
def main() -> None:
|
||||
with client() as api:
|
||||
catalog = ToolsApi(api).get_tools()
|
||||
catalog = ToolApi(api).get_tool()
|
||||
|
||||
tools = catalog.tools or []
|
||||
print(f"{len(tools)} tools")
|
||||
|
||||
Reference in New Issue
Block a user