Python SDK for StackSpot AI - Remote Quick Commands and more
Project description
stkai
An unofficial, opinionated Python SDK for StackSpot AI — Execute Remote Quick Commands (RQCs) and interact with AI Agents with built-in resilience.
Note: This is a community-driven SDK, not officially maintained by StackSpot. It was built to fill gaps we encountered in real-world projects — such as retries, rate limiting, and batch execution — that the platform's API alone doesn't provide out of the box.
Design Principles
This SDK is opinionated by design. It prioritizes:
- Reliability over latency — Built-in retries, rate limiting, and fault tolerance mechanisms
- Predictability over throughput — Synchronous, blocking API for straightforward debugging and reasoning
- Pragmatism over flexibility — Simple, direct API with well-designed extension points
- Convention over configuration — Sensible defaults and seamless StackSpot CLI integration
Installation
Install from PyPI:
pip install stkai
Requirements
- Python 3.12+
- StackSpot CLI installed and authenticated, or client credentials for standalone auth
Quick Start
Remote Quick Commands
Execute LLM-powered quick commands with automatic polling and retries:
from stkai import RemoteQuickCommand, RqcRequest
rqc = RemoteQuickCommand(slug_name="my-quick-command")
response = rqc.execute(
request=RqcRequest(payload={"code": "def hello(): pass"})
)
if response.is_completed():
print(response.result)
else:
print(response.error_with_details())
AI Agents
Chat with StackSpot AI Agents for conversational AI capabilities:
from stkai import Agent, ChatRequest
agent = Agent(agent_id="my-agent-slug")
response = agent.chat(
request=ChatRequest(user_prompt="What is SOLID?")
)
if response.is_success():
print(response.result)
else:
print(response.error_with_details())
Batch Processing
Process multiple requests concurrently with thread pool execution:
# RQC batch
responses = rqc.execute_many(
request_list=[RqcRequest(payload=data) for data in files]
)
completed = [r for r in responses if r.is_completed()]
# Agent batch
responses = agent.chat_many(
request_list=[ChatRequest(user_prompt=p) for p in prompts]
)
successful = [r for r in responses if r.is_success()]
Features
| Feature | Description | Docs |
|---|---|---|
| Remote Quick Commands | Execute AI commands with polling and retries | Guide |
| AI Agents | Chat with agents, batch execution, conversations, knowledge sources | Guide |
| Batch Execution | Process multiple requests concurrently (RQC and Agents) | RQC · Agents |
| Result Handlers | Customize response processing | Guide |
| Event Listeners | Monitor execution lifecycle | Guide |
| Rate Limiting | Token Bucket and adaptive AIMD algorithms | Guide |
| Configuration | Global config via code or environment variables | Guide |
Documentation
Full documentation available at: https://rafaelpontezup.github.io/stkai-sdk-python/
Development
# Clone and setup
git clone https://github.com/rafaelpontezup/stkai-sdk.git
cd stkai-sdk
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
# Run tests
pytest
# Run tests with coverage
pytest --cov=src --cov-report=term-missing
# Lint and type check
ruff check src tests
mypy src
# Build docs locally
pip install -e ".[docs]"
mkdocs serve
License
Apache License 2.0 - see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stkai-0.4.18.tar.gz.
File metadata
- Download URL: stkai-0.4.18.tar.gz
- Upload date:
- Size: 112.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2194c1d5de23ed1ed5c57fb3b8f74a9347cfc00a1a9059f6757936341084c1f
|
|
| MD5 |
f86914c487be61affc34d43f4cd9c086
|
|
| BLAKE2b-256 |
ef67a02c70fc3582e1882319a871e48654e7b09522a942bcabd75f48114582d6
|
Provenance
The following attestation bundles were made for stkai-0.4.18.tar.gz:
Publisher:
publish.yml on rafaelpontezup/stkai-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stkai-0.4.18.tar.gz -
Subject digest:
f2194c1d5de23ed1ed5c57fb3b8f74a9347cfc00a1a9059f6757936341084c1f - Sigstore transparency entry: 1009219748
- Sigstore integration time:
-
Permalink:
rafaelpontezup/stkai-sdk-python@343914994703f0beaafda51b418c1cbb9ae85a1d -
Branch / Tag:
refs/tags/v0.4.18 - Owner: https://github.com/rafaelpontezup
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@343914994703f0beaafda51b418c1cbb9ae85a1d -
Trigger Event:
push
-
Statement type:
File details
Details for the file stkai-0.4.18-py3-none-any.whl.
File metadata
- Download URL: stkai-0.4.18-py3-none-any.whl
- Upload date:
- Size: 91.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fca9b4083ad7d2e514dfb2c51272f07458671718eccd4b51b18d6121b729949b
|
|
| MD5 |
86528e1e325aee80927498cf62fa0fe7
|
|
| BLAKE2b-256 |
c481a325089e31ec534bfc4bf5a82874206d54f123bc9a006864e1b0a68575a9
|
Provenance
The following attestation bundles were made for stkai-0.4.18-py3-none-any.whl:
Publisher:
publish.yml on rafaelpontezup/stkai-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stkai-0.4.18-py3-none-any.whl -
Subject digest:
fca9b4083ad7d2e514dfb2c51272f07458671718eccd4b51b18d6121b729949b - Sigstore transparency entry: 1009219784
- Sigstore integration time:
-
Permalink:
rafaelpontezup/stkai-sdk-python@343914994703f0beaafda51b418c1cbb9ae85a1d -
Branch / Tag:
refs/tags/v0.4.18 - Owner: https://github.com/rafaelpontezup
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@343914994703f0beaafda51b418c1cbb9ae85a1d -
Trigger Event:
push
-
Statement type: