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.5.tar.gz (7.8 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.5-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tasksmind-0.1.5.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for tasksmind-0.1.5.tar.gz
Algorithm Hash digest
SHA256 6b6b5586f01d1b4e0f8cbd5d175ae5c0e1cb9c8aa6a6b61e42770b0dc4d8a901
MD5 3b0ac4ab49305456596941827fc1c4e4
BLAKE2b-256 9fac77accdc229ff9b1059616782c6a14eb340efe7cfe2866f9361f6e9313ca4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tasksmind-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for tasksmind-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0c4d90a5781e7bf3dfab226ad691f00a30d0e8a935002f9510da24bf94efd6ab
MD5 5c31d61584c08531e3281130a73ee247
BLAKE2b-256 9917d78d65dc61ce98d70c18c101922eff9f425c78257c557f68c1e0d4683c54

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