Skip to content

feat: 0.2.0 platform SDK for OpenAPI 0.7 - #18

Merged
kunwar-vp merged 1 commit into
mainfrom
feature/0.2.0-platform-sdk
Aug 15, 2026
Merged

feat: 0.2.0 platform SDK for OpenAPI 0.7#18
kunwar-vp merged 1 commit into
mainfrom
feature/0.2.0-platform-sdk

Conversation

@kunwar-vp

@kunwar-vp kunwar-vp commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Why

v0.1.x only wrapped custom-model import + OpenAI-compatible inference. OpenAPI 0.7.0 now describes the full CLI-reachable GraphN API; this release adds first-party wrappers so pip install graphn can create workflows, agents, functions, KBs, and run them.

Live prod smoke against this tree also showed two customer-facing gaps vs the CLI:

  • client.models.list() hit only model.graphn.ai/v1/models, which in prod returns imported/custom rows. Built-ins are on GET https://cp.graphn.ai/v1/models (same as graphn model list). List now merges both.
  • workflows.create did not auto-link DSL agents/functions/mcp_servers. The CLI does that via save_bundle. Create/update now do the same (link_resources=False to skip).

Alternatives considered

Official TS/Go packages were rejected; generated clients consume the public spec. Wrapping every generated operation 1:1 was rejected in favor of hand-written resource modules over httpx, with chat still delegated to the official openai package.

Companion PRs

How to verify

.venv/bin/ruff check src tests && .venv/bin/ruff format --check src tests && .venv/bin/pytest -q

88 tests passed locally. Live prod smoke (CP + inference + storage + gateway async/batch) was 25/25 on this tree after the list/auto-link fixes.

Reviewer focus

Hand-written modules (src/graphn/*.py), not _generated/. _generated/ is openapi-python-client output from the 0.7 spec — do not edit by hand.

models.list and workflows.create auto-link are the two behaviors that diverged from the CLI in live smoke.

Merging this cuts graphn==0.2.0 on PyPI via the existing auto-tag release workflow. Coordinate with takao#2936 so the mirrored public spec exists before (or with) the SDK release.

Wrap the CLI-reachable Graphn API (workflows, agents, functions, KBs,
storage, gateway async/batch). models.list merges the CP catalog with
inference; workflow create/update auto-link DSL resources like the CLI.
@kunwar-vp
kunwar-vp merged commit 9ae4548 into main Aug 15, 2026
7 checks passed
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