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

import os
from tasksmind import TasksMind

client = TasksMind(api_key=os.environ["TASKSMIND_API_KEY"])

# 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.output)
else:
    print(f"Run failed with status: {result.status}")

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 Resources

client.runs

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
runs.wait(run_id, timeout_s, poll_s, terminal_statuses) Poll until terminal status

Run object

Attribute Type Description
.id str Run UUID
.status str Current status (running, completed, failed, etc.)
.output str Output text from the run
.summary str | None Short summary
.pr_url str | None Pull request URL if one was created
.pr_number int | None Pull request number
.is_success() bool True when status is completed or succeeded

Error Handling

from tasksmind.exceptions import AuthError, NotFoundError, APIError, TimeoutError

try:
    result = client.runs.wait(run_id, timeout_s=120)
except TimeoutError:
    print("Run did not finish in time")
except AuthError:
    print("Invalid API key")
except APIError as e:
    print(f"API error {e.status_code}: {e}")

Context Manager

with TasksMind() as client:
    run = client.runs.create(repo_url="https://github.com/org/repo")

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.0.tar.gz (5.3 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.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tasksmind-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 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.0.tar.gz
Algorithm Hash digest
SHA256 c7a914f36ae839606162cc784d3cd2a25690d2ec0b457754e34b9d74412c95fe
MD5 9a17c9766de00032ab5433ac642a7bf0
BLAKE2b-256 c9f9a97790fde35b6a65fa63b2d9948171733aa5c81c62cccf5dee90d1ef3ead

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tasksmind-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b1dce797a2c586784153766c06b7df18751e4af8f553519f1a106e60df2177f
MD5 26479352ad687ee10dcbb021cfc70127
BLAKE2b-256 0b11b4819903779c165ebc33da6bada0920846026e6ae313a7993f25c4cdfe51

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