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) -> strget_task_status(task_id) -> dictget_task_result(task_id) -> dictwait_for_completion(task_id, poll_interval=2.0, max_attempts=150) -> dictrun_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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file taskforceai-0.1.0.tar.gz.
File metadata
- Download URL: taskforceai-0.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba853f5a9117f0b372a85e185a57442cc121a676c9c8a31fc3025a9d1522ea1b
|
|
| MD5 |
85a3b6cb2d145be5d12745f064e7b000
|
|
| BLAKE2b-256 |
a756aacb0fedc8ddfe0e7c554f73adb2e3fce2f54da028d0109ff1093b1b3d28
|
File details
Details for the file taskforceai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: taskforceai-0.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d44a234afb02a1c4acd2419f93a36dcbf89169c9c9d7171a46d7eafb5edbb977
|
|
| MD5 |
17deacce6ca35c39ac1e17ac3a994cc9
|
|
| BLAKE2b-256 |
6985ed299bb7c777508776f16cfef42f116f998b3cb4dc7bb296ffd1f1a8cb97
|