Metadata-Version: 2.1
Name: mnnai
Version: 4.5.2
Summary: Module for using MNN API
Home-page: https://github.com/mkshustov/MNNAI
Author: mkshustov
Author-email: reverse.api.mnn@gmail.com
Project-URL: Documentation, https://github.com/mkshustov/MNNAI
Keywords: ai MNN chatgpt mnnai mnn
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests >=2.25.1
Requires-Dist: aiohttp

# MNNAI

This repository contains an example of how to use the mnnai library.

## Prerequisites

- Python 3.x
- MNNAI library installed. You can install it using pip:

```bash
pip install mnnai
```

## Usage

**Non-Streaming Chat**

```python
from mnnai import MNN

client = MNN(
    key='MNN API KEY',
    id='MNN ID',
    # max_retries=2, 
    # timeout=60
)

chat_completion = client.chat_create(
    messages=[
        {
            "role": "user",
            "content": "Hi",
        }
    ],
    model="gpt-4o-mini",
)
print(chat_completion)
```


**Image Generation**

```python
import base64
import os

response = client.Image_create(
    prompt="Draw a cute red panda",
    model='dall-e-3'
)

image_base64 = response['data'][0]['urls']

os.makedirs('images', exist_ok=True)

for i, image_base64 in enumerate(image_base64):
    image_data = base64.b64decode(image_base64)

    with open(f'images/image_{i}.png', 'wb') as f:
        f.write(image_data)

print("Images have been successfully downloaded!")
```


### Models

```python 
print(client.GetModels())
```

### Configuration
Replace the key and id parameters in the MNN client initialization with your own API key and user ID.
Adjust the prompt, model, and other parameters as needed for your specific use case.

### License
This project is licensed under the MIT License. See the LICENSE file for details.

### Discord 
https://discord.gg/Ku2haNjFvj
