Metadata-Version: 2.4
Name: uip-ai-sdk
Version: 1.0.0
Summary: UIP-AI Python SDK — integrate with the UIP-AI Platform: workflows, jobs, templates, credentials
Author: Anthony Chong
License: MIT
Project-URL: Homepage, https://github.com/your-org/uip-sdk-python
Project-URL: Documentation, https://uip-ai.dev/docs/sdk
Keywords: uip,sdk,workflow,automation,integration
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.0.0

# UIP-AI Python SDK

> Python client for the [UIP-AI Platform](https://uip-ai.dev) — workflows, jobs, templates, credentials.

## Install

```bash
pip install uip-sdk
```

Or install from source:

```bash
cd packages/uip-sdk-python
pip install -e .
```

## Quick Start

```python
from uip.sdk import UIPClient

client = UIPClient(
    base_url="http://localhost:8000",
    token="<your-api-token>",
)

# Health check
print(client.monitoring.health())

# List workflows
for wf in client.workflows.list():
    print(f"  {wf.id}: {wf.name}")

# Deploy a template
workflow = client.templates.deploy(
    "telegram-ai-assistant",
    parameters={"bot_token": "..."},
)

# Submit and wait for completion
job = client.jobs.submit(workflow.id)
result = job.wait(timeout=60)
print(f"Job {job.id}: {job.status}")
```

## Resources

| Resource | Description |
|----------|-------------|
| `client.workflows` | CRUD for workflow definitions |
| `client.jobs` | Submit, poll, cancel, stream jobs |
| `client.templates` | List and deploy templates |
| `client.credentials` | Store and manage secrets |
| `client.connectors` | Inspect registered connector types |
| `client.ai` | List AI providers and models |
| `client.monitoring` | Platform health and status |
| `client.manifest` | System capabilities and version |

## Examples

### Deploy and run a template

```python
wf = client.templates.deploy("demo-hello-world")
job = client.jobs.submit(wf.id)
result = job.wait(timeout=30)
print(result.result)
```

### Stream job events

```python
for event in client.jobs.stream(job.id):
    print(f"[{event['event']}] {event['data']}")
```

### Credential management

```python
cred = client.credentials.create(
    name="OpenAI Key",
    provider="openai",
    type="api_key",
    value="sk-...",
)
```

## Error Handling

```python
from uip.sdk import UIPClient, NotFoundError, ValidationError

client = UIPClient(base_url="...", token="...")
try:
    wf = client.workflows.get("nonexistent")
except NotFoundError:
    print("Workflow not found")
except ValidationError as e:
    print(f"Invalid data: {e.detail}")
```

## Version Compatibility

See the [System Manifest](http://localhost:8000/api/manifest) for the supported platform version.
