Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Arthur Observability SDK

Python SDK for sending traces and managing prompts with the Arthur GenAI Engine.


Installation

pip install arthur-observability-sdk

To instrument a specific framework, install its extra:

pip install "arthur-observability-sdk[openai]"
pip install "arthur-observability-sdk[langchain]"
pip install "arthur-observability-sdk[anthropic]"

How-to guides

Full guides are in docs/:

  • Getting started — initialisation, session/user context, framework instrumentation, shutdown
  • Prompt management — fetching and rendering versioned prompts, PROMPT span attributes

Quick start

from arthur_observability_sdk import Arthur

arthur = Arthur(
    api_key="your-api-key",       # or set ARTHUR_API_KEY env var
    task_id="<your-task-uuid>",
    service_name="my-app",
)
arthur.instrument_openai()

# Tag all spans in this block with session and user
with arthur.attributes(session_id="sess-1", user_id="user-42"):
    response = openai_client.chat.completions.create(...)

arthur.shutdown()

Prompt management

# Fetch a saved prompt by name (defaults to "latest" version)
prompt = arthur.get_prompt("system-instructions")

# Render with variable substitution
rendered = arthur.render_prompt(
    "rag-answer",
    variables={"context": "...", "question": "..."},
)
messages = rendered["messages"]

Supported instrumentors

Pass --extras to install any of these alongside the SDK.

Extra Framework Method
ag2 AG2 instrument_ag2()
agentminds AgentMinds instrument_agentminds()
agentspec AgentSpec instrument_agentspec()
agno Agno instrument_agno()
anthropic Anthropic instrument_anthropic()
autogen AutoGen instrument_autogen()
autogen-agentchat AutoGen AgentChat instrument_autogen_agentchat()
baml BAML instrument_baml()
bedrock AWS Bedrock instrument_bedrock()
beeai BeeAI instrument_beeai()
cohere Cohere instrument_cohere()
crewai CrewAI instrument_crewai()
dspy DSPy instrument_dspy()
google-adk Google ADK instrument_google_adk()
google-genai Google GenAI instrument_google_genai()
groq Groq instrument_groq()
guardrails Guardrails AI instrument_guardrails()
haystack Haystack instrument_haystack()
instructor Instructor instrument_instructor()
langchain LangChain instrument_langchain()
litellm LiteLLM instrument_litellm()
llama-index LlamaIndex instrument_llama_index()
mcp MCP instrument_mcp()
mistralai Mistral AI instrument_mistralai()
ollama Ollama instrument_ollama()
openai OpenAI instrument_openai()
openai-agents OpenAI Agents instrument_openai_agents()
pipecat Pipecat instrument_pipecat()
portkey Portkey instrument_portkey()
smolagents SmolAgents instrument_smolagents()
together Together AI instrument_together()
vertexai Vertex AI instrument_vertexai()
claude-agent-sdk Claude Agent SDK instrument_claude_agent_sdk()

Install all at once: pip install "arthur-observability-sdk[all]"


Developer guide

Setup

cd arthur-observability-sdk

# 1. Generate the API client (requires Node.js and Java)
./scripts/generate_openapi_client.sh generate python

# 2. Install dependencies (also registers the generated client in the venv)
./scripts/generate_openapi_client.sh install python

Note: python/src/arthur_genai_client/ is auto-generated and gitignored. You must run ./scripts/generate_openapi_client.sh generate python after cloning, and again whenever the GenAI Engine API changes. See Regenerating the API client.

Running tests

# Run from arthur-observability-sdk/python/
cd python

# Unit tests only (fast, no network)
uv run pytest tests -m "unit_tests" -v

# Integration/smoke tests (builds wheel, installs into a fresh venv)
uv run pytest tests -m "integration_tests" -v

# All tests
uv run pytest tests -v

Linting

# Run from arthur-observability-sdk/
./scripts/lint.sh

Or individually (from arthur-observability-sdk/python/):

cd python
uv run black src tests
uv run isort src tests --profile black
uv run autoflake --remove-all-unused-imports --in-place --recursive src tests
uv run mypy src/arthur_observability_sdk

Regenerating the API client

python/src/arthur_genai_client/ is auto-generated from the GenAI Engine OpenAPI spec and is not committed to the repository. Regenerate it after cloning or whenever the API changes:

./scripts/generate_openapi_client.sh generate python

Requires Node.js (any recent LTS) and Java 11+.

Building the wheel

uv build --wheel

Release files for arthur-observability-sdk 2.1.920.dev0

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

Built distribution (wheel)

Table of built distributions (wheels) for arthur-observability-sdk 2.1.920.dev0
File Interpreter ABI Platform
arthur_observability_sdk-2.1.920.dev0-py3-none-any.whl Python 3 none any Details

Release files / arthur_observability_sdk-2.1.920.dev0-py3-none-any.whl

Download URL arthur_observability_sdk-2.1.920.dev0-py3-none-any.whl
Size 845.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
279995750ef4d4911495510f0a1ae5f8195405db80184b067425f662cefa4708
BLAKE2b-256 checksum
How to use checksums
acaff1febce8d2e2ad144e348333b2c5322f583073a983c97d22a8adb321ab16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.1.920.dev0 This release

1 release file

2.1.801

1 release file

2.1.762

1 release file

2.1.748

1 release file

2.1.725

1 release file

2.1.717

1 release file

2.1.699

1 release file

2.1.683

1 release file

2.1.656

1 release file

2.1.652

1 release file

2.1.646

1 release file

2.1.644

1 release file

2.1.581

1 release file

2.1.579

1 release file

2.1.563

1 release file

2.1.543

1 release file

2.1.529

1 release file

2.1.516

1 release file

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

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