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:
parent
347fddea0f
commit
90e158f2fe
9 changed files with 1141 additions and 0 deletions
6
clients/python/examples/basic.py
Normal file
6
clients/python/examples/basic.py
Normal 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue