clients/python: initial Python SDK for clawdforge

Sync requests-based SDK in clients/python/. Wraps /healthz, /run, /files,
and /admin/tokens behind a Forge class with typed exceptions
(ForgeError + Transport/API/Auth subclasses) and dataclass response shapes
(RunResult, FileToken, AppToken). HTTP timeout = run timeout + 30s margin,
matching the pattern cauldron has been running inline. No retries —
caller's job since /run isn't idempotent.

24 unit tests via responses, all passing. Install with
pip install -e clients/python/.
This commit is contained in:
Kayos 2026-04-28 22:27:08 -07:00
parent 347fddea0f
commit 90e158f2fe
9 changed files with 1141 additions and 0 deletions

View file

@ -0,0 +1,6 @@
"""3-line clawdforge usage."""
import os
from clawdforge import Forge
with Forge(base_url=os.environ["CLAWDFORGE_URL"], token=os.environ["CLAWDFORGE_TOKEN"]) as forge:
print(forge.run(prompt='Reply with JSON: {"hello": "world"}').result)