Metadata-Version: 2.4
Name: lantern-ai
Version: 0.1.3
Summary: Python SDK for Lantern agent observability
License-Expression: MIT
Requires-Python: >=3.9
Requires-Dist: httpx>=0.24.0
Provides-Extra: all
Requires-Dist: anthropic>=0.25.0; extra == 'all'
Requires-Dist: autogen-agentchat>=0.4.0; extra == 'all'
Requires-Dist: crewai>=0.80.0; extra == 'all'
Requires-Dist: dspy>=2.5.0; extra == 'all'
Requires-Dist: haystack-ai>=2.0.0; extra == 'all'
Requires-Dist: openai>=1.0.0; extra == 'all'
Requires-Dist: pydantic-ai>=0.1.0; extra == 'all'
Requires-Dist: smolagents>=1.0.0; extra == 'all'
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.25.0; extra == 'anthropic'
Provides-Extra: autogen
Requires-Dist: autogen-agentchat>=0.4.0; extra == 'autogen'
Provides-Extra: crewai
Requires-Dist: crewai>=0.80.0; extra == 'crewai'
Provides-Extra: dspy
Requires-Dist: dspy>=2.5.0; extra == 'dspy'
Provides-Extra: haystack
Requires-Dist: haystack-ai>=2.0.0; extra == 'haystack'
Provides-Extra: openai
Requires-Dist: openai>=1.0.0; extra == 'openai'
Provides-Extra: pydantic-ai
Requires-Dist: pydantic-ai>=0.1.0; extra == 'pydantic-ai'
Provides-Extra: smolagents
Requires-Dist: smolagents>=1.0.0; extra == 'smolagents'
Provides-Extra: test
Requires-Dist: httpx; extra == 'test'
Requires-Dist: pytest-asyncio>=0.21; extra == 'test'
Requires-Dist: pytest>=7.0; extra == 'test'
Description-Content-Type: text/markdown

# lantern-ai

Python SDK for [Lantern](https://openlanternai.com) -- agent observability for the enterprise.

## Quick Start

```bash
pip install lantern-ai
```

```python
from lantern_ai import LanternTracer, LanternExporter

tracer = LanternTracer(
    service_name="my-agent",
    agent_name="support-triage",
    environment="production",
    exporter=LanternExporter(
        endpoint="https://ingest.openlanternai.com",
        api_key="lnt_your_api_key",
    ),
)
```

## Auto-Instrumentation

```python
from anthropic import Anthropic
from lantern_ai import wrap_anthropic_client

client = Anthropic()
wrap_anthropic_client(client, tracer)

# All messages.create() calls are now traced automatically
```

## Manual Tracing

```python
trace = tracer.start_trace(agent_name="my-agent")

with tracer.start_span(trace.id, type="llm_call", model="claude-sonnet-4-5-20251001") as span:
    span.set_input(messages=[{"role": "user", "content": "Hello"}])
    # ... do work ...
    span.set_output(content="Hi there!")
    span.set_tokens(input_tokens=10, output_tokens=5)

tracer.end_trace(trace.id)
```

## Console Exporter (Development)

```python
from lantern_ai import LanternTracer, ConsoleExporter

tracer = LanternTracer(
    service_name="my-agent",
    agent_name="support-triage",
    exporter=ConsoleExporter(verbose=True),
)
```

## OpenAI Auto-Instrumentation

```python
from openai import OpenAI
from lantern_ai import wrap_openai_client

client = OpenAI()
wrap_openai_client(client, tracer)

# All chat.completions.create() calls are now traced automatically
```
