Skip to main content

Build tools, agents, and pipelines for your STROT instance

Project description

STROT

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'],
    model='gpt-4o',
    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.2.tar.gz (33.4 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.2-py3-none-any.whl (42.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: strot_ai-0.1.2.tar.gz
  • Upload date:
  • Size: 33.4 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.2.tar.gz
Algorithm Hash digest
SHA256 00300c1df004a284aa3b0ad53e85611e8f0dbd045a96d3cadfe227ebcb86d88d
MD5 05f1d16fae539ef900ec53b6a93a920e
BLAKE2b-256 603b41c0789d94da48b5a5fb4e2532dae561c094ce4867b3460d370b266ef46e

See more details on using hashes here.

Provenance

The following attestation bundles were made for strot_ai-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: strot_ai-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 42.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bc16c8bd45b4535b4e4b5c4c4393e2e60971df81a92297298ef57b6fcee02a2e
MD5 781ff8fbe05214fef35f01f3f72f58c7
BLAKE2b-256 d0e400aee96e9cec12ad868be4b60ced8df57db49b7c3a7c429969473c9ac124

See more details on using hashes here.

Provenance

The following attestation bundles were made for strot_ai-0.1.2-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