Metadata-Version: 2.5
Name: spoor-sdk
Version: 0.0.1
Summary: Send agent and LLM traces to Spoor
Requires-Python: >=3.10
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.38
Requires-Dist: opentelemetry-instrumentation-anthropic>=0.62
Requires-Dist: opentelemetry-instrumentation-bedrock>=0.62
Requires-Dist: opentelemetry-instrumentation-cohere>=0.62
Requires-Dist: opentelemetry-instrumentation-crewai>=0.62
Requires-Dist: opentelemetry-instrumentation-google-generativeai>=0.62
Requires-Dist: opentelemetry-instrumentation-groq>=0.62
Requires-Dist: opentelemetry-instrumentation-langchain>=0.62
Requires-Dist: opentelemetry-instrumentation-litellm>=0.62
Requires-Dist: opentelemetry-instrumentation-llamaindex>=0.62
Requires-Dist: opentelemetry-instrumentation-mistralai>=0.62
Requires-Dist: opentelemetry-instrumentation-ollama>=0.62
Requires-Dist: opentelemetry-instrumentation-openai-agents>=0.62
Requires-Dist: opentelemetry-instrumentation-openai>=0.62
Requires-Dist: opentelemetry-sdk>=1.38
Description-Content-Type: text/markdown

# spoor-sdk

Send agent and LLM traces to Spoor.

```python
import spoor

spoor.init()  # reads SPOOR_API_KEY, SPOOR_URL (default http://localhost:8000)
```

`init()` turns on OpenLLMetry instrumentation for every installed library it supports
(openai, anthropic, LangChain/LangGraph, litellm, OpenAI Agents SDK, CrewAI, LlamaIndex,
google-genai, Bedrock, Mistral, Cohere, Groq, Ollama; see `src/spoor/libraries.py`) and exports
spans over OTLP/HTTP. If the app already has an OTel `TracerProvider`, Spoor's exporter is added to it.

Options: `api_key`, `url`, `service_name` (else `OTEL_SERVICE_NAME`, else the script name),
`environment` (else `SPOOR_ENVIRONMENT`, else `main`).

## Operations

Each run belongs to an operation. It's named after the function that made the call, or explicitly:

```python
@spoor.operation("triage")          # or bare @spoor.operation, or `with spoor.operation("triage"):`
def triage(ticket): ...
```

## Test

```bash
uv run pytest
```
