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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tasksmind-0.1.3.tar.gz
  • Upload date:
  • Size: 5.6 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.3.tar.gz
Algorithm Hash digest
SHA256 752c8c454e0da83c68910bb8b687114c9a9e2f8450516e3999cd42e184879913
MD5 8cc423d314700c65d82c48d2ad592074
BLAKE2b-256 3d82296824a5c964588a35d164af34c9654d1a11503ede6aee701a37c0e7b461

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tasksmind-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.4 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7f57bc2c8c3a64560393b55837cea129457770df49c4017eb4b53f11490092ef
MD5 2bdec7710f6aacf961bd654be2868753
BLAKE2b-256 0b06460dd5274725d553247e5b2d6e8c12c7f9db4fe1158765d48f905f5e33b3

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