Skip to main content

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

  1. In Task AI, open Settings → API keys and create a key (tai_…).
  2. Enable scope v1:workflow:run to start or kill workflow runs.
  3. 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).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phthos_task-0.1.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phthos_task-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file phthos_task-0.1.0.tar.gz.

File metadata

  • Download URL: phthos_task-0.1.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for phthos_task-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0146fc66f7cb55ce0cbae3610acb501fac6be2e42480a79e4f2dcb15a00d156c
MD5 e6ab30353ad1d81d49b466155f000808
BLAKE2b-256 6484250cf012b19529a1c46dd7591e906654a59bf2ce267a1b2e6b5afe95455c

See more details on using hashes here.

File details

Details for the file phthos_task-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: phthos_task-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for phthos_task-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46883a3f6419a1e6c56bb11cbb29a7ef17b646f4a4fcd8101f7ad0b5b7be8b36
MD5 3eab9906d794fb671987d8772b8e8907
BLAKE2b-256 378a5ab5a0c98d53076ee1fa9a989fa5d8808d49db2e8d2a026c3148ff423281

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page