Skip to content

Regenerate hanzoai client from unified OpenAPI spec (retire Stainless) - #45

Merged
zeekay merged 1 commit into
mainfrom
sdk/openapi-generator
Jul 5, 2026
Merged

Regenerate hanzoai client from unified OpenAPI spec (retire Stainless)#45
zeekay merged 1 commit into
mainfrom
sdk/openapi-generator

Conversation

@zeekay

@zeekay zeekay commented Jul 5, 2026

Copy link
Copy Markdown
Member

Retire Stainless; regenerate from hanzoai/openapi hanzo.yaml with openapi-generator (full api.hanzo.ai/v1 surface, all /v1 products). scripts/generate.sh is the one-way generator; CI regenerates on spec-update and publishes on semver tag. Verified locally (build/import/smoke green). (wheel hanzoai-3.0.0 builds+installs+imports; pydantic v2 / urllib3)

…ainless)

Replace the Stainless-generated `hanzoai` client (188 legacy LLM-gateway
endpoints) with an openapi-generator `python` (urllib3 + pydantic v2)
client built from hanzoai/openapi `hanzo.yaml` — the full unified
api.hanzo.ai/v1 surface (493 API groups, 1710 models, all /v1 products).

- scripts/generate.sh: the one-way generator; emits only pkg/hanzoai
  (other pkg/hanzo-* packages untouched).
- pyproject: deps -> urllib3 / python-dateutil / pydantic>=2 /
  typing-extensions; version 2.2.3 -> 3.0.0 (breaking surface change).
- tests/: Stainless client tests replaced with a surface smoke test.
- .github/workflows/generate.yml: regenerate on openapi spec-update.
- Base URL https://api.hanzo.ai, Bearer hk- / JWT auth.

Verified: wheel hanzoai-3.0.0 builds, installs into a clean venv, and
`import hanzoai` + product API construction succeed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@zeekay
zeekay merged commit 7d44d89 into main Jul 5, 2026
0 of 17 checks passed
zooqueen pushed a commit that referenced this pull request Jul 5, 2026
…hanzo-mcp (3.0.1)

#45 regenerated hanzoai as a pure OpenAPI client and DELETED the hand-written
core-SDK modules (config/mcp/session/protocols/…) that live in the same package
but aren't part of API generation. hanzo-mcp imports all four → the published
hanzoai 3.0.0 crashed EVERY hanzo-mcp consumer on startup ('No module named
hanzoai.protocols') → the MCP server wouldn't boot → Claude Code couldn't
reconnect. Restore the 4 self-contained modules hanzo-mcp needs (verified: zero
imports of the removed Stainless internals); they coexist with the generated
api/models client. Left agents/auth/cluster/llm_client OUT — they import the
removed ._client and need migration to the new client (separate follow-up, no
reconnect-path consumer). Bump 3.0.0→3.0.1. Boot-proven: hanzo-mcp starts,
26 tool packages / 29 tools, MCP initialize OK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant