Overview
Python SDK for the SketricGen Chat Server API. Build AI-powered workflows, chat applications, and document analysis tools.Requirements
- Python 3.9+
- Dependencies:
httpx>=0.25.0,pydantic>=2.0.0,typing-extensions>=4.0.0
Installation
Quick Start
Features
- Run Workflows: Execute chat/workflow requests with AI agents
- Streaming: Real-time streaming responses using Server-Sent Events
- File Attachments: Attach images and PDFs to workflows
- Async & Sync: Both async and synchronous API support
- Type Safety: Full type hints for IDE support
- Error Handling: Comprehensive custom exception types
Client Reference
SketricGenClient
The main client for interacting with the SketricGen API.Constructor
From Environment Variables
run_workflow()
Execute a workflow/chat request (async).ChatResponse if stream=False, AsyncIterator[StreamEvent] if stream=True
Example: Non-Streaming
Example: Streaming
run_workflow_sync()
Synchronous version ofrun_workflow().
ChatResponse if stream=False, Iterator[StreamEvent] if stream=True
Example
Response Models
ChatResponse
Response from a non-streaming workflow request.StreamEvent
Individual event from a streaming response.Streaming Events
The streaming API uses the AG-UI Protocol. Parse thedata field as JSON to access event details.

