feat: 0.2.0 platform SDK for OpenAPI 0.7 - #18
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 graphncan 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 onlymodel.graphn.ai/v1/models, which in prod returns imported/custom rows. Built-ins are onGET https://cp.graphn.ai/v1/models(same asgraphn model list). List now merges both.workflows.createdid not auto-link DSLagents/functions/mcp_servers. The CLI does that viasave_bundle. Create/update now do the same (link_resources=Falseto 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
openaipackage.Companion PRs
How to verify
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/isopenapi-python-clientoutput from the 0.7 spec — do not edit by hand.models.listandworkflows.createauto-link are the two behaviors that diverged from the CLI in live smoke.Merging this cuts
graphn==0.2.0on PyPI via the existing auto-tag release workflow. Coordinate with takao#2936 so the mirrored public spec exists before (or with) the SDK release.