Multi-language SDK for the III Engine - a WebSocket-based function orchestration platform.
The III SDK provides a unified interface for building distributed applications with function registration, invocation, and trigger management. It enables seamless communication between services through a WebSocket-based engine.
- Node.js - TypeScript/JavaScript SDK with full async support
- Python - Async Python SDK with function registration
- Rust - High-performance async Rust SDK with automatic reconnection
- Function Registration - Register callable functions that can be invoked by other services
- Function Invocation - Call functions synchronously or asynchronously (fire-and-forget)
- Trigger Management - Create and manage triggers (API, events, schedules, etc.)
- Custom Trigger Types - Define your own trigger types with custom logic
- Context-Aware Logging - Built-in logging with execution context
- OpenTelemetry Integration - Full observability with traces, metrics, and logs (Node.js)
- Automatic Reconnection - Resilient WebSocket connections with auto-reconnect (Rust)
npm install iii-sdkimport { III } from 'iii-sdk'
const iii = new III('ws://localhost:49134')
iii.registerFunction({ id: 'myFunction' }, (req) => {
return { status_code: 200, body: { message: 'Hello, world!' } }
})
iii.registerTrigger({
type: 'http',
function_id: 'myFunction',
config: { api_path: '/hello', http_method: 'POST' },
})
const result = await iii.call('myFunction', { param: 'value' })pip install iii-sdkfrom iii import III
iii = III("ws://localhost:49134")
async def my_function(data):
return {"result": "success"}
iii.register_function("my.function", my_function)
result = await iii.call("other.function", {"param": "value"})[dependencies]
iii-sdk = { path = "path/to/iii" }use iii_sdk::III;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let iii = III::new("ws://127.0.0.1:49134");
iii.connect().await?;
iii.register_function("my.function", |input| async move {
Ok(json!({ "message": "Hello, world!", "input": input }))
});
let result: serde_json::Value = iii
.call("my.function", json!({ "param": "value" }))
.await?;
println!("result: {result}");
Ok(())
}Detailed documentation for each SDK:
Example applications demonstrating SDK usage:
- Node.js 20+ and pnpm (for Node.js SDK)
- Python 3.8+ and uv (for Python SDK)
- Rust 1.70+ and Cargo (for Rust SDK)
- III Engine running on
ws://localhost:49134
cd packages/node && pnpm install && pnpm build
cd packages/python/iii && python -m build
cd packages/rust/iii && cargo build --releasecd packages/node && pnpm test
cd packages/python/iii && pytest
cd packages/rust/iii && cargo testThe III SDK communicates with the III Engine via WebSocket connections. The engine acts as a central orchestrator for:
- Function registry and routing
- Trigger management and execution
- Inter-service communication
- Telemetry and observability
Apache License 2.0 - see LICENSE for details.
Motia LLC