Skip to main content

Continua SDK for Python

Python SDK for sending AI agent traces, spans, sessions, events, and engine control requests to Continua.

Installation

pip install continua-sdk

Quick Start

Initialize the client once at process startup:

from continua import Continua, span, trace

Continua.init(
    api_key="your-api-key",
    endpoint="https://api.your-continua-host.com",
    ingest_mode="server_default",  # or "sync", "async_v2"
)


@trace(name="answer_question")
def answer_question(question: str) -> str:
    with span("retrieve_context", kind="tool") as s:
        s.set_input({"question": question})
        context = "retrieved context"
        s.set_output({"context": context})

    with span("call_model", kind="llm") as s:
        s.set_input({"question": question, "context": context})
        answer = "model answer"
        s.set_output({"answer": answer})
        return answer

For a local or self-hosted Continua server, point the SDK at your server URL:

from continua import Continua

Continua.init(
    api_key="dev-api-key",
    endpoint="http://localhost:8080",
)

This package is the client library only. It sends data to a hosted or self-hosted Continua server; it does not install or run the Go server, Postgres, River workers, or debugger UI.

Async Ingest Modes

  • server_default: defer to the server rollout setting.
  • sync: send sync=true and wait for inline processing.
  • async_v2: opt into true async ingest with X-Continua-Async-Version: 2.

True async is not read-after-write. If your code needs the batch to be fully processed before it reads the ingested data back, use ingest_mode="sync" or poll with wait_for_batch():

result = client.wait_for_batch(batch_id, timeout=30, poll_interval=0.5)

Development

# From sdks/python
uv sync

uv run pytest

uv run mypy src/

uv build

Publishing

The Python package is published from this directory:

cd sdks/python
uv build
uv publish

Prefer PyPI Trusted Publishing in CI for repeatable releases once the project is ready for public distribution.

Metadata

Release files for continua-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for continua-sdk 0.1.0
File Size Uploaded
continua_sdk-0.1.0.tar.gz 115.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for continua-sdk 0.1.0
File Interpreter ABI Platform
continua_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 147.8 kB

Release files / continua_sdk-0.1.0.tar.gz

Download URL continua_sdk-0.1.0.tar.gz
Size 115.7 kB
Tags Source
SHA-256 checksum
How to use checksums
50318f70d4d61842f10feaa9f28feb32c2515665da0bf30814d0b899f6ab549c
BLAKE2b-256 checksum
How to use checksums
6d245b470987ba07299c35ff290342e2f32a11f92604962e77f0a184aff72bd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / continua_sdk-0.1.0-py3-none-any.whl

Download URL continua_sdk-0.1.0-py3-none-any.whl
Size 32.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4e6aafcc63a14af57d73974bec21872b1a3ac528d29d4d30e6de297f7fc28bd
BLAKE2b-256 checksum
How to use checksums
651358874549be698d91d532902dd3431e6c2210837fb141ba8cc5b1ca816ace
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page