Task AI Python SDK
Public HTTP client for Task AI workflows and agents (/api/v1).
Gumloop equivalents: start_pipeline → start a workbook run; get_pl_run → poll status, log, and outputs.
Install
pip install phthos-task
Requires Python 3.11+.
Auth
- In Task AI, open Settings → API keys and create a key (
tai_…). - Enable scope
v1:workflow:runto start or kill workflow runs. - Pass the key and your Task AI origin (the same host as the web app).
from phthos_task import TaskAI
client = TaskAI(
api_key="tai_...", # or TASK_AI_API_KEY
base_url="https://tasks.example.com", # or TASK_AI_BASE_URL
)
Local default base_url is http://localhost:3012.
Short runnable scripts: examples/.
Workflows (start_pipeline / get_pl_run)
from phthos_task import TaskAI
with TaskAI(api_key="tai_...", base_url="https://tasks.example.com") as client:
flows = client.list_workflows()
wb = flows[0]
tab = wb.tabs[0]
started = client.start_pipeline(wb.id, tab_id=tab.id, inputs={"input": "hello"})
run = client.wait_for_run(started.run_id)
print(run.state, run.outputs)
# one-shot
done = client.run_pipeline(wb.id, tab_id=tab.id, input="hello")
Named Start fields can be passed as kwargs (input="hello") or as inputs={...}. API runs use the tab’s live checkpoint (save/sync on the canvas first) — not unsaved editor state.
PipelineRun.state matches Gumloop: RUNNING, DONE, FAILED, TERMINATED.
status = client.get_pl_run(started.run_id)
client.kill_run(started.run_id)
Connected WORKFLOW tasks
Sync run of a child workflow task (already waits server-side):
result = client.run_workflow("task_...", inputs={"input": "hello"})
print(result.outputs)
Agents
started = client.start_agent("task_...", "Summarize yesterday's leads")
done = client.wait_for_agent(started.task_id, started.interaction_id)
print(done.response)
Agent start/status need v1:agent:start and v1:agent:read.
HTTP map
| SDK | Method | Path |
|---|---|---|
list_workflows |
GET | /api/v1/workflows |
start_pipeline |
POST | /api/v1/workflows/:workbookId/run |
get_pl_run |
GET | /api/v1/runs/:runId |
kill_run |
POST | /api/v1/runs/:runId/kill |
run_workflow |
POST | /api/v1/tasks/:taskId/run_workflow |
start_agent |
POST | /api/v1/tasks/:taskId/start_agent |
agent_status |
GET | /api/v1/tasks/:taskId/agent_status/:interactionId |
Develop
cd python
python -m pip install -e ".[dev]"
python -m ruff check src tests
python -m pytest
python -m build
PyPI: from the python/ directory, python -m build then upload (twine or the publish-pypi workflow).
Metadata
Release files for phthos-task 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| phthos_task-0.1.0.tar.gz | 10.5 kB | Without provenance | Details for phthos_task-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| phthos_task-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for phthos_task-0.1.0-py3-none-any.whl |
Total release size: 19.5 kB
Release files / phthos_task-0.1.0.tar.gz
| Download URL | phthos_task-0.1.0.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0146fc66f7cb55ce0cbae3610acb501fac6be2e42480a79e4f2dcb15a00d156c
|
|
BLAKE2b-256 checksum How to use checksums |
6484250cf012b19529a1c46dd7591e906654a59bf2ce267a1b2e6b5afe95455c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / phthos_task-0.1.0-py3-none-any.whl
| Download URL | phthos_task-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
46883a3f6419a1e6c56bb11cbb29a7ef17b646f4a4fcd8101f7ad0b5b7be8b36
|
|
BLAKE2b-256 checksum How to use checksums |
378a5ab5a0c98d53076ee1fa9a989fa5d8808d49db2e8d2a026c3148ff423281
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for phthos-task 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.