Install
Pick one of two starting points based on what you’re doing:httpx + pydantic and nothing else.
Adapters and verifiers compose with either base
Extras stack. Comma-separate them in one bracket to install in a single command:All extras
| Extra | Adds |
|---|---|
server | FastAPI server, CLI, bundled dashboard |
temporal | Temporal workflow adapter |
langgraph | LangGraph interrupt/resume adapter |
verifier-claude | Anthropic SDK (for Claude verification) |
verifier-openai | OpenAI SDK |
verifier-gemini | Google Generative AI SDK |
verifier-azure | OpenAI SDK (used against Azure endpoints) |
await_human / await_human_sync
The primitive. Async and sync flavors:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
task | str | yes | Human-readable task description (shown in the dashboard / Slack / email). |
payload_schema | type[BaseModel] | yes | Pydantic class that defines the data the human reviews. |
payload | BaseModel | yes | Instance of payload_schema — the actual data. |
response_schema | type[BaseModel] | yes | Pydantic class for the response form. Drives the UI. |
timeout_seconds | int | yes | Min 60 (1 min), max 2,592,000 (30 days). |
assign_to | str | list[str] | dict | None | no | Routing target. See Routing. |
notify | list[str] | None | no | Channel destinations (slack:#x, email:y@z, …). |
verifier | VerifierConfig | None | no | Server-side LLM verification. See Verifier. |
idempotency_key | str | None | no | Default: sha256(task, payload)[:32]. See Idempotency. |
redact_payload | bool | no | Default False. When true, audit log + verifier prompt are scrubbed. |
server_url | str | None | no | Override AWAITHUMANS_URL env var / discovery file. |
api_key | str | None | no | Override AWAITHUMANS_ADMIN_API_TOKEN env var / discovery file. |
Returns
An instance ofresponse_schema — Pydantic-validated. If validation fails, raises SchemaValidationError.
Raises
| Exception | When |
|---|---|
TaskTimeoutError | Task hit timeout_seconds without completion. |
TaskCancelledError | Agent or operator cancelled. |
VerificationExhaustedError | Verifier rejected max_attempts times. |
SchemaValidationError | Response didn’t match response_schema. |
TaskNotFoundError | Task ID disappeared (DB reset?). |
TaskCreateError | Server rejected POST /api/tasks. |
PollError | Long-poll returned non-200. |
ServerUnreachableError | Couldn’t connect to server_url. |
MarketplaceNotAvailableError | Used assign_to={"marketplace": True}. Reserved for Phase 3. |
AwaitHumansError.
Verifier helpers
VerifierConfig you pass to await_human(verifier=...). The actual LLM call runs server-side. See Verifier.
Adapters
Temporal
LangGraph
CLI
awaithumans dev auto-generates PAYLOAD_KEY, ADMIN_API_TOKEN, and the SQLite DB if missing. Writes ~/.awaithumans-dev.json so the SDK auto-discovers the running server.
Configuration
The SDK reads configuration in this order (first match wins):- Function-call args (
server_url=,api_key=) - Environment variables (
AWAITHUMANS_URL,AWAITHUMANS_ADMIN_API_TOKEN) - Discovery file (
~/.awaithumans-dev.json) - Defaults (
http://localhost:3001, no token)
Type stubs
The package ships withpy.typed. mypy/pyright pick up the types automatically: