Metadata-Version: 2.1
Name: meowdel
Version: 0.1.0
Summary: Official Python SDK for Meowdel AI API
Home-page: https://github.com/straticus1/meowdel-python
Author: After Dark Systems
Author-email: support@meowdel.ai
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
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
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests (>=2.31.0)
Requires-Dist: urllib3 (>=2.0.0)
Provides-Extra: dev
Requires-Dist: pytest (>=7.0.0) ; extra == 'dev'
Requires-Dist: pytest-cov (>=4.0.0) ; extra == 'dev'
Requires-Dist: black (>=23.0.0) ; extra == 'dev'
Requires-Dist: mypy (>=1.0.0) ; extra == 'dev'
Requires-Dist: ruff (>=0.1.0) ; extra == 'dev'

# Meowdel Python SDK

Official Python client for the Meowdel AI API.

## Installation

```bash
pip install meowdel
```

Or install from source:

```bash
git clone https://github.com/afterdarksystems/meowdel-python
cd meowdel-python
pip install -e .
```

## Quick Start

```python
from meowdel import MeowdelClient

# Initialize client
client = MeowdelClient(api_key="mdl_your_key_here")

# Simple chat
response = client.chat("How do I fix this TypeScript error?")
print(response.message)

# Chat with personality and Brain context
response = client.chat(
    message="Explain quantum computing",
    personality="professor",
    use_brain_context=True
)
print(response.message)

# Combine multiple operations
response = client.combine(
    query="What is machine learning?",
    operations=["search", "explain", "visualize"],
    primary_personality="professor"
)
print(response.result)
```

## Configuration

### API Key

Set your API key via environment variable:

```bash
export MEOWDEL_API_KEY="mdl_your_key_here"
```

Or pass it directly:

```python
client = MeowdelClient(api_key="mdl_your_key_here")
```

Get your API key from: https://meowdel.ai/profile

### Custom Base URL

```python
client = MeowdelClient(
    api_key="mdl_your_key_here",
    base_url="https://api.meowdel.ai"  # Custom endpoint
)
```

## API Reference

### Chat

```python
response = client.chat(
    message="Your question here",
    personality="mittens",  # mittens, luna, professor, ninja, zoomies
    use_brain_context=False,
    conversation_history=[
        {"role": "user", "content": "Previous message"},
        {"role": "assistant", "content": "Previous response"}
    ]
)

print(response.message)
print(response.personality)
print(response.tokens_used)
```

### Combine Operations

```python
response = client.combine(
    query="What is recursion?",
    operations=["search", "explain", "code_example"],
    primary_personality="professor",
    secondary_personality="mittens"
)

print(response.result)
print(response.operations)
```

### Context Manager

```python
with MeowdelClient(api_key="mdl_your_key") as client:
    response = client.chat("Hello!")
    print(response.message)
# Session automatically closed
```

## Available Personalities

- `mittens` - Playful and friendly
- `luna` - Elegant and sophisticated
- `professor` - Scholarly and analytical
- `ninja` - Stealthy and mysterious
- `zoomies` - Hyper and energetic
- And more!

## Error Handling

```python
from meowdel import MeowdelClient, AuthenticationError, RateLimitError, APIError

try:
    client = MeowdelClient(api_key="mdl_invalid")
    response = client.chat("Hello")
except AuthenticationError:
    print("Invalid API key")
except RateLimitError:
    print("Rate limit exceeded")
except APIError as e:
    print(f"API error: {e}")
```

## Examples

### Chat with conversation history

```python
from meowdel import MeowdelClient, Message

client = MeowdelClient()

history = [
    Message(role="user", content="What is Python?"),
    Message(role="assistant", content="Python is a programming language..."),
]

response = client.chat(
    message="Can you give me an example?",
    conversation_history=history
)
```

### Using Brain context

```python
# Query with knowledge graph context
response = client.chat(
    message="What did we discuss about Docker?",
    use_brain_context=True,
    personality="professor"
)
```

## Development

```bash
# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black meowdel/

# Type checking
mypy meowdel/
```

## License

MIT

## Support

- Documentation: https://docs.meowdel.ai
- Issues: https://github.com/afterdarksystems/meowdel-python/issues
- Email: support@meowdel.ai
