Conduit Rust SDK
This repository is the public mirror, documentation surface, and issue tracker for the Conduit Rust SDK.
Conduit is a behavioral intelligence API with two primary workflows:
reportsturns a recording into a structured behavioral analysis for one selected speaker.matchingevaluates one target subject against a group in a closed interpretation context.
Install
Runtime Support
This SDK targets server-side Rust runtimes.
| Capability | Rust server runtime |
|---|---|
Source::file(...) |
Supported |
Source::url(...) |
Supported |
Source::path(...) |
Supported |
receipt.handle.wait() |
Supported |
receipt.handle.stream() |
Supported |
webhooks.verify_signature() |
Supported |
Notes:
- The SDK is designed for server-side use with a secret API key.
Source::file,Source::url, andSource::pathcurrently materialize uploads in memory before submission.Source::url(...)performs an SDK-side fetch, then uploads the fetched bytes to Conduit.handle.wait()andhandle.stream()are polling helpers for local tools and scripts. Webhooks are the recommended production completion path.
Mental Model
The client is intentionally small:
conduit.reports()is the main onboarding surface.conduit.matching()is the stable matching workflow.conduit.webhooks()verifies and parses webhook deliveries.conduit.primitives()exposes advanced low-level resources formedia,jobs, andentities.
Create calls return a receipt immediately after any upload step completes and the job is accepted. Use:
- webhooks in production
receipt.handle.wait()in local development or scriptsreceipt.handle.stream()when you want status and stage events while polling
Quickstart: Reports With Webhooks
use ;
use HeaderMap;
async
async
Quickstart: Matching
use ;
async
Local Development: Wait For Completion
wait() and stream() are convenience helpers for scripts and local development. They are not the default production integration path.
use ;
use Duration;
async
Core Types
Sourcechooses where input media comes from: an existingmedia_id, in-memory bytes, a remote URL, or a filesystem path.Targetselects which speaker should be analyzed in a report.SubjectRefreferences either a stable entity or a media target for matching.WebhookEndpointconfigures the completion webhook attached tocreate(...)calls.WaitOptionsandStreamOptionscustomize polling helpers.
Primitives
conduit.primitives() exposes the advanced stable surface:
primitives.mediauploads and manages source mediaprimitives.jobsinspects and cancels long-running jobsprimitives.entitiesreads and updates stable speaker identities
Use primitives when you need lower-level control. For onboarding, start with reports().
Webhooks
Webhook handling should always follow this order:
- Read the exact raw request body.
- Call
verify_signature(...)before parsing anything. - Call
parse_event(...)to get a typedWebhookEvent. - Handle known events such as
ReportCompletedorMatchingFailed.
Signature verification expects the conduit-signature header and validates the delivery with HMAC-SHA256.
Errors
The crate returns conduit_rs::Error for all SDK failures.
Useful consumer-facing helpers:
error.code()returns a stable SDK or API error codeerror.request_id()returns the request identifier when the API provided oneerror.status()returns the HTTP status code for API-derived failures
Typical categories include:
- initialization and configuration failures
- source validation and remote fetch failures
- typed API failures such as auth, validation, rate limits, and insufficient credits
- webhook verification failures
- timeout, cancellation, and stream errors
Behavior Notes And Limits
reports().create(...)never waits for analysis completion.matching().create(...)never waits for matching completion.Source::url(...)follows redirects up to the server-side limit configured by the SDK.Source::path(...)resolves relative paths from the current working directory.ReportHandle::report()andMatchingHandle::matching()returnOk(None)until the job has completed successfully.
Local Checks
Issues
- Report SDK issues:
https://github.com/mappa-ai/conduit-rs/issues