Metadata-Version: 2.2
Name: openrouter_exception_handler
Version: 0.3.7
Summary: Handler for exceptions in Python with OpenRouter.ai
Author-email: Dannybombastic <dannybombastic@example.com>
License: MIT
Project-URL: Homepage, https://github.com/dannybombastic/openrouter_exception_handler
Project-URL: Repository, https://github.com/dannybombastic/openrouter_exception_handler
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: requests

# OpenRouter Exception Handler

A Python module distributed via pip that automatically handles exceptions using intelligent responses generated by OpenRouter.ai.

## 🚀 Installation

```bash
pip install openrouter_exception_handler
```

## 📌 Features

- Automatically captures Python exceptions during execution.
- Sends exception details to OpenRouter.ai.
- Displays intelligent responses from OpenRouter.ai directly in your stdout.
- Facilitates AI-assisted debugging, reducing the time needed for error diagnosis.

## 🔧 Quick Usage

Simply decorate your functions with `@exception_handler`:

```python
from openrouter_exception_handler import exception_handler

@exception_handler
def divide(a, b):
    return a / b

divide(10, 0)  # Will trigger ZeroDivisionError
```

### Example Output

```
❌ Exception captured:
Traceback (most recent call last):
  File "example.py", line 6, in wrapper
    return func(*args, **kwargs)
  File "example.py", line 10, in divide
    return a / b
ZeroDivisionError: division by zero

AI Response:
This exception occurs because you're trying to divide by zero. Validate your inputs before performing division to prevent this error.
```

## 🔑 Configuration

Define your OpenRouter.ai API key in the environment variable `APIKEY_OPENROUTER`:

```bash
export APIKEY_OPENROUTER="your_api_key_here"
```

## 📦 Installation

Install easily using pip:

```bash
pip install openrouter_exception_handler
```

## 📌 Requirements

- Python >= 3.6
- requests

## 📄 License

MIT
