Introduce an admin portal (React + Nginx), WebSocket routing, and API versioning middleware with `/api/v1/` prefix deprecation. Add master API key authentication, new Prometheus metrics for AI token consumption and active WebSockets, and extend S3 config with a public endpoint URL. Update test paths and fixtures to align with the new routing structure.
37 lines
970 B
Markdown
37 lines
970 B
Markdown
# Imago Python SDK
|
|
|
|
The official Python client for interacting with the Imago backend API.
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
pip install imago-client
|
|
```
|
|
|
|
## Basic Usage
|
|
|
|
```python
|
|
import asyncio
|
|
from imago_client import HubClient
|
|
|
|
async def main():
|
|
async with HubClient("http://localhost:8000", api_key="your-api-key") as client:
|
|
# Upload an image
|
|
with open("photo.jpg", "rb") as f:
|
|
image = await client.images.upload(f.read(), "photo.jpg")
|
|
print(f"Uploaded! ID: {image.id}")
|
|
|
|
# Stream real-time pipeline events
|
|
stream = client.images.stream_pipeline(image.id, "your-api-key")
|
|
async for event in stream.stream_events():
|
|
print(f"Event: {event}")
|
|
|
|
# Get processed data
|
|
processed = await client.images.get(image.id)
|
|
if processed.ai:
|
|
print("AI Description:", processed.ai.description)
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|
|
```
|