Skip to main content

Build tools, agents, and pipelines for your STROT instance

Project description

STROT

PyPI Python License

Build tools, agents, pipelines, and dashboards for your STROT instance — in Python.

Installation

pip install strot-ai

Quick Start

strot login                         # Authenticate
strot init tool my-calculator       # Scaffold a project
cd my-calculator                    # Edit main.py with any editor
strot test                          # Validate locally
strot deploy                        # Ship to your STROT instance

SDK Reference

Tools (@function)

from strot_ai import function, llm

@function(
    name='calculate_roi',
    description='Calculate return on investment',
    category='finance',
    parameters=[
        {'name': 'cost', 'type': 'number', 'description': 'Total cost'},
        {'name': 'revenue', 'type': 'number', 'description': 'Total revenue'},
    ],
    returns={'type': 'number', 'description': 'ROI percentage'}
)
class CalculateROI:
    def run(self, cost: float, revenue: float) -> float:
        return ((revenue - cost) / cost) * 100

Agents (@agent)

from strot_ai import agent

@agent(
    name='sales_analyst',
    description='Analyzes sales data and provides insights',
    tools=['calculate_roi', 'top_n'],
    temperature=0.1,
)
class SalesAnalyst:
    system_prompt = """You are a sales analyst.
    Analyze data and provide actionable recommendations."""

Cortex Pipelines (@cortex)

from strot_ai import cortex
from strot_ai.cortex import Flow

@cortex(name='daily_etl', description='Daily ETL pipeline')
class DailyETL:
    def build(self, flow: Flow):
        data = flow.data_connector('load_sales', query_id=42)
        cleaned = flow.transform(data, prompt='Clean and normalize the data')
        flow.publish(cleaned, name='daily_report', destination='slack', channel='#data')

Pages / Dashboards (@page)

from strot_ai import page
from strot_ai.pages import Dashboard, Row, KPI, Chart, Table

@page(name='sales_dashboard', description='Sales overview', type='dashboard')
class SalesDashboard:
    def layout(self):
        return Dashboard(
            Row(
                KPI(query_id=1, label='Revenue', format='currency'),
                KPI(query_id=2, label='Orders'),
                KPI(query_id=3, label='Customers'),
            ),
            Row(
                Chart(query_id=5, type='line', title='Revenue Trend', span=8),
                Chart(query_id=6, type='donut', title='By Region', span=4),
            ),
            Row(
                Table(query_id=7, title='Recent Orders', sortable=True),
            ),
        )

LLM

All LLM calls go through your STROT instance — no API keys needed in your code.

from strot_ai import llm

result = llm.complete("Summarize this: " + text)
result = llm.chat([{"role": "user", "content": "What is 2+2?"}])
category = llm.classify("Great product!", ["positive", "negative", "neutral"])
data = llm.extract("John is 30 years old", {"name": "string", "age": "number"})

Data Access

from strot_ai import strot, query, query_one

rows = strot.queries['monthly_sales'].execute()
rows = query("SELECT * FROM users", data_source_id=1)
row = query_one("SELECT * FROM users WHERE id = 1", data_source_id=1)

Destinations

from strot_ai import email, slack, webhook

email.send(to="team@example.com", subject="Report Ready", body="Done.")
slack.send(channel="#alerts", message="New alert!")
webhook.post(url="https://api.example.com/hook", data={"event": "deploy"})

CLI Reference

strot login                              # Authenticate
strot login --token sk_live_abc123       # Direct API key
strot whoami                             # Show current user/org
strot logout                             # Clear credentials

strot init tool my-calculator            # Scaffold tool
strot init agent my-analyst              # Scaffold agent
strot init cortex my-pipeline            # Scaffold pipeline
strot init page my-dashboard             # Scaffold dashboard

strot test                               # Validate locally
strot deploy                             # Deploy to STROT
strot deploy --dry-run                   # Validate without deploying

strot resources                          # List all resources
strot resources queries                  # List saved queries
strot resources datasources              # List data sources

Configuration

Credentials stored in ~/.strot/credentials:

version: 1
current_profile: default
profiles:
  default:
    url: https://app.strot.ai
    api_key: sk_live_abc123
    org: 98bf9a0a-c9cd-42a8-9ea4-4f7fee9a4535

Priority: Constructor args > Environment variables (STROT_URL, STROT_API_KEY) > Credentials file

License

MIT

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

strot_ai-0.1.3.tar.gz (33.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

strot_ai-0.1.3-py3-none-any.whl (43.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: strot_ai-0.1.3.tar.gz
  • Upload date:
  • Size: 33.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for strot_ai-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9dd671aa77e4131e64f36518bf849f89ca7a54bc9ef2b7aa6e4348259434ebb8
MD5 ee0cf6817db6d5dfdac9fc86502a55fb
BLAKE2b-256 082e862dea98d37410dc276bae44b5430942f034dc5feb14629921c90fb94fe9

See more details on using hashes here.

Provenance

The following attestation bundles were made for strot_ai-0.1.3.tar.gz:

Publisher: publish.yml on strot-ai/strot-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: strot_ai-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 43.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for strot_ai-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a74060149df8c764ae1d9e917244c78fa63893f5af6f0ebc0879578014733cae
MD5 45afd4e6dbf52f4201e06d77daa7252b
BLAKE2b-256 1b5362d000e6ae22ce6619f814c4e4c9ef14d627e400856997f926a46a1cd034

See more details on using hashes here.

Provenance

The following attestation bundles were made for strot_ai-0.1.3-py3-none-any.whl:

Publisher: publish.yml on strot-ai/strot-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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