Python SDK
Use the Python client to make typed synchronous or asynchronous requests to a Siliqun Rotor engine.
Complete customer application
The examples below make local typed-decision requests; they do not load a saved Studio flow or execute a customer tool. For a complete customer interaction, follow the Studio first-decision guide and the customer leave-assistant guide: create a free Studio project, import the leave tool declarations, prepare and Save & Activate a flow, create a project key in Customer Settings, then download the customer application from Ship. The application verifies the customer's session and reads the authorized HR record through its own server-side handler, then returns a readable answer from that record. The project key goes to the engine; the customer's session goes to the application's identity and HR services, not the engine. Ask and refusal outcomes do not call the HR handler. This guide describes the integration contract, not a live employer connection.
Installation
Install the Python SDK from the newest published release on GitHub. These links always point at that release, so the same commands keep working after every release. Download the source package and the checksum manifest, then verify and install it from the directory containing both files:
curl -fL https://github.com/siliqun-rotor/releases/releases/latest/download/siliqun_rotor.tar.gz -o siliqun_rotor.tar.gz
curl -fL https://github.com/siliqun-rotor/releases/releases/latest/download/SHA256SUMS -o SHA256SUMS
On macOS, verify the source package with grep 'siliqun_rotor.tar.gz$' SHA256SUMS | shasum -a 256 -c -; on Linux, use grep 'siliqun_rotor.tar.gz$' SHA256SUMS | sha256sum --check -. Install the source package after its checksum passes:
python -m pip install ./siliqun_rotor.tar.gz
The distribution is siliqun-rotor; import SiliqunRotorClient from siliqun_rotor. The client defaults to a local engine at http://127.0.0.1:8700; pass base_url to use another engine URL. The constructor accepts api_key, optional client_id, and custom headers. api_key is sent as bearer authorization and client_id as X-SQR-Client-ID; attribution is optional unless the project requires it. For a customer application, keep these server-side and never expose the project key in browser code.
Local typed-decision example
from siliqun_rotor import SiliqunRotorClient
client = SiliqunRotorClient(base_url="http://127.0.0.1:8700")
# Ask a choice question with concrete evidence
result = client.decide(
state={"customer_report": "The package was delivered to the wrong address."},
questions={
"topic": {
"type": "choice",
"instructions": {"question": "Determine the customer support topic."},
"criteria": {
"delivery": "Lost, delayed, or misdelivered shipments",
"damage": "Broken or compromised contents",
"billing": "Invoice or refund request",
},
}
},
)
decision = result.answers["topic"]
if decision.outcome == "decided" and decision.may_act:
print(f"Decided: {decision.choice}")
if decision.evidence:
print(f"Evidence: {decision.evidence[0].snippet}")
Async Client
import asyncio
from siliqun_rotor import AsyncSiliqunRotorClient
async def main():
async with AsyncSiliqunRotorClient(base_url="http://127.0.0.1:8700") as client:
result = await client.decide(
state={"account": "enterprise_corp", "unpaid_invoices": 3},
questions={
"suspend": {
"type": "noul",
"criteria": {"true": "More than 2 unpaid invoices", "false": "Account in good standing"},
}
},
)
print("Suspend decision:", result.answers["suspend"].outcome)
asyncio.run(main())