Documentation Index
Fetch the complete documentation index at: https://mintlify.com/iii-hq/sdk/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheIII struct is the main entry point for the SDK. It manages WebSocket connections to the III Engine, handles function registration, and provides methods for invoking remote functions.
Creating a Client
III::new
Create a new III client with default worker metadata.WebSocket address of the III Engine (e.g.,
ws://localhost:49134)A new III client instance
III::with_metadata
Create a new III client with custom worker metadata.WebSocket address of the III Engine
Custom metadata describing this worker (runtime, version, name, OS)
Connection Management
connect
Connect to the III Engine and start the message loop.Returns
Ok(()) on successful connection, or an error if connection failsThe
connect method spawns a background task that maintains the WebSocket connection. If the connection is lost, it will automatically reconnect with exponential backoff.shutdown_async
Shutdown the client and flush all pending telemetry data.When the
otel feature is enabled, this method waits for all spans, metrics, and logs to be exported before returning. Use this instead of the deprecated shutdown() method to ensure telemetry is not lost.Configuration
address
Get the WebSocket address this client connects to.set_metadata
Set custom worker metadata (must be called beforeconnect).
Worker metadata to register with the engine
set_otel_config
Set OpenTelemetry configuration (requiresotel feature, must be called before connect).
OpenTelemetry configuration including service name, metrics settings, etc.
Types
WorkerMetadata
Metadata about a worker that is registered with the engine.- Runtime:
"rust" - Version: SDK version from
Cargo.toml - Name:
"{hostname}:{pid}" - OS: System architecture and family
- Telemetry: Language locale from environment
IIIError
Error types returned by SDK operations.See Also
- Functions API - Register and handle function invocations
- Invocation API - Call remote functions
- Telemetry API - Configure OpenTelemetry