Skip to main content

Python Examples

Complete working examples for integrating the Sigmic AI API into your Python applications.

Setup

Install the requests library:

SSE Stream Parser

Reusable generator to parse Server-Sent Events from the stream endpoint:

Create Task

Send Follow-up Message

Get Task Status

List Tasks

Cancel Task

List & Download Artifacts

Tool Approval Handler

Complete Workflow Example

File Upload Example

Error Handling

Async Example (with aiohttp)