Skip to main content

Official Python SDK for TaskForceAI multi-agent orchestration

Project description

TaskForceAI Python SDK

The official Python client for TaskForceAI's multi-agent orchestration platform.

  • ✅ Sync + async clients powered by httpx
  • ✅ Automatic authentication with your TaskForceAI API key
  • ✅ Convenience helpers for polling task completion
  • ✅ Rich error handling with status codes and retry-ready exceptions

Installation

python -m pip install taskforceai

Quick Start

from taskforceai import TaskForceAIClient

client = TaskForceAIClient(api_key="your-api-key")

task_id = client.submit_task("Analyze the security posture of this repository.")
result = client.wait_for_completion(task_id)

print(result["result"])
# Bring your own OpenRouter key (unlocks premium models)
task_id = client.submit_task(
    "Draft a quarterly strategy update.",
    open_router_key="sk-or-your-openrouter-key",
)

Async Variant

import asyncio
from taskforceai import AsyncTaskForceAIClient

async def main() -> None:
    async with AsyncTaskForceAIClient(api_key="your-api-key") as client:
        result = await client.run_task("Summarize the latest launch notes.")
        print(result["result"])

asyncio.run(main())

API Surface

Both clients expose the same methods:

  • submit_task(prompt, *, silent=False, mock=False, open_router_key=None) -> str
  • get_task_status(task_id) -> dict
  • get_task_result(task_id) -> dict
  • wait_for_completion(task_id, poll_interval=2.0, max_attempts=150) -> dict
  • run_task(prompt, ...) -> dict

All responses mirror the REST API payloads. Errors raise TaskForceAIError, which includes status_code for quick branching.

Development

python -m pip install -e "packages/python-sdk[dev]"
pytest packages/python-sdk/tests
ruff format packages/python-sdk/src packages/python-sdk/tests -q
ruff check packages/python-sdk/src packages/python-sdk/tests
mypy --config-file packages/python-sdk/pyproject.toml packages/python-sdk/src

License

MIT

Project details


Download files

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

Source Distribution

taskforceai-0.2.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

taskforceai-0.2.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file taskforceai-0.2.0.tar.gz.

File metadata

  • Download URL: taskforceai-0.2.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for taskforceai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ef9d8883352426fbe75fcd592a7f758008c28fed56c8f824ad0ec2bdccba9113
MD5 4d3e4115e332e81f4540dbbbf36f52d2
BLAKE2b-256 d3d708a7dddcc77f6a6c54e67032d5a4d729fec123785beb27d53b7b373ef28d

See more details on using hashes here.

File details

Details for the file taskforceai-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: taskforceai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for taskforceai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2fe38320fc76ef7f884f0e6e385f246a1103372e288ba23124f479ffe27e6c1
MD5 7375f82d1ffa27eb50ebfd2ba9d6f3c4
BLAKE2b-256 b48e868e5e13ef3a83c62a08f9e33e2e3f3c5509265aad8bb665b95f48a17002

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 Pingdom Monitoring Sentry Error logging StatusPage Status page