persona.architect (sync: ArchitectClient, async: AsyncArchitectClient) wraps
/api/v1/developer/architect/agui — a conversational co-pilot that creates/edits Agents via
tool calls, on your behalf.
Unlike the Chat client, there’s no agent_id to pass (it’s always
this one dedicated Architect) and no thread selection (one implicit conversation per caller).
Ownership: control-plane vs. runtime-plane
The Architect is one of the few surfaces that works in both modes:- Omit
external_user_id— the Architect builds/edits Agents owned by your whole Project (the SDK-reachable equivalent of a Project Admin managing the shared roster by hand). - Set
external_user_id— the Architect builds/edits Agents owned by that one external user instead — the same dual-mode ownership convention every other resource follows.
EXTERNAL_USER_REQUIRED guard on this endpoint — a bare Project credential works fine.
Methods
messages: list[{"role": "user" | "assistant", "content": str}] — plain text only. resume
answers a pending interrupt from a previous run (see
Human-in-the-loop — same
protocol as the chat client).
Basic usage
async for/await:
Human-in-the-loop: confirming Agent edits
Because the Architect mutates real Agents, its sensitive tool calls (e.g.upsert_agent) pause
for human approval when the target Agent’s configuration requires it. send_message() surfaces
this as result["interrupt"] (kind "hitl" or "clarification"), exactly like the chat client —
resume on the next call with messages=[] and resume set:
Streaming behavior
Same as the chat client: SSE-delivered events, tolerant parsing (malformed frames skipped, never raised), 429 retries apply, and a JSON error envelope raises a typedPersonaApiError instead of
appearing as an event. No contextOverride/cancellation parameter in this SDK — wrap in
asyncio.wait_for(...) for timeouts.