SEIF Docs

Python client

IMPLEMENTED stdlib-only client: sdk/python/context_client.py, included in Runtime and control-plane distributions. Copy/import it in the consuming application; no package publication is needed.

from context_client import ContextClient
client = ContextClient(runtime_url, token=credential)
resolved = client.resolve(consumer="support-agent", objective="answer-customer",
                          input={"message": "refund policy"})
# Your sender owns model execution and can target any provider.
result = client.send_context(resolved, sender, provider={"name": "my-provider", "model": "my-model"})

For a Registry environment with an application credential (0.4.0):

client = ContextClient.for_environment(registry_url, project_id, "production", app_token)

The Registry routes new resolutions to the environment's active deployment. resolve returns deploymentId; expand and reports pass it so late reports reach the originating (possibly draining) deployment. Reports carry an auto-generated reportId (override with report_id=) and are retried on RUNTIME_UNAVAILABLE/RUNTIME_TIMEOUT without creating duplicates; resolve is never retried by the client. Timeouts raise RUNTIME_TIMEOUT, distinct from RUNTIME_UNAVAILABLE.

Methods: resolve, expand, report_consumption, report_outcome, health, build and trace. Errors expose safe runtime codes. send_context copies exactly the context messages, calls the supplied sender and reports only after it returns successfully; mutation is rejected. It proves what the application dispatched through that callback, not the provider's internal processing. Never claim a successful HTTP response proves agent outcome. Report outcome labels separately.

examples/sdk/agent.py is an executable external application that exercises resolve, expand, trace correlation, consumption, outcome, health/Build metadata and unknown-consumer errors against an actual Runtime. Its deterministic sender fixture needs no model API key. See its function signatures for the full runnable contract.

For a single integration boundary, client.run_turn(request, sender, evaluate=None, provider=None) resolves, sends the application-owned callback and reports consumption. An optional evaluator returns the existing outcome fields plus explicit evaluation identifiers (Reliability Impact). turn['result'] survives reporting errors, returned as safe codes in turn['reportingErrors']; inspect these to detect incomplete telemetry. Resolve/sender failures propagate. No evaluator means no outcome label. Mutated context messages are not reported as matching consumption. Redirects are refused so credentials stay at the configured endpoint.

See the independent HTTP application for a complete adoption and regression proof.

Versioned tools

Context and tool delivery documents tool declarations and profile rules, v2 tool Builds, executor bindings, synthetic tests, operator approval, SDK integration and effect-free replay. Tool-free Builds preserve the v1 contract.