# AI Support Client

A Python client library for integrating AI-powered customer support into your applications.

## Installation

```bash
pip install ai-support-client
```

## Quick Start

```python
from ai_support_client import AISupport

# Initialize the client
client = AISupport(
    api_key="your_api_key",
    project_id="your_project_id"
)

# Handle a customer inquiry
response = client.handle_inquiry(
    message="How do I reset my password?",
    inquiry_type="chat",
    context={
        "customer_id": "12345",
        "previous_interactions": []
    }
)

print(response.message)
```

## Features

- Easy integration with AI Support API
- Support for chat, voice, and email inquiries
- Customizable context for better AI responses
- Rate limiting and error handling
- Type hints for better IDE support

## Documentation

### Initialization

```python
client = AISupport(
    api_key="your_api_key",
    project_id="your_project_id",
    base_url="https://api.aisupport.com/v1"  # Optional
)
```

### Methods

#### handle_inquiry

Handle a customer inquiry and get an AI-generated response.

```python
response = client.handle_inquiry(
    message="How do I reset my password?",
    inquiry_type="chat",  # "chat", "voice", or "email"
    context={
        "customer_id": "12345",
        "previous_interactions": []
    }
)
```

#### get_usage

Get current API usage statistics.

```python
usage = client.get_usage()
print(f"API calls this month: {usage.total_calls}")
```

## Error Handling

The library raises specific exceptions for different error cases:

- `AISupportAuthError`: Authentication errors
- `AISupportRateLimitError`: Rate limit exceeded
- `AISupportAPIError`: General API errors

Example:

```python
from ai_support_client.exceptions import AISupportAuthError

try:
    response = client.handle_inquiry(message="Hello")
except AISupportAuthError:
    print("Invalid API key")
```

## License

MIT License