Metadata-Version: 2.4
Name: lens-python
Version: 0.1.0
Summary: Python SDK for LENS local LLM observability
Author: Noel
License-Expression: MIT
Project-URL: Homepage, https://github.com/Daboss57/lens
Project-URL: Repository, https://github.com/Daboss57/lens
Project-URL: Issues, https://github.com/Daboss57/lens/issues
Keywords: llm,observability,openai,anthropic,gemini,tracing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: httpx<1.0.0,>=0.27.0
Provides-Extra: dev
Requires-Dist: pytest<9.0.0,>=8.2.0; extra == "dev"
Provides-Extra: openai
Requires-Dist: openai>=1.0.0; extra == "openai"
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.34.0; extra == "anthropic"
Provides-Extra: gemini
Requires-Dist: google-genai>=1.0.0; extra == "gemini"
Provides-Extra: providers
Requires-Dist: openai>=1.0.0; extra == "providers"
Requires-Dist: anthropic>=0.34.0; extra == "providers"
Requires-Dist: google-genai>=1.0.0; extra == "providers"

# LENS Python SDK

Python tracing SDK for LENS local LLM observability.

Repository: `https://github.com/Daboss57/lens`

## Install

Core client only:

```bash
pip install lens-python
```

With provider SDKs:

```bash
pip install "lens-python[providers]"
```

Or install one provider extra at a time:

```bash
pip install "lens-python[openai]"
pip install "lens-python[anthropic]"
pip install "lens-python[gemini]"
```

## Quick Start

```python
from lens import LensClient

client = LensClient.from_env()

client.record(
    provider="openai",
    model="gpt-5.4",
    request={"messages": [{"role": "user", "content": "hello"}]},
    response={"content": "hi"},
    prompt_tokens=42,
    completion_tokens=8,
    latency_ms=512,
    status="success",
)
```

## Release Status

The SDK package metadata is set up for PyPI publishing and GitHub Actions release automation.

## Environment

- `LENS_ENABLED`
- `LENS_API_URL`
- `LENS_INGEST_PATH`
- `LENS_TIMEOUT_SECONDS`

## Provider Wrappers

- `lens.openai`
- `lens.anthropic`
- `lens.gemini`

Importing those modules patches the provider clients so model calls can be captured and forwarded to the LENS API.

## Behavior

- sync + async client support
- silent-fail trace delivery when LENS is unavailable
- compatible with OpenAI, Anthropic, and Gemini wrappers
