The SDK is organized into resources (resources/), stateful handles
(handles/), the sandbox runtime client (runtime/), and HTTP transports
(transport/). Lifecycle agents live in resources/agents.py and
resources/agent_templates.py with handles in handles/agent.py.
git clone https://github.com/NeevCloudAI/neev-sdk-python.git
cd neev-sdk-python
uv sync --extra dev| Command | What it does |
|---|---|
uv run ruff check . |
Lint all Python sources |
uv run ruff format . |
Auto-format sources |
uv run ruff format --check . |
Check formatting only |
uv run pytest -v |
Run all tests |
uv run pyright |
Static type check (Pyright) |
uv run mypy |
Static type check (mypy) |
uv run python scripts/gen_types.py |
Regenerate OpenAPI types from specs |
The SDK uses datamodel-code-generator
to produce Pydantic v2 BaseModel classes from each vendored OpenAPI spec in specs/.
Add a new spec file and run:
uv run python scripts/gen_types.pyGenerated files land in src/neevai/generated/. Do not edit them by hand.
After regenerating types, manually verify type field tables in
docs/api-inventory.md match src/neevai/generated/. Type tables live in the
inventory only — not in api-reference.md. When adding a new API
resource, follow the agents implementation as the latest reference:
resources/agents.py, resources/agent_templates.py, handles/agent.py, and
tests/test_agents.py.
Today, OpenAPI specs are vendored locally under specs/. This is an
intentional interim deviation from the canonical layout (which expects
monorepo public-specs/). The workflow is unchanged:
- Update or add
specs/<service>.yaml. - Run
uv run python scripts/gen_types.py. - Commit both the spec change and regenerated
src/neevai/generated/.
The target end state:
- CI checks out the monorepo
public-specs/directory. - CI sets
NEEV_PUBLIC_SPECSto that checkout path. - CI runs
uv run python scripts/gen_types.py. - CI verifies
git diff --exit-code src/neevai/generated. - The local
specs/directory is removed once monorepo wiring is confirmed.
For local monorepo development today, point at the shared specs checkout:
export NEEV_PUBLIC_SPECS=/path/to/monorepo/public-specs
uv run python scripts/gen_types.pyWhen NEEV_PUBLIC_SPECS is set, scripts/gen_types.py reads specs from
that directory instead of the vendored specs/ copy.
Tests use pytest with mock HTTP transports — no network access is required.
uv run pytest -vAll tests are under tests/.
Ruff enforces a consistent code style:
uv run ruff check . # Find issues
uv run ruff format . # Fix formattingThe CI workflow runs linting, formatting checks, Pyright and mypy type
checks, type generation verification, tests, and a build step. It is
defined in .github/workflows/python-ci.yml.
Any PR that modifies public SDK exports must update:
docs/api-reference.md— API lists and inline snippet table (this file)docs/api-inventory.md— method signatures, type field tables, symbol indexdocs/example-coverage.md— example catalog and API → examples lookupdocs/getting-started.md— if install, env vars, or quick-start flows changeexamples/— if a new capability lacks a runnable example
Type field tables live in api-inventory.md only — not here.
After scripts/gen_types.py, verify type tables in the inventory against
src/neevai/generated/.
Update manually when the public API changes. Cross-check against src/neevai/.
On API changes, also update:
docs/getting-started.md— if install, env vars, or quick-start flows changedocs/api-reference.md— API/sandbox runtime lists and inline snippet tabledocs/example-coverage.md— example catalog and API → examples lookupexamples/— if a new capability lacks an example
After scripts/gen_types.py, verify type field tables here only match
src/neevai/generated/. Type tables live in this inventory, not in
api-reference.md.
When you add or change an example, or introduce a new public API:
- Update the example catalog row.
- Update the inverse index so each new or
changed API points at the right example(s) and includes a representative
snippet (prefer the pattern used in the linked example; fall back to
api-reference.mdone-liners when they match). - Cross-check
api-reference.mdrunnable-example links.