Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

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
agent-framework Agent Framework instrument_agent_framework()
agentspec AgentSpec instrument_agentspec()
agno Agno instrument_agno()
anthropic Anthropic instrument_anthropic()
autogen AutoGen instrument_autogen()
autogen-agentchat AutoGen AgentChat instrument_autogen_agentchat()
bedrock AWS Bedrock instrument_bedrock()
beeai BeeAI instrument_beeai()
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()
monkai-agent Monkai Agent instrument_monkai_agent()
openai OpenAI instrument_openai()
openai-agents OpenAI Agents instrument_openai_agents()
openlit OpenLIT instrument_openlit()
openllmetry OpenLLMetry instrument_openllmetry()
pipecat Pipecat instrument_pipecat()
portkey Portkey instrument_portkey()
pydantic-ai Pydantic AI instrument_pydantic_ai()
smolagents SmolAgents instrument_smolagents()
strands-agents Strands Agents instrument_strands_agents()
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)
poetry run pytest tests -m "unit_tests" -v

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

# All tests
poetry run pytest tests -v

Linting

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

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

cd python
poetry run black src tests
poetry run isort src tests --profile black
poetry run autoflake --remove-all-unused-imports --in-place --recursive src tests
poetry 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

poetry build --format wheel

Metadata

Release files for arthur-ai-observability-sdk 2.1.477

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-ai-observability-sdk 2.1.477
File Interpreter ABI Platform Actions
arthur_ai_observability_sdk-2.1.477-py3-none-any.whl Python 3 none any Details for arthur_ai_observability_sdk-2.1.477-py3-none-any.whl

Release files / arthur_ai_observability_sdk-2.1.477-py3-none-any.whl

Download URL arthur_ai_observability_sdk-2.1.477-py3-none-any.whl
Size 759.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27351eda00510aad455b071cad64df6ac1c9c1d05c4cb4908739066f9508b1f8
BLAKE2b-256 checksum
How to use checksums
0dd1eda12934b3a7fb666fc51e1409abedbed17f74bb6184d685f57a2627ad92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 23, 2026.

Transparency log

Security for arthur-ai-observability-sdk 2.1.477

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.

Full provenance

All 1 file in this release has been uploaded with provenance metadata.

Attestation for arthur_ai_observability_sdk-2.1.477-py3-none-any.whl

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 Mar 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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