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.1.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.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tasksmind-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 d80dcc646041ffc44f7dc9ab5fdcc8b9a77193b2ac583c4fbc1dff61ae6548c2
MD5 d713d6a89a417106f5b8f31de1bd145e
BLAKE2b-256 2d0611ecc005be159e29684ce9cd3f9fe17dd593a980db14a7db0e781b2a0ba1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tasksmind-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5bb516fd887739caf19ec382e768fd2f7a022c519fe359aea1f19b7edf84c7c2
MD5 e7699591f6ce18ca6d4d0a22878f31c3
BLAKE2b-256 83b64a451d139843e4da44fd3d655d3ccaa9fb3f4f387d5ce9a32df224a5ef9d

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