Overview
Thesketricgen Python package provides one typed SketricGenClient for the Runtime API and the supported Admin API operations. Use it to run agents, stream responses, attach files, handle human-in-the-loop (HITL) pauses, browse Teamspace resources, and manage Brand Agents and connectors.
SDK version 0.3.0 removed the separate AdminClient. The same client now routes runtime and management calls to the correct API.
Requirements
- Python 3.9 or later
sketricgen>=0.3.0- A Teamspace API key beginning with
sk_api_
Installation
Configure the client
Set the single supported API-key environment variable:Run an agent
Async
Sync
user_input is required unless the request resumes a HITL pause or includes at least one file. Its maximum length is 10,000 characters.
Stream a response
run_workflow(..., stream=True) returns an async iterator. The synchronous method returns a regular iterator.
RUN_FINISHED, RUN_ERROR, and RUN_PAUSED_HITL as terminal through event.is_terminal.
Handle human-in-the-loop requests
HITL is opt-in. Setenable_hitl=True on the initial request and every resume request where the agent may pause for an answer, approval, or rejection.
review_configs entry:
For multiple pending actions, provide one decision per action in the same order as
hitl_request.action_requests. Resume on the same conversation_id, include the returned request_id, and do not send a new user_input. A resumed run can pause again.
For streaming runs, capture the deep_agents_hitl custom event and stop when RUN_PAUSED_HITL arrives. Resume with a new run_workflow() call using the same typed HitlResume payload.
Attach files
Pass one or more local paths throughfile_paths. The SDK uploads them in parallel, registers the resulting assets, and includes them in the workflow request.
Supported file types
An unsupported type raises
SketricGenContentTypeError; an oversized file raises SketricGenFileSizeError.
Use the control plane
Management operations use namespaces on the sameSketricGenClient. The API key must have Manage resources access.
Identify the Teamspace
List scoped resources
Project, agent, and knowledge-base lists transparently follow pagination. They fetch pages lazily as you consume the iterator.list_sync() on each namespace for synchronous iteration.
Manage Brand Agents
list_templates(), create(), and get_status(). Every async method has a synchronous _sync variant.
Manage connectors
_sync variants. Opening the hosted connection link and completing external authorization remains a human step.
Response models
ChatResponse
StreamEvent
Error handling
code. All SDK-specific errors inherit from SketricGenError.

