Metadata-Version: 2.4
Name: glassbrain
Version: 0.1.0
Summary: AI-native error tracking and observability for Python applications
Project-URL: Homepage, https://glassbrain.dev
Project-URL: Documentation, https://glassbrain.dev/docs
Project-URL: Repository, https://github.com/MSaiRam10/GlassBrain.dev
Project-URL: Issues, https://github.com/MSaiRam10/GlassBrain.dev/issues
Author-email: Glassbrain <contact@glassbrain.dev>
License-Expression: MIT
Keywords: ai,anthropic,debugging,error-tracking,llm,observability,openai,tracing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Debuggers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.8
Requires-Dist: httpx>=0.24
Provides-Extra: django
Requires-Dist: django; extra == 'django'
Provides-Extra: fastapi
Requires-Dist: fastapi; extra == 'fastapi'
Provides-Extra: flask
Requires-Dist: flask; extra == 'flask'
Description-Content-Type: text/markdown

# glassbrain

AI-native error tracking and observability for Python applications. Captures errors, LLM calls, and application traces with AI-powered fix suggestions.

## Installation

```bash
pip install glassbrain
```

## Quick Start

```python
from glassbrain import GlassBrain

gb = GlassBrain(api_key="gb_your_key")

# Capture errors
try:
    risky_operation()
except Exception as e:
    gb.capture_error(e, metadata={"user_id": "123"})

# Capture warnings and info
gb.capture_warning("Disk usage above 90%")
gb.capture_info("Deployment completed", metadata={"version": "1.2.0"})

# Get AI fix suggestions for a trace
suggestions = gb.get_suggestions(trace_id="...")
```

## Auto-trace OpenAI calls

```python
from openai import OpenAI
from glassbrain import GlassBrain, wrap_openai

gb = GlassBrain(api_key="gb_your_key")
client = wrap_openai(OpenAI(), gb)

# All completions are now traced automatically
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello"}]
)
```

## Auto-trace Anthropic calls

```python
from anthropic import Anthropic
from glassbrain import GlassBrain, wrap_anthropic

gb = GlassBrain(api_key="gb_your_key")
client = wrap_anthropic(Anthropic(), gb)

response = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}]
)
```

## Decorators

```python
from glassbrain import GlassBrain, trace_function, trace_endpoint

gb = GlassBrain(api_key="gb_your_key")

@trace_function(gb)
def process_data(items):
    # Automatically traces errors and performance
    ...

@trace_endpoint(gb)
def handle_request():
    # Traces API endpoint calls
    ...
```

## Framework Middleware

### FastAPI

```python
from fastapi import FastAPI
from glassbrain import GlassBrain
from glassbrain.middleware import FastAPIMiddleware

app = FastAPI()
gb = GlassBrain(api_key="gb_your_key")
app.add_middleware(FastAPIMiddleware, glassbrain=gb)
```

### Flask

```python
from flask import Flask
from glassbrain import GlassBrain
from glassbrain.middleware import FlaskMiddleware

app = Flask(__name__)
gb = GlassBrain(api_key="gb_your_key")
FlaskMiddleware(app, glassbrain=gb)
```

### Django

Add to `settings.py`:

```python
GLASSBRAIN_API_KEY = "gb_your_key"

MIDDLEWARE = [
    "glassbrain.middleware.DjangoMiddleware",
    ...
]
```

## Publishing to PyPI

```bash
cd packages/glassbrain-python
pip install build twine
python -m build
twine upload dist/*
```

## License

MIT
