Skip to main content

TasksMind Python SDK — The AI Engineer for Developers on Call.

Project description

TasksMind Python SDK

The official Python client for the TasksMind API — The AI Engineer for Developers on Call.

Installation

pip install tasksmind

Quick Start

from tasksmind import TasksMind

client = TasksMind()  # reads TASKSMIND_API_KEY env var automatically

# Kick off a PR review
run = client.runs.create(
    repo_url="https://github.com/my-org/my-repo",
    repo_ref="main",
    payload={
        "intent": "review_pr",
        "target": {"pr_number": 42},
    },
)
print(f"Run started: {run.id}")

# Poll until complete (up to 10 minutes)
result = client.runs.wait(run.id, timeout_s=600)
if result.is_success():
    print(result.summary)
else:
    print(f"Run failed: {result.error}")

Configuration

Parameter Env variable Default
api_key TASKSMIND_API_KEY — (required)
base_url TASKSMIND_API_BASE_URL https://api.tasksmind.com
timeout 60 seconds

Available intents

Pass intent inside payload. Some intents need target.pr_number or raw_text.

Intent Required extras Description
summarize_repo Summarize the repository
review_pr target.pr_number Review a pull request
status_pr target.pr_number Get PR status / CI checks
changes_pr target.pr_number Describe what changed in a PR
fix_bug raw_text Investigate and fix a described bug
fix_ci target.pr_number Fix CI failures on a PR
root_cause target.pr_number Root-cause analysis
implement_feature raw_text Implement a described feature

client.runs methods

Method Description
runs.create(repo_url, repo_ref, payload) Create a new run
runs.get(run_id) Fetch a run by ID
runs.list(limit, offset, status) List runs for your account
runs.wait(run_id, timeout_s, poll_s) Poll until terminal status

Run object

Attribute Type Description
.id str Run UUID
.status str queued, running, completed, failed, error, cancelled
.output str Full output text from the run
.summary str | None Short AI-generated summary
.pr_url str | None Pull request URL if one was created
.pr_number int | None Pull request number
.error str | None Error message if run failed
.is_success() bool True when status is completed or succeeded

Error Handling

from tasksmind import TasksMind, AuthError, NotFoundError, APIError, TimeoutError

client = TasksMind()

try:
    run = client.runs.create(repo_url="https://github.com/org/repo")
    result = client.runs.wait(run.id, timeout_s=300)
except AuthError:
    print("Invalid API key")
except TimeoutError:
    print("Run did not finish in time")
except APIError as e:
    print(f"API error {e.status_code}: {e.body}")

Context Manager

with TasksMind() as client:
    run = client.runs.create(repo_url="https://github.com/org/repo")
    result = client.runs.wait(run.id, timeout_s=300)
    print(result.summary)

Requirements

  • Python 3.9+
  • httpx >= 0.24

Links

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

tasksmind-0.1.2.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

tasksmind-0.1.2-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file tasksmind-0.1.2.tar.gz.

File metadata

  • Download URL: tasksmind-0.1.2.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.14.2 HTTPX/0.28.1

File hashes

Hashes for tasksmind-0.1.2.tar.gz
Algorithm Hash digest
SHA256 03a6e62aa66b5d35ecdfc5b3d2ae12419f9ed8e14817858ec770d23c1e77ea10
MD5 b97ba1953961176d009f118aba93760f
BLAKE2b-256 8ce6b991b521358187ad989a56ea34b3bb4a7fe40e65d38948983109723bd211

See more details on using hashes here.

File details

Details for the file tasksmind-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: tasksmind-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.14.2 HTTPX/0.28.1

File hashes

Hashes for tasksmind-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9615412818c404d1b1c3c1c8d21fd1531b9a7894303286a8ac96222f2156a282
MD5 8219b26a47b342600ee9d65540bc22ca
BLAKE2b-256 00c508969cfac93f84e9ec027449b21b5bb20a2c3e1d95e8e2d02f710d715104

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