Metadata-Version: 2.5
Name: render-lab-tasks-replicate
Version: 0.1.0
Summary: replicate tasks for Render Workflows
Project-URL: Repository, https://github.com/render-lab/render-tasks-python
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: httpx<0.29,>=0.28
Requires-Dist: render-lab-media-contract<0.2,>=0.1.0
Requires-Dist: render-lab-tasks-core<0.2,>=0.1.1
Requires-Dist: render-lab-triggers<0.2,>=0.1.0
Requires-Dist: render==1.0.1
Description-Content-Type: text/markdown

# render-lab-tasks-replicate

Python port of the twelve Replicate prediction, training, file, and model tasks.
Install with `pip install render-lab-tasks-replicate render==1.0.1` once released.
Import wrapped tasks and raw injectable implementations from `render_lab_tasks_replicate.tasks`.
The package root is registration-free. Task names and JSON fields match TypeScript.

## Environment

`REPLICATE_API_TOKEN` is read lazily on the first Replicate request. Source URL requests
use only the headers supplied in their media source; vendor credentials are never added.

## Behavior and verification

Await operations check status once and let the durable task retry policy poll again.
The HTTP adapter makes one attempt per call. Cancellation and deletion converge on
404/409 responses as in TypeScript. Prediction/training outputs retain nested JSON
and expose HTTPS media URLs separately. Inline media is capped at 1 MiB. File downloads
stop when their configured source byte limit is exceeded (default 100 MiB).
See ADR-0013 for deliberate retry and media validation differences from the TS SDK.
No live Replicate verification has been performed; credentials and live checks are
tracked in the repository testing backlog.

## Webhook adapter

`render_lab_tasks_replicate.webhooks.replicate_adapter(on_event, ...)` returns a
registration-free adapter for `render_lab_triggers`. The callback receives the
verified event and returns `{"task": "namespace.task", "args": [event]}` or `None`.
The signing credential `REPLICATE_WEBHOOK_SIGNING_SECRET` is read inside verification unless
provided explicitly. Importing this module does not register tasks. Signature
checks use the raw body; live delivery remains in the testing backlog.
